criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	for (auto &u : v) os << u << el;
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}

int main() {
	int N; cin >> N;
	vvint G(N);	
	for (int i = 0; i < N-1; i++) {
		int p, q;
		cin >> p >> q; --p, --q;
		G[p].push_back(q);
		G[q].push_back(p);
	}
	
	int maxd = 0;
	function<int(int, int)> dfs = [&](int u, int prev) {
		int ret = (int)(G[u].size() == 2);
		vint dat;
		for (auto &v : G[u]) {
			if (v != prev) dat.push_back(dfs(v, u));
		}

		sort(begin(dat), end(dat), greater<>());
		int maxv = 0;
		if (dat.size() >= 1) {
			maxv = dat[0];
			if (dat.size() >= 2) chmax(maxd, dat[0] + dat[1]);
		}
		chmax(maxd, ret + maxv);
		return (ret + maxv);
	};

	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (G[i].size() == 1) cnt++;
	}
	dfs(i, -1);
	cout << cnt + maxd << endl;
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:13: error: 'i' was not declared in this scope
   78 |         dfs(i, -1);
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


template<typename F>
struct FixPoint : F{
  FixPoint(F&& f):F(forward<F>(f)){}
  template<typename... Args>
  decltype(auto) operator()(Args&&... args) const{
    return F::operator()(*this,forward<Args>(args)...);
  }
};
template<typename F>
inline decltype(auto) MFP(F&& f){
  return FixPoint<F>{forward<F>(f)};
}

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;

  vector< vector<int> > G(n);
  for(int i=1;i<n;i++){
    int p,q;
    cin>>p>>q;
    p--;q--;
    G[p].emplace_back(q);
    G[q].emplace_back(p);
  }

  vector<int> dp1(n,0),dp2(n,0),dp3(n,0);
  int ans=0;
  MFP([&](auto dfs,int v,int p)->void{
        int sum=0;
        vector<int> vs,mx;
        for(int u:G[v]){
          if(u==p) continue;
          dfs(u,v);
          sum+=dp2[u];
          mx.emplace_back(dp1[u]);
          vs.emplace_back(dp1[u]-dp2[u]);
        }
        if(vs.empty()){
          dp1[v]=1;
          dp2[v]=1;
          dp3[v]=1;
          return;
        }
        while(vs.size()<2) vs.emplace_back(0);
        while(mx.size()<2) mx.emplace_back(0);
        sort(vs.rbegin(),vs.rend());
        sort(mx.rbegin(),mx.rend());

        // c1 -> v -> c2, not take v
        chmax(dp3[v],sum+vs[0]+vs[1]);
        chmax(dp3[v],mx[0]+mx[1]);

        for(int u:G[v]){
          if(u==p) continue;
          chmax(dp3[v],sum-dp2[u]+dp3[u]);
          chmax(ans,dp3[u]+1);
        }

        // c1 -> v, take v
        chmax(dp1[v],mx[0]+1);

        // c1 -> v, not take v
        chmax(dp1[v],sum+vs[0]);

        // not take v
        chmax(dp2[v],sum);

        // c1 -> v -> c2, take v
        chmax(ans,mx[0]+1+mx[1]);
        chmax(ans,dp1[v]);
        chmax(ans,dp2[v]);
        chmax(ans,dp3[v]);

        continue;
        cout<<v;
        cout<<", dp1[v] = "<<dp1[v];
        cout<<", dp2[v] = "<<dp2[v];
        cout<<", dp3[v] = "<<dp3[v]<<endl;
      })(0,-1);

  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:83:9: error: continue statement not within a loop
   83 |         continue;
      |         ^~~~~~~~
Language: C++

#include <cstdio>
#include <vector>
using namespace std;

const int N = 100000;
vector<int> g[N];
int sz[N], dp[N];

void dfs(int u, int prev) {
        vector<int> len;
        for (auto v : g[u]) if (prev != v) {
                dfs(v, u);
                len.push_back(sz[v]);
                dp[u] = max(dp[u], dp[v]);
                sz[u] = max(sz[u], sz[v] + (g[u].size() == 2));
        }
        sort(len.rbegin(), len.rend());
        if (len.size() >= 2) dp[u] = max(dp[u], len[0] + len[1] + (g[u].size() == 2));
}           

int main() {
        int n;
        scanf("%d", &n);
        for (int i = 0; i < n - 1; i ++) {
                int a, b;
                scanf("%d%d", &a, &b);
                a --, b --;
                g[a].push_back(b);
                g[b].push_back(a);
        }
        int leaf = 0;
        for (int i = 0; i < n; i ++) if (g[i].size() == 1) leaf ++;
        dfs(0, -1);
        printf("%d\n", dp[0] + leaf);
        return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |         sort(len.rbegin(), len.rend());
      |         ^~~~
      |         short
Language: C++

def dfs(z,c)
	r=[0,c]
	G[c].each{|e|
		next if e==z
		t=dfs(c,e)
		r=[r,[t[0]+(G[c].size==2 ? 1 : 0),t[1]]].max
	}
	r
end
N=gets.to_i
G=N.times.map{[]}
(N-1).times{
	a,b=gets.split.map(&:to_i)
	G[a-1]<<b-1
	G[b-1]<<a-1
}
p dfs(-1,dfs(-1,0)[1])[0]+G.count{|e|e.size==1}

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def dfs(z,c)
      | ^~~
a.cc:8:9: error: 'r' does not name a type
    8 |         r
      |         ^
a.cc:12:3: error: expected ')' before '-' token
   12 | (N-1).times{
      | ~ ^
      |   )
a.cc:17:1: error: 'p' does not name a type
   17 | p dfs(-1,dfs(-1,0)[1])[0]+G.count{|e|e.size==1}
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define se second
#define fi first
#define mp make_pair
#define pb push_back
#define all(_v) _v.begin(), _v.end()
const int mod = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
const int N = (int)1e5 + 100;
const int MAXA = (int)3e6;
int n,m,k;
deque<ll> q[310];
ll a[N];
ll dp[N][310];
void update(int pos,int j){
    while(!q[j].empty() && dp[q[j].front()][j] <= dp[pos][j]){
        q[j].pop_front();
    }
    q[j].push_front(pos);
    if(q[j].back() < pos - m)q[j].pop_back();
}
ll get_max(int j){
    if(q[j].empty())return 0LL;
    return dp[q[j].back()][j];
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
     //ifstream cin("input.txt");
     //ofstream cout("output.txt");
    cin >> n >> m >> k;
    for(int i = 1;i <= n;i++)cin >> a[i];
    for(int i = 1;i <= n;i++)dp[i][1] = a[i];
     for(ll j = min(i, k);j >= 1;j--){
            for(int i = 1;i <= n;i++){
            dp[i][j] = get_max(j - 1) + (j * a[i] * 1LL);
            update(i, j);
        }
    }
    ll ans = 0;
    for(int i = 1;i <= n;i++){
        for(int j = 0;j <= min(i, k);j++){
            ans = max(ans, dp[i][j]);
        }
    }
    cout << ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:21: error: 'i' was not declared in this scope
   38 |      for(ll j = min(i, k);j >= 1;j--){
      |                     ^
Language: C++

//左のパネルから順番に当てると考えられるので、以下の問題にできる。
//問題概要：
//N個のうちK個のパネルを選びます。左のパネルから書かれている数を1,2,3,…,K倍し, 和を取ります。
//その値が最大になるようにパネルを選んでください。ただし、2つのパネルの距離は1以上M以下とします。
//
//M = Nのときは、2つのパネルの距離の制約がないと考えてよく、選ぶパネルはスコアが大きいほうからK個にすべきです。
//↑これは嘘です。反例：{1, 1, 30, 5, 5}, K = 3. 
//{1, 1, 30}を選ぶと30が3倍され、{30,5,5}を選ぶと30が1倍される。←このように、何倍するかが変わってしまうので、
//戦略は非自明です。だから全探索ベースでやります。dp[n][k] := 的1～nのうちk個当てたときの、スコアの最大値
//O(NK)
//(100点)

#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#define int long long
using namespace std;
typedef pair<int, int> P;

int INF = 1e-17;
int n, m, k;
int a[100000];
int dp[100001][301];
int wrong_dp[100001][301];

signed main() {
	int i, j;
	
	cin >> n >> m >> k;
	for (i = 0; i < n; i++) cin >> a[i];
	
	for (i = 0; i <= n; i++) for (j = 0; j <= k; j++) dp[i][j] = -INF;
	dp[0][0] = 0;
	
	for (i = 0; i < n; i++) {
		for (j = 0; j <= k; j++) {
			if (j > i) continue;
			dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
			if (j < k) dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + a[i] * (j + 1));
		}
	}
	
	cout << dp[n][k] << endl;
	
	//0点だったコードを書きます
	for (i = 0; i <= n; i++) for (j = 0; j <= k; j++) wrong_dp[i][j] = -INF;
	wrong_dp[0][0] = 0;
	
	for (i = 0; i < n; i++) {
		for (j = 0; j <= k; j++) {
			wrong_dp[i + 1][j] = max(wrong_dp[i + 1][j], wrong_dp[i][j]);
			if (j < k) wrong_dp[i + 1][j + 1] = max(wrong_dp[i + 1][j + 1], wrong_dp[i][j] + a[i] * (j + 1));
		}
	}
	if (wrong_dp[n][k] > dp[n][k]) assert(0);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:40: error: 'assert' was not declared in this scope
   56 |         if (wrong_dp[n][k] > dp[n][k]) assert(0);
      |                                        ^~~~~~
a.cc:17:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   16 | #include <functional>
  +++ |+#include <cassert>
   17 | #define int long long
Language: C++

//左のパネルから順番に当てると考えられるので、以下の問題にできる。
//問題概要：
//N個のうちK個のパネルを選びます。左のパネルから書かれている数を1,2,3,…,K倍し, 和を取ります。
//その値が最大になるようにパネルを選んでください。ただし、2つのパネルの距離は1以上M以下とします。
//
//M = Nのときは、2つのパネルの距離の制約がないと考えてよく、選ぶパネルはスコアが大きいほうからK個にすべきです。
//↑これは嘘です。反例：{1, 1, 30, 5, 5}, K = 3. 
//{1, 1, 30}を選ぶと30が3倍され、{30,5,5}を選ぶと30が1倍される。←このように、何倍するかが変わってしまうので、
//戦略は非自明です。だから全探索ベースでやります。dp[n][k] := 的1～nのうちk個当てたときの、スコアの最大値
//O(NK)
//(100点)

#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#define int long long
using namespace std;
typedef pair<int, int> P;

int INF = 1e-17;
int n, m, k;
int a[100000];
int dp[100001][301];

signed main() {
	int i, j;
	
	cin >> n >> m >> k;
	for (i = 0; i < n; i++) cin >> a[i];
	
	for (i = 0; i <= n; i++) for (j = 0; j <= k; j++) dp[i][j] = -INF;
	dp[0][0] = 0;
	
	for (i = 0; i < n; i++) {
		for (j = 0; j <= k; j++) {
			if (j > i) continue;
			dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
			if (j < k) dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + a[i] * (j + 1));
		}
	}
	cout << dp[n][k] << endl;
	if (dp[n][k] >= INF) assert(0);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:30: error: 'assert' was not declared in this scope
   43 |         if (dp[n][k] >= INF) assert(0);
      |                              ^~~~~~
a.cc:17:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   16 | #include <functional>
  +++ |+#include <cassert>
   17 | #define int long long
Language: C++

#include <algorithm>
int N, M, K, ptr[100009]; long long dp[309][100009];
int main() {
	scanf("%d %d %d", &N, &M, &K);
	for (int i = 0; i < N; i++) scanf("%lld", &dp[0][i]);
	for (int i = 1; i < K; i++) {
		int pl = 0, pr = 0;
		for (int j = 0; j < N; j++) {
			if (j >= i) dp[i][j] = dp[i - 1][ptr[pl]] + 1LL * (i + 1) * dp[0][j];
			if (ptr[pl] == j - M) pl++;
			while (pl < pr && dp[i - 1][ptr[pr - 1]] < dp[i - 1][j]) pr--;
			ptr[pr++] = j;
		}
	}
	printf("%lld\n", *std::max_element(dp[K - 1], dp[K - 1] + N));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d %d %d", &N, &M, &K);
      |         ^~~~~
a.cc:15:9: error: 'printf' was not declared in this scope
   15 |         printf("%lld\n", *std::max_element(dp[K - 1], dp[K - 1] + N));
      |         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <algorithm>
  +++ |+#include <cstdio>
    2 | int N, M, K, ptr[100009]; long long dp[309][100009];
Language: C++

#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n,m,k;
vl a;

vl dp;

int main(){
	cin>>n>>m>>k;
	a=dp=vl(n);
	for(int i=0;i<n;i++) cin>>a[i];
	dp=a;
	for( i=1;i<k;i++){
		deque<int> q;
		vl DP(n);
		for(int j=0;j<n;j++){
			if(j>=i) DP[j]=dp[q.front()]+a[j]*(i+1);
			while(!q.empty()&&dp[q.back()]<=dp[j]) q.pop_back();
			q.push_back(j);
			if(!q.empty()&&q.front()==j-m) q.pop_front();
		}
		dp=DP;
	}
	ll res=-1;
	for(int i=0;i<n;i++) res=max(res,dp[i]);
	cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:14: error: 'i' was not declared in this scope; did you mean 'vi'?
   57 |         for( i=1;i<k;i++){
      |              ^
      |              vi
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const ll inf=1e15;
typedef ll SegT;
const ll defvalue=0;
class SegTree{
	private:
		vector<SegT>val;
		ll n;
		SegT combine(SegT a,SegT b){return max(a,b);}
	public:
		SegTree(ll size){
			n=1;
			while(n<size)n<<=1;
			val=vector<SegT>(2*n,defvalue);
		}
		SegTree(const vector<SegT> &in){
			n=1;
			while(n<in.size())n<<=1;
			val=vector<SegT>(2*n,defvalue);
			for(int i=n-1+in.size()-1;i>=0;i--){
				if(n-1<=i)val[i]=in[i-(n-1)];
				else val[i]=combine(val[i*2+1],val[i*2+2]);
			}
		}
		void update(int i,SegT a){
			i+=n-1;
			val[i]=a;
			while(i>0){
				i=(i-1)/2;
				val[i]=combine(val[i*2+1],val[i*2+2]);
			}
		}
		SegT query(int a,int b,int k=0,int l=0,int r=-1){//[a,b)
			if(r==-1)r=n;
			if(r<=a||b<=l)return defvalue;
			if(a<=l&&r<=b)return val[k];
			else return combine(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
		}
		void tmp(){
			rep(i,val.size())cout<<" "<<val[i];cout<<endl;
		}
};
int main(){
	int n,m,q;
	cin>>n>>m>>q;
	if(q>40&&n!=m)return 1;
	vi in(n);
	rep(i,n)cin>>in[i];
	if(n==m){
		vi dp=in;
		rep(i,q){
			ll ma=0;
			rep(j,n-1){
				ma=max(ma,dp[j]);
				dp[j+1]=ma+(i+2)*in[j+1]
			}
			rep(j,i+1)dp[j]=0;
		}
		ll out=0;
		rep(i,n)out=max(out,dp[i]);
		cout<<out<<endl;
		return 0;
	}
	
	SegTree st(in);
	rep(i,q-1){
		for(int j=n-1;j>=0;j--){
			if(j<i+1)st.update(j,0);
			else st.update(j,(i+2)*in[j]+st.query(max(0,j-m),j));
		}
	}
	cout<<st.query(0,n)<<endl;
}









Compiler output:
a.cc: In function 'int main()':
a.cc:88:57: error: expected ';' before '}' token
   88 |                                 dp[j+1]=ma+(i+2)*in[j+1]
      |                                                         ^
      |                                                         ;
   89 |                         }
      |                         ~
Language: C++

#include "bits/stdc++.h"
using namespace std;

//諸機能
#pragma region MACRO 
#define putans(x)  std::cerr << "[ answer ]: " ; cout << (x) << endl
#define dputans(x) std::cerr << "[ answer ]: "; cout << setprecision(40) << (double)(x) << endl
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define RREP(i,n,a) for(int i=(int)(n-1); i>= a; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,n,0)
#define all(a) begin((a)),end((a))
#define mp make_pair
#define exist(container, n) ((container).find((n)) != (container).end())
#define equals(a,b) (fabs((a)-(b)) < EPS)
#ifdef _DEBUG //ファイルからテストデータを読み込む
std::ifstream ifs("data.txt");
#define put ifs >>
#else //ジャッジシステムでいい感じにやる
#define put cin >>
#endif
#pragma endregion
//デバッグなどの支援
#pragma region CODING_SUPPORT
#ifdef _DEBUG
#define dbg(var0) { std::cerr << ( #var0 ) << "=" << ( var0 ) << endl; }
#define dbg2(var0, var1) { std::cerr << ( #var0 ) << "=" << ( var0 ) << ", "; dbg(var1); }
#define dbg3(var0, var1, var2) { std::cerr << ( #var0 ) << "=" << ( var0 ) << ", "; dbg2(var1, var2); }
#define dbgArray(a,n) {std::cerr << (#a) << "=";  rep(i,n){std::cerr <<(a[i])<<",";} cerr<<endl;} 
#else
#define dbg(var0) {}
#define dbg2(var0, var1) {}
#define dbg3(var0, var1, var2) {}
#define dbgArray(a,n) {}
#endif 
#pragma endregion 
//typedef（書き換える、書き足す可能性ある）
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii; typedef pair<string, string> pss; typedef pair<int, string>pis;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
#pragma endregion
//諸々の定数(書き換える可能性ある)
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-10)
#define MOD (ll)(1e9 + 7)
#define INF (ll)(2*1e9)
#pragma endregion

int m, n, k;
evtor<ll> a;

ll dp[100000 + 1][31];
bool filled[100000 + 1][31];


int dfs(int top, int k) {
	dbg2(top, k);
	if (filled[top][k])return dp[top][k];
	
	int ret = 0;
	if (k == 1) {
		rep(i, top) {
			ret = max(ret, a[i]);
		}
		filled[top][k] = true;
		return dp[top][k] = ret;
	}
	REP(i, max(k-1, top - m), top) {
		ret = max(ret, k*a[i] + dfs(i, k - 1));
		if (top == 10 && k == 5) {
			dbg(k*a[i]);
		}
	}

	filled[top][k] = true;
	return dp[top][k] = ret;
}


int main() {
	put n >> m >> k;
	fill(*dp, *dp + 100001 * 30, 0);
	fill(*filled, *filled + 100001 * 30, 0);
	rep(i, n) {
		int ttt; put ttt;
		a.push_back(ttt);
	}
	if (n <= 300 && k <= 30) {
		cout << dfs(n, k) << endl;
	}
	else {
		cout << "うんちうんち" << endl;
	}

END:
	return 0;
}



Compiler output:
a.cc:53:1: error: 'evtor' does not name a type
   53 | evtor<ll> a;
      | ^~~~~
a.cc: In function 'int dfs(int, int)':
a.cc:66:40: error: 'a' was not declared in this scope
   66 |                         ret = max(ret, a[i]);
      |                                        ^
a.cc:72:34: error: 'a' was not declared in this scope
   72 |                 ret = max(ret, k*a[i] + dfs(i, k - 1));
      |                                  ^
a.cc: In function 'int main()':
a.cc:89:17: error: 'a' was not declared in this scope
   89 |                 a.push_back(ttt);
      |                 ^
Language: C

#include<stdio.h>
long long MAX(long long a,long long b){return a<b?b:a;}
long long d[310][100010]={};
int main(){
  long long n,m,k,a[100010],i,j;
  scanf("%lld %lld %lld",&n,&m,&k);
  for(i=0;i<n;i++)scanf("%lld",&a[i]);
  for(i=0;i<k;i++){
    for(j=i;j<n;j++)d[i+1][j+1]=MAX(d[i+1][j],d[i][j]+(i+1)*a[j]);
  }
  //for(i=0;i<=k;i++){
    for(j=0;j<=n;j++)printf("%lld ",d[i][j]);printf("\n");
}//*/
  printf("%lld\n",d[k][n]);
  return 0;
}


Compiler output:
main.c:14:10: error: expected declaration specifiers or '...' before string constant
   14 |   printf("%lld\n",d[k][n]);
      |          ^~~~~~~~
main.c:14:19: error: expected declaration specifiers or '...' before 'd'
   14 |   printf("%lld\n",d[k][n]);
      |                   ^
main.c:15:3: error: expected identifier or '(' before 'return'
   15 |   return 0;
      |   ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600

long dp[2][301];
long dp2[2][301];

int main(){
  int n,m,k;
  cin>>n>>m>>k;
  vector<long> vec(n);
  rep(i,n) scanf("%ld", &(vec[i]));

  long * prev = dp[0];
  long * crnt = dp[1];
//  long * prei = dp2[0];
//  long * crni = dp2[1];

  rep(i,n){
    fill(crnt, crnt+301, 0);
    fill(crni, crni+301, INF);
    crnt[1] = max(prev[1], vec[i]);
    repl(j,1,min(i+1,k+1)){
      // vec[i]までみてk個つかう
      crnt[j] = max(prev[j], prev[j-1]+j*vec[i]);
    }
//    rep(i,k+1) cout<<crnt[i]<<" "; cout<<endl;
    swap(crnt, prev);
  }

  cout << prev[k] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:10: error: 'crni' was not declared in this scope; did you mean 'crnt'?
   44 |     fill(crni, crni+301, INF);
      |          ^~~~
      |          crnt
Language: C++

#include <iostream>
#include <queue>
using namespace std;

const int N = (int) 1e5;
long long f[N], g[N + 1];
int a[N];

int main() {
    ios::sync_with_stdio(false);
    int n, m, k; cin >> n >> m >> k;
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int t = k; t >= 1; --t) {
        for (int i = 0; i < n; ++i) g[i] = f[i];
        deque<int> q;
        q.push_back(n);
        if (t != k) g[n] = -1e18;
        for (int i = n - 1; i >= 0; --i) {
            while (!q.empty() && q.front() - i > m) q.pop_front();
            f[i] = g[q.front()] + 1LL * t * a[i];
            while (!q.empty() && g[i] >= g[q.back()]) q.pop_back();
            q.push_back(i);
        }
    }
    cout << *max_element(f, f + n) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'max_element' was not declared in this scope
   25 |     cout << *max_element(f, f + n) << endl;
      |              ^~~~~~~~~~~
Language: C

#include<stdio.h>
long long MAX(long long a,long long b){return a<b?b:a;}
long long d[310][100010]={};
int main(){
  long long n,m,k,a[100010],i,j;
  scanf("%lld %lld %lld",&n,&m,&k);
  for(i=0;i<n;i++)scanf("%lld",&a[i]);
  for(i=0;i<k;i++){
    for(j=0;j<n;j++){
      d[i+1][j+1]=MAX(d[i+1][j+1],d[i+1][j]);
      d[i+1][j+1]=MAX(d[i+1][j+1],d[i][j]+(i+1)*a[j]);//,d[i+1][j]+(i+1)*(a[j+1]-a[j]));
    }
  }
  //for(i=0;i<=k;i++){
    for(j=0;j<=n;j++)printf("%2lld ",d[i][j]);printf("\n");
}//*/
  printf("%lld\n",d[k][n]);
  return 0;
}


Compiler output:
main.c:17:10: error: expected declaration specifiers or '...' before string constant
   17 |   printf("%lld\n",d[k][n]);
      |          ^~~~~~~~
main.c:17:19: error: expected declaration specifiers or '...' before 'd'
   17 |   printf("%lld\n",d[k][n]);
      |                   ^
main.c:18:3: error: expected identifier or '(' before 'return'
   18 |   return 0;
      |   ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstdlib>
#include <ctime>
#include <deque>
using namespace std;

int n, m, k;
int a[1100000];
long long dp[1100000][310];
int q[1100000], h[1100000], xx[1100000][310];

int main() {
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i <= k; i++)
		dp[0][i] = -1e18;
	for (int i = 0; i <= k; i++)
		q[i] = h[i] = 1, xx[i][1] = i;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= k; j++) {
			while (q[j] <= h[j] && xx[j][q[j]] < i - m)
				q[j] += 1;
			dp[i][j + 1] = dp[xx[j][q[j]]][j] + 1LL * (j + 1) * a[i];
		}
		for (int j = 0; j <= k; j++) {
			while (q[j] <= h[j] && dp[xx[j][h[j]]][j] <= dp[i][j])
				h[j] -= 1;
			xx[j][++h[j]] = i;
				// q[j] += 1;
		}
	}
	long long ans = -1e18;
	for (int i = 1; i <= n; i++)
		ans = max(ans, dp[i][k]);
	cout << ans << endl;
}

Compiler output:
/tmp/ccapwz16.o: in function `main':
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0xee): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x106): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x11c): relocation truncated to fit: R_X86_64_PC32 against symbol `xx' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x15d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x177): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x18e): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x1a5): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x1c0): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x1e4): relocation truncated to fit: R_X86_64_PC32 against symbol `xx' defined in .bss section in /tmp/ccapwz16.o
a.cc:(.text+0x20e): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>

int main(){
    int n;
    std::cin >> n;
    std::vector<int> a;
    std::vector<int> na(n - i - 1);
    a.resize(n);
    for(int i = 0; i < n; ++i){
        std::cin >> a[i];
    }
    std::string str;
    std::cin >> str;
    for(int i = 0; i < n - 1; ++i){
        if(str[i] == 'M'){
            for(int j = 0; j < n - i - 1; ++j){
                na[j] = (std::max)(a[j], a[j + 1]);
            }
        }else if(str[i] == 'm'){
            for(int j = 0; j < n - i - 1; ++j){
                na[j] = (std::min)(a[j], a[j + 1]);
            }
        }
        for(int j = 0; j < n - i - 1; ++j){
            a[j] = na[j];
        }
        a = na;
    }
    std::cout << a[0] << std::endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: 'i' was not declared in this scope
   11 |     std::vector<int> na(n - i - 1);
      |                             ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 1000000
#define INF_MAX 1000000000
#define debug(x) cout<<#x<<": "<<x<<endl
#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;
const int MAX_N=200006;
int n,dat[2*MAX_N-1];
void init(int n_)
{
	n=1;
	while(n<n_)n*=2;
	rep(i,2*n-1)dat[i]=INT_MAX;
}
void update(int k,int a)
{
	int kk=k+n-1;
	dat[kk]=a;
	while(kk)
	{
		kk=(kk-1)/2;
		dat[kk]=min(dat[kk*2+1],dat[kk*2+2]);
	}
}
int query(int a,int b,int k,int l,int r)
{
	if(r<=a||b<=l)return INT_MAX;
	if(a<=l&&r<=b)return dat[k];
	else
	{
		int vl=query(a,b,k*2+1,l,(l+r)/2);
		int vr=query(a,b,k*2+2,(l+r)/2,r);
		return min(vl,vr);
	}
}
int hai[200000];
int input;
int N;
int main()
{
	cin>>N;
	init(N);
	rep(i,N)
	{
		cin>>input;
		update(i,-1*input);
	}
	//rep(i,2*N)cout<<dat[i]<<endl;
	int p;
	string s;
	cin>>s;
	int ss=s.size();
	rep(i,ss-1)
	{
		if(s[i]=='M'&&s[i+1]=='m')
		{
			p=i+1;
			p++;
			break;
		}
	}
	rep(i,N-p+1)
	{
		hai[i]=query(i,i+p,0,0,n);
		//cout<<hai[i]<<endl;
	}
	init(N-p+1);
	rep(i,N-p+1)
	{
		update(i,hai[i]*(-1));
	}
	cout<<query(0,N-p+1,0,0,n)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:26:28: error: 'INT_MAX' was not declared in this scope
   26 |         rep(i,2*n-1)dat[i]=INT_MAX;
      |                            ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include<cstring>
  +++ |+#include <climits>
   11 | using namespace std;
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:40:30: error: 'INT_MAX' was not declared in this scope
   40 |         if(r<=a||b<=l)return INT_MAX;
      |                              ^~~~~~~
a.cc:40:30: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 1000000
#define debug(x) cout<<#x<<": "<<x<<endl
#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;
const int MAX_N=200006;
int n,dat[2*MAX_N-1];
void init(int n_)
{
	n=1;
	while(n<n_)n*=2;
	rep(i,2*n-1)dat[i]=INT_MAX;
}
void update(int k,int a)
{
	int kk=k+n-1;
	dat[kk]=a;
	while(kk)
	{
		kk=(kk-1)/2;
		dat[kk]=min(dat[kk*2+1],dat[kk*2+2]);
	}
}
int query(int a,int b,int k,int l,int r)
{
	if(r<=a||b<=l)return INT_MAX;
	if(a<=l&&r<=b)return dat[k];
	else
	{
		int vl=query(a,b,k*2+1,l,(l+r)/2);
		int vr=query(a,b,k*2+2,(l+r)/2,r);
		return min(vl,vr);
	}
}
int hai[200000];
int input;
int N;
int main()
{
	cin>>N;
	init(N);
	rep(i,N)
	{
		cin>>input;
		update(i,-1*input);
	}
	//rep(i,2*N)cout<<dat[i]<<endl;
	int p;
	string s;
	cin>>s;
	int ss=s.size();
	rep(i,ss-1)
	{
		if(s[i]=='M'&&s[i+1]=='m')
		{
			p=i+1;
			p++;
			break;
		}
	}
	rep(i,N-p+1)
	{
		hai[i]=query(i,i+p,0,0,n);
		//cout<<hai[i]<<endl;
	}
	init(N-p+1);
	rep(i,N-p+1)
	{
		update(i,hai[i]*(-1));
	}
	cout<<query(0,N-p+1,0,0,n)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:25:28: error: 'INT_MAX' was not declared in this scope
   25 |         rep(i,2*n-1)dat[i]=INT_MAX;
      |                            ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include<cstring>
  +++ |+#include <climits>
   11 | using namespace std;
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:39:30: error: 'INT_MAX' was not declared in this scope
   39 |         if(r<=a||b<=l)return INT_MAX;
      |                              ^~~~~~~
a.cc:39:30: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstdlib>
#include <ctime>
#include <deque>
using namespace std;

int n, a[110000];
char S[110000];
bitset<110000> B;

bool ok(int x) {
	for (int i = 0; i < 110000; i++)
		B.set(i, 0);
	for (int i = 1; i <= n; i++)
		if (a[i] < x)
			B.set(i, 0);
		else
			B.set(i, 1);
	int m = strlen(S);
	// cout << B.to_string() << ' ' <<(B >> 1).to_string() << endl;
	for (int i = 0; i < m; i++) {
		if (S[i] == 'M')
			B |= (B >> 1);
		else
			B &= (B >> 1);
		B.set(n - i, 0);
		if (B.count() == 0)
			return false;
		// cout << B << endl;
	}
		// printf("%d\n", x);
	// cout << B.to_string() << endl;
	// cout << B[1] << endl;
	return B[1] == 1;
}

int main() {
	scanf("%d", &n);
	
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	scanf("%s", S);
	int q = 1, h = n + 1;
	while (q < h - 1) {
		int mid = (q + h) / 2;
		if (ok(mid))
			q = mid;
		else
			h = mid;
	}
	printf("%d\n", q);
}


Compiler output:
a.cc:17:1: error: 'bitset' does not name a type
   17 | bitset<110000> B;
      | ^~~~~~
a.cc: In function 'bool ok(int)':
a.cc:21:17: error: 'B' was not declared in this scope
   21 |                 B.set(i, 0);
      |                 ^
a.cc:24:25: error: 'B' was not declared in this scope
   24 |                         B.set(i, 0);
      |                         ^
a.cc:26:25: error: 'B' was not declared in this scope
   26 |                         B.set(i, 1);
      |                         ^
a.cc:31:25: error: 'B' was not declared in this scope
   31 |                         B |= (B >> 1);
      |                         ^
a.cc:33:25: error: 'B' was not declared in this scope
   33 |                         B &= (B >> 1);
      |                         ^
a.cc:34:17: error: 'B' was not declared in this scope
   34 |                 B.set(n - i, 0);
      |                 ^
a.cc:42:16: error: 'B' was not declared in this scope
   42 |         return B[1] == 1;
      |                ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstdlib>
#include <ctime>
#include <deque>
using namespace std;

int n, a[110000];
char S[110000];
bitset<110000> B;

bool ok(int x) {
	for (int i = 0; i < 110000; i++)
		B.set(i, 0);
	for (int i = 1; i <= n; i++)
		if (a[i] < x)
			B.set(i, 0);
		else
			B.set(i, 1);
	int m = strlen(S);
	// cout << B.to_string() << ' ' <<(B >> 1).to_string() << endl;
	for (int i = 0; i < m; i++) {
		if (S[i] == 'M')
			B |= (B >> 1);
		else
			B &= (B >> 1);
		// cout << B << endl;
	}
		// printf("%d\n", x);
	// cout << B.to_string() << endl;
	// cout << B[1] << endl;
	return B[1] == 1;
}

int main() {
	scanf("%d", &n);
	
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	scanf("%s", S);
	int q = 1, h = n + 1;
	while (q < h - 1) {
		int mid = (q + h) / 2;
		if (ok(mid))
			q = mid;
		else
			h = mid;
	}
	printf("%d\n", q);
}


Compiler output:
a.cc:17:1: error: 'bitset' does not name a type
   17 | bitset<110000> B;
      | ^~~~~~
a.cc: In function 'bool ok(int)':
a.cc:21:17: error: 'B' was not declared in this scope
   21 |                 B.set(i, 0);
      |                 ^
a.cc:24:25: error: 'B' was not declared in this scope
   24 |                         B.set(i, 0);
      |                         ^
a.cc:26:25: error: 'B' was not declared in this scope
   26 |                         B.set(i, 1);
      |                         ^
a.cc:31:25: error: 'B' was not declared in this scope
   31 |                         B |= (B >> 1);
      |                         ^
a.cc:33:25: error: 'B' was not declared in this scope
   33 |                         B &= (B >> 1);
      |                         ^
a.cc:39:16: error: 'B' was not declared in this scope
   39 |         return B[1] == 1;
      |                ^
Language: C++

//sperse table
const int SPT_MAX = 123456;
const int SPT_lg = 20;

template <class T> class SPT{
	T x[SPT_MAX + 1][SPT_lg];
	int lg[SPT_MAX + 1];
	
	T eval(T a , T b){
		return //＊評価;
	}
	
public:
	
	SPT(){
		
	}
	
	SPT(int n , T a[]){
		lg[1] = 0;
		for(int i = 2 ; i <= SPT_MAX ; ++i) lg[i] = lg[i / 2] + 1;
		for(int i = 0 ; i < n ; ++i) x[i][0] = a[i];
		for(int j = 0 ; j < SPT_lg - 1 ; ++j){
			for(int i = 0 ; i < n - (1 << j) ; ++i){
				x[i][j + 1] = eval(x[i][j] , x[i + (1 << j)][j]);
			}
		}
	}
	
	T get(int s , int f){	//区間[s,f-1]
		int z = f - s;
		return eval(x[s][lg[z]] , x[f - (1 << lg[z])][lg[z]]);
	}
}


Compiler output:
a.cc:34:2: error: expected ';' after class definition
   34 | }
      |  ^
      |  ;
a.cc: In member function 'T SPT<T>::eval(T, T)':
a.cc:11:9: error: expected primary-expression before '}' token
   11 |         }
      |         ^
a.cc:11:9: error: expected ';' before '}' token
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
    
    ll x;
    cin>>x;
    double p;
    cin>>p;
    if(p==100){
      x++
        cout << x/2 << endl;
        return 0;
    }
    p/=100.0;
    if(x%2==0){
        cout << x/2.0/p << "\n";
    }
    else{
        x++;
        cout << x/2.0/p + 1 << "\n";
    } 

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: expected ';' before 'cout'
   17 |       x++
      |          ^
      |          ;
   18 |         cout << x/2 << endl;
      |         ~~~~
Language: C++

#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d%d", &x, &p);
  printf("%.12f", (double)((x + 1) / 2) * 100.0 / (double)p);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'x' was not declared in this scope
    5 |   scanf("%d%d", &x, &p);
      |                  ^
a.cc:5:22: error: 'p' was not declared in this scope
    5 |   scanf("%d%d", &x, &p);
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	long long x; 
    double p;
    cin>>x>>p;
  if(x%2){cout<<setprecision(20)<<((double)x+1)/2/p*100)<<endl;}
  else{ cout<<setprecision(20)<<((double)x)/2/p*100)<<endl;}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:56: error: expected ';' before ')' token
    7 |   if(x%2){cout<<setprecision(20)<<((double)x+1)/2/p*100)<<endl;}
      |                                                        ^
      |                                                        ;
a.cc:8:52: error: expected ';' before ')' token
    8 |   else{ cout<<setprecision(20)<<((double)x)/2/p*100)<<endl;}
      |                                                    ^
      |                                                    ;
Language: C++

#include <iostream>
#include <iomanip>
using namespace std;
double p
int x;

int main(){
  cin >> x >> p;
  if(x%2==1) x++;
  cout << setprecision(8) << x/(2*p) << endl;
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int x;
      | ^~~
a.cc: In function 'int main()':
a.cc:8:10: error: 'x' was not declared in this scope
    8 |   cin >> x >> p;
      |          ^
a.cc:8:15: error: 'p' was not declared in this scope
    8 |   cin >> x >> p;
      |               ^
Language: C++

#include <iostream>
using namespace std;
double p,x;

int main(){
  cin >> x >> p;
  if(x%2==1) x++;
  cout << setprecision(8) << x/(2*p) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    7 |   if(x%2==1) x++;
      |      ~^~
      |      | |
      |      | int
      |      double
a.cc:8:11: error: 'setprecision' was not declared in this scope
    8 |   cout << setprecision(8) << x/(2*p) << endl;
      |           ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>
 
#define mp       make_pair
#define mt	  make_tuple
#define rep(i,n) for(int i=0;i<(n);i++)
 
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using double = long double; 
const int INF=1<<29;
const double EPS=1e-9;
const ll MOD = 1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
ll X,P;
const int MAX_TURN = 2000;
const int MAX_POS = 100;
double dp[MAX_TURN][MAX_POS][MAX_POS];
bool visited[MAX_TURN][MAX_POS][MAX_POS];
//map<tuple<int, int, int>, double> dp;
double memo(int turn, int pos_ao, int pos_cho){
  if (pos_ao == pos_cho){
    return turn;
  }
  if (turn >= MAX_TURN or pos_ao < 0 or pos_ao >= MAX_POS or pos_cho < 0 or pos_cho >= MAX_POS){
    return INF;
  }
  double pro = (double) P / 100;
  if (visited[turn][pos_ao][pos_cho]){
    return dp[turn][pos_ao][pos_cho];
  }
  visited[turn][pos_ao][pos_cho] = true;
  //cout << turn << " " << pos_ao << " " << pos_cho << endl;
  double result = INF;
  //pre
  result = min(result, memo(turn + 1, pos_ao - 1, pos_cho - 1) * pro + memo(turn + 1, pos_ao - 1, pos_cho + 1) * (1 - pro));
  //stop
  result = min(result, memo(turn + 1, pos_ao, pos_cho - 1) * pro + memo(turn + 1, pos_ao, pos_cho + 1) * (1 - pro));
  //next
  result = min(result, memo(turn + 1, pos_ao + 1, pos_cho - 1) * pro + memo(turn + 1, pos_ao + 1, pos_cho + 1) * (1 - pro));
  return dp[turn][pos_ao][pos_cho] = result;
}
int main(){
  cin >> X >> P;
  if (X > 10)return 0;
  int geta = MAX_POS / 2;
  double result = memo(0, geta, X + geta);
  printf("%.20lf\n", result);
  return 0;
}

Compiler output:
a.cc:12:7: error: expected nested-name-specifier before 'double'
   12 | using double = long double;
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
 
#define mp       make_pair
#define mt	  make_tuple
#define rep(i,n) for(int i=0;i<(n);i++)
 
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using double = long double; 
const int INF=1<<29;
const double EPS=1e-9;
const ll MOD = 1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
ll X,P;
const int MAX_TURN = 2000;
const int MAX_POS = 100;
double dp[MAX_TURN][MAX_POS][MAX_POS];
bool visited[MAX_TURN][MAX_POS][MAX_POS];
//map<tuple<int, int, int>, double> dp;
double memo(int turn, int pos_ao, int pos_cho){
  if (pos_ao == pos_cho){
    return turn;
  }
  if (turn >= MAX_TURN or pos_ao < 0 or pos_ao >= MAX_POS or pos_cho < 0 or pos_cho >= MAX_POS){
    return INF;
  }
  double pro = (double) P / 100;
  if (visited[turn][pos_ao][pos_cho]){
    return dp[turn][pos_ao][pos_cho];
  }
  visited[turn][pos_ao][pos_cho] = true;
  //cout << turn << " " << pos_ao << " " << pos_cho << endl;
  double result = INF;
  //pre
  result = min(result, memo(turn + 1, pos_ao - 1, pos_cho - 1) * pro + memo(turn + 1, pos_ao - 1, pos_cho + 1) * (1 - pro));
  //stop
  result = min(result, memo(turn + 1, pos_ao, pos_cho - 1) * pro + memo(turn + 1, pos_ao, pos_cho + 1) * (1 - pro));
  //next
  result = min(result, memo(turn + 1, pos_ao + 1, pos_cho - 1) * pro + memo(turn + 1, pos_ao + 1, pos_cho + 1) * (1 - pro));
  return dp[turn][pos_ao][pos_cho] = result;
}
int main(){
  cin >> X >> P;
  if (X > 10)return 0;
  int geta = MAX_POS / 2;
  double result = memo(0, geta, X + geta);
  printf("%.20lf\n", result);
  return 0;


Compiler output:
a.cc:12:7: error: expected nested-name-specifier before 'double'
   12 | using double = long double;
      |       ^~~~~~
a.cc: In function 'int main()':
a.cc:52:12: error: expected '}' at end of input
   52 |   return 0;
      |            ^
a.cc:46:11: note: to match this '{'
   46 | int main(){
      |           ^
Language: C++

sx = input()
sp = input()
x = int(sx)
p = int(sp)
ret = 0
e = 0
cnt = x % 2
if p == 100:
    ret = int(x / 2) + cnt
        
print(ret)

Compiler output:
a.cc:1:1: error: 'sx' does not name a type
    1 | sx = input()
      | ^~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;

int trial(vector<VI> &a) {
  int tot = 0;
  REP(i, 0, n - 1) {
    if (tot >= 40000) {
      return -1;
    }
    while (not (a[i] < a[i + 1])) {
      // cast
      REP(j, 0, m - 1) {
	a[i + 1][j + 1] += a[i + 1][j];
      }
      tot++;
    }
  }
}

int main(void){
  int n, m;
  cin >> n >> m;
  vector<VI> a(n);
  REP(i, 0, n) {
    a[i] = VI(m);
    REP(j, 0, m) {
      cin >> a[i][j];
    }
  }
  REP(i, 0, n - 1) {
    if (a[i][0] > a[i + 1][0]) {
      cout << -1 << endl;
      return 0;
    }
  }
  int tot = trial(a);
  cout << tot << endl;
}


Compiler output:
a.cc: In function 'int trial(std::vector<std::vector<int> >&)':
a.cc:36:13: error: 'n' was not declared in this scope
   36 |   REP(i, 0, n - 1) {
      |             ^
a.cc:25:47: note: in definition of macro 'REP'
   25 | #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
      |                                               ^
a.cc:42:17: error: 'm' was not declared in this scope
   42 |       REP(j, 0, m - 1) {
      |                 ^
a.cc:25:47: note: in definition of macro 'REP'
   25 | #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
      |                                               ^
a.cc:48:1: warning: control reaches end of non-void function [-Wreturn-type]
   48 | }
      | ^
Language: C++

#include <vector>
#include <iostream>
using namespace std;

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

void solve(){
    int n,m;
    cin >> n >> m;
    vector<vector<int128_t>> a(n,vector<int128_t>(m));
    rep(i,0,n) rep(j,0,m) cin >> a[i][j];

    rep(i,1,n){
        if(a[i][0]<a[i-1][0]){
            cout << -1 << endl;
            return;
        }
    }

    auto magic=[&](int i){
        rep(j,1,m){
            a[i][j]+=a[i][j-1];
        }
    };

    int ans=0;
    rep(i,1,n){
        while(a[i]<=a[i-1]){
            magic(i);
            ++ans;
        }
    }
    cout << ans << endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:19: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
   31 |     vector<vector<int128_t>> a(n,vector<int128_t>(m));
      |                   ^~~~~~~~
      |                   int8_t
a.cc:31:19: error: template argument 1 is invalid
a.cc:31:19: error: template argument 2 is invalid
a.cc:31:27: error: template argument 1 is invalid
   31 |     vector<vector<int128_t>> a(n,vector<int128_t>(m));
      |                           ^~
a.cc:31:27: error: template argument 2 is invalid
a.cc:31:49: error: template argument 2 is invalid
   31 |     vector<vector<int128_t>> a(n,vector<int128_t>(m));
      |                                                 ^
a.cc:31:53: error: expression list treated as compound expression in initializer [-fpermissive]
   31 |     vector<vector<int128_t>> a(n,vector<int128_t>(m));
      |                                                     ^
a.cc:32:35: error: invalid types 'int[int]' for array subscript
   32 |     rep(i,0,n) rep(j,0,m) cin >> a[i][j];
      |                                   ^
a.cc:35:13: error: invalid types 'int[int]' for array subscript
   35 |         if(a[i][0]<a[i-1][0]){
      |             ^
a.cc:35:21: error: invalid types 'int[int]' for array subscript
   35 |         if(a[i][0]<a[i-1][0]){
      |                     ^
a.cc: In lambda function:
a.cc:43:14: error: invalid types 'int[int]' for array subscript
   43 |             a[i][j]+=a[i][j-1];
      |              ^
a.cc:43:23: error: invalid types 'int[int]' for array subscript
   43 |             a[i][j]+=a[i][j-1];
      |                       ^
a.cc: In function 'void solve()':
a.cc:49:16: error: invalid types 'int[int]' for array subscript
   49 |         while(a[i]<=a[i-1]){
      |                ^
a.cc:49:22: error: invalid types 'int[int]' for array subscript
   49 |         while(a[i]<=a[i-1]){
      |                      ^