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

#include<iostream>
#include<cstdio>
#define F first
#define S second
#define LIM 1000000010
#define pb push_back
#define all(n) n.begin(),n.end()
using namespace std;
typedef pair<int,int> P;
int dp[5002][5002];
int main(){
  int n,m;
 
  vector<int> X,Y;
  
  while(cin >> n >> m){
    for(int i=0;i<5000;i++)for(int j=0;j<5000;j++)dp[j][i] = 0;
    for(int i=0;i<n;i++){
      int x,y;
      cin >> x >> y;
      X.pb(x); Y.pb(y);
    }
    vector<int> x,y;
    x = X;
    y = Y;
    X.pb(-LIM); X.pb(LIM); Y.pb(-LIM); Y.pb(LIM);
    sort(all(X)); sort(all(Y));
    X.erase(unique(all(X)),X.end());
    Y.erase(unique(all(Y)),Y.end());
    for(int i=0;i<n;i++){
      x[i] = find(all(X),x[i])-X.begin();
      y[i] = find(all(Y),y[i])-Y.begin();
      dp[y[i]][x[i]]++;
    }
    for(int i=0;i<=n;i++){
      for(int j=0;j<=n;j++){
	dp[i+1][j+1] += dp[i+1][j]+dp[i][j+1]-dp[i][j];

      }

    }
    for(int i=0;i<m;i++){
      int sx,sy,gx,gy;
      cin >> sx >> sy >> gx >> gy;
      sx = lower_bound(all(X),sx)-X.begin();
      sy = lower_bound(all(Y),sy)-Y.begin();
      gx = upper_bound(all(X),gx)-X.begin()-1;
      gy = upper_bound(all(Y),gy)-Y.begin()-1;
      cout << dp[gy][gx]-dp[gy][sx-1]-dp[sy-1][gx]+dp[sy-1][sx-1] << endl;

    }



  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'vector' was not declared in this scope
   14 |   vector<int> X,Y;
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<cstdio>
  +++ |+#include <vector>
    3 | #define F first
a.cc:14:10: error: expected primary-expression before 'int'
   14 |   vector<int> X,Y;
      |          ^~~
a.cc:21:7: error: 'X' was not declared in this scope
   21 |       X.pb(x); Y.pb(y);
      |       ^
a.cc:21:16: error: 'Y' was not declared in this scope
   21 |       X.pb(x); Y.pb(y);
      |                ^
a.cc:23:12: error: expected primary-expression before 'int'
   23 |     vector<int> x,y;
      |            ^~~
a.cc:24:5: error: 'x' was not declared in this scope
   24 |     x = X;
      |     ^
a.cc:24:9: error: 'X' was not declared in this scope
   24 |     x = X;
      |         ^
a.cc:25:5: error: 'y' was not declared in this scope
   25 |     y = Y;
      |     ^
a.cc:25:9: error: 'Y' was not declared in this scope
   25 |     y = Y;
      |         ^
a.cc:27:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |     sort(all(X)); sort(all(Y));
      |     ^~~~
      |     short
a.cc:28:13: error: 'unique' was not declared in this scope
   28 |     X.erase(unique(all(X)),X.end());
      |             ^~~~~~
a.cc:47:12: error: 'upper_bound' was not declared in this scope
   47 |       gx = upper_bound(all(X),gx)-X.begin()-1;
      |            ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
typedef pair<int, int> P;

int main(){
  int N, M;
  while(cin>>N>>M && N){
    vector<P> p(N);
    REP(i, N){
      cin>>p[i].first>>p[i].second;
    }
    sort(p.begin(), p.end());
    REP(i, M){
      int x1, y1, x2, y2;
      scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
      vector<P>::iterator it = lower_bound(p.begin(), p.end(), P(x1, INT_MIN));
      vector<P>::iterator end = lower_bound(p.begin(), p.end(), P(x2 + 1, INT_MIN));
      int cnt = 0;
      while(it != end){
        if(it->second >= y1 && it->second <= y2) cnt++;
        it++;
      }
      printf("%d\n", cnt);
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:70: error: 'INT_MIN' was not declared in this scope
   44 |       vector<P>::iterator it = lower_bound(p.begin(), p.end(), P(x1, INT_MIN));
      |                                                                      ^~~~~~~
a.cc:15:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <cassert>
  +++ |+#include <climits>
   15 |
Language: C++

#include<stdio.h>
int main(){
  return "意味がわからん";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    3 |   return "意味がわからん";
      |          ^~~~~~~~~~~~~~~~
      |          |
      |          const char*
Language: C++

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

string s;
int n;
char c[7] = {'0','1','+','-','*','(',')'};
const int up = 1<<10;

int parse(int l,int r,int p){
  if(r<=l)return -1;
  int k=0,a,b;
  for(int i=r-1;i>=l;i--){
    if(s[i]=='(')k++;
    else if(s[i] == ')')k--;
    if(k>0)return -1;
    if(!k){
      if(s[i] == '+'){
	a = parse(l,i,0); b = parse(i+1,r,0);
	if(a<0 || b<0 || up<=a || up<=b || a+b<0 || up<=a+b)return -1;
	return a+b;
      }else if(s[i] == '-'){
	a = parse(l,i,0); b = parse(i+1,r,0);
	if(a<0 || b<0 || up<=a || up<=b || a-b<0 || up<=a-b)return -1;
	return a-b;
      }
    }
  }
  if(k)return -1;

  for(int i=r-1;i>=l;i--){
    if(s[i]=='(')k++;
    else if(s[i] == ')')k--;
    if(!k && s[i] == '*'){
      a = parse(l,i,0); b = parse(i+1,r,0);
      if(a<0 || b<0 || up<=a || up<=b || a*b<0 || up<=a*b)return -1;
      return a*b;Darsein
    }
  }

  if(p)return -1;
  if(s[l] == '(' && s[r-1] == ')')return parse(l+1,r-1,1);

  int res = 0;
  for(int i=r-1;i>=l;i--){
    if(s[i] == '1'){
      if(r-1-i>=10)return -1;
      else res += 1 << (r-1-i);
    }
  }
  return res;
}

int rec(int pos){
  int i,res = -1;
  for(i=pos;i<n;i++){
    if(s[i] == '.'){
      for(int j=0;j<7;j++){
	s[i] = c[j];
	res = max(res,rec(i+1));
      }
      s[i] = '.'; break;
    }
  }
  
  if(i==n)return parse(0,n,0);
  else return res;
}

int main(){
  cin >> s; n = s.size();
  cout << rec(0) << endl;
}

Compiler output:
a.cc: In function 'int parse(int, int, int)':
a.cc:37:18: error: 'Darsein' was not declared in this scope; did you mean 'parse'?
   37 |       return a*b;Darsein
      |                  ^~~~~~~
      |                  parse
Language: C++

#include<iostream>
#include<vector>

using namespace std;

string in;
vector<int> V;
string wild = "01+-*()";
int ans = -1;

bool isnum(string s){
  for(int i = 0; i < s.length(); i++)
    if(s[i] != '0' && s[i] != '1') return false;

  return true;
}

bool ispara(string s){
  int p = 1;
  if(s[0] != '(') return false;

  for(int i = 1; i < s.length()-1; i++){
    if(s[i] == '(') p++;
    if(s[i] == ')') p--;
    if(p == 0) return false;
  }
  return true;
}
bool isope(string s){

  int p = 0;
  for(int i = 0; i < s.length(); i++){
    if(s[i] == '(') p++;
    if(s[i] == ')') p--;
    if(p == 0 && (s[i] == '-' || s[i] == '+' || s[i] == '*')) return true; 
  }
  return false;
}

bool isvalid(string s){
  if(s == "") return false;
  else if(isnum(s)) return true;
  else if(ispara(s)) return isope(s.substr(1,s.length()-2))&&isvalid(s.substr(1,s.length()-2));
  else{
    int p = 0;

    for(int i = 0; i < s.length(); i++){
      if(s[i] == '(') p++;
      if(s[i] == ')') p--;
      if(p == 0 && s[i] == '+') return isvalid(s.substr(0,i))&&isvalid(s.substr(i+1));
      if(p == 0 && s[i] == '-') return isvalid(s.substr(0,i))&&isvalid(s.substr(i+1));
    }

    for(int i = 0; i < s.length(); i++){
      if(s[i] == '(') p++;
      if(s[i] == ')') p--;
      if(p == 0 && s[i] == '*') return isvalid(s.substr(0,i))&&isvalid(s.substr(i+1));
    }
  }
  return false;
}

int tob(string s){
  reverse(s.begin(),s.end());
  int out = 0;
  for(int i = 0; i < s.length(); i++){
    out += (s[i]-'0')<<i;
  }
  return out;
}

int get(string s){
  //  cout << "S " << s << endl;
 
  if(isnum(s)) return tob(s);
  else if(ispara(s)) return get(s.substr(1,s.length()-2));
  else{
    int p = 0;

    for(int i = 0; i < s.length(); i++){
      if(s[i] == '(') p++;
      if(s[i] == ')') p--;
      if(p == 0 && s[i] == '+') return get(s.substr(0,i))+get(s.substr(i+1));
      if(p == 0 && s[i] == '-') return get(s.substr(0,i))-get(s.substr(i+1));
    }

    for(int i = 0; i < s.length(); i++){
      if(s[i] == '(') p++;
      if(s[i] == ')') p--;
      if(p == 0 && s[i] == '*') return get(s.substr(0,i))*get(s.substr(i+1));
    }
  }
}

void solve(int n){

  if(n < V.size()){
    for(int i = 0; i < wild.length(); i++){
      in[V[n]] = wild[i];
      solve(n+1);
    }
  }else{
    if(isvalid(in)) ans = max(ans,get(in));
    
  }
}

int main(){

  cin >> in;
  for(int i = 0; i < in.length(); i++)
    if(in[i] == '.') V.push_back(i);

  solve(0);

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

Compiler output:
a.cc: In function 'int tob(std::string)':
a.cc:64:3: error: 'reverse' was not declared in this scope
   64 |   reverse(s.begin(),s.end());
      |   ^~~~~~~
a.cc: In function 'int get(std::string)':
a.cc:93:1: warning: control reaches end of non-void function [-Wreturn-type]
   93 | }
      | ^
Language: C++

#include<cstdio>
#include<cassert>
#include<vector>
#include<algorithm>

using namespace std;

const long long inf=1e13;

struct RMQ{
	int N;
	long long dat[8192];
	void init(int N_){
		N=1;
		while(N<N_) N*=2;
		for(int i=1;i<=N*2-1;i++) dat[i]=-inf;
	}
	void update(int i,long long x){
		i+=N;
		while(i>0){
			dat[i]=max(dat[i],x);
			i/=2;
		}
	}
	long long get(int i){//[0,i)
		if(i==0) return -inf;
		int le=0,ri=N;
		int k=1;
		long long res=-inf;
		while(ri-le>1){
			int mid=(le+ri)/2;
			if(mid<=i){
				res=max(res,dat[k*2]);
				k=k*2+1;
				le=mid;
			}else{
				k=k*2;
				ri=mid;
			}
		}
		if(ri==i) res=max(res,dat[k]);
		return res;
	}
};


RMQ rmq;

long long sum[4040];
long long dp[4040][4040];

vector<long long> vals;

int N;
long long a[4040];

vector<int> C;

int main(){
	scanf("%lld",&N);
	for(int i=0;i<N;i++) scanf("%lld",a+i);
	sum[0]=a[0];
	for(int i=1;i<N;i++) sum[i]=sum[i-1]+a[i];
	for(int i=0;i<4040;i++) for(int j=0;j<4040;j++){
		dp[i][j]=inf;
	}
	for(int i=0;i<N;i++) dp[i][1]=sum[i];
	for(int k=2;k<=N;k++){
		vals.clear();
		for(int i=0;i<N;i++){
			if(dp[i][k-1]<inf) vals.push_back(dp[i][k-1]+sum[i]);
		}
		sort(vals.begin(),vals.end());
		vals.erase(unique(vals.begin(),vals.end()),vals.end());
		rmq.init(vals.size());
		for(int j=0;j<N;j++){
			int id=distance(vals.begin(),lower_bound(vals.begin(),vals.end(),sum[j]));
			long long ma=rmq.get(id);
			if(ma>-inf){
				dp[j][k]=min(dp[j][k],sum[j]-ma);
			}
			id=distance(vals.begin(),lower_bound(vals.begin(),vals.end(),dp[j][k-1]+sum[j]));
			rmq.update(id,sum[j]);
		}
	}
	int ans=0;
	for(int i=1;i<=N;i++){
		if(dp[N-1][i]<inf){
			ans=i;
		}
	}
	printf("%d\n",ans);
	int cur=N-1;
	for(int i=ans;i>=2;i--){
		for(int j=cur-1;j>=0;j--){
			bool flg=false;
			if(dp[j][i-1]<sum[cur]-sum[j]&&sum[cur]-sum[j]==dp[cur][i]){
				C.push_back(j+1);
				cur=j;
				flg=true;
				break;
			}
		}
		assert(flg);
	}
	reverse(C.begin(),C.end());
	for(int i=0;i<C.size();i++) printf("%d%c",C[i],i==C.size()-1?'\n':' ');
	if(C.size()==0) printf("\n");
	assert(C.size()>=ans-1);
/*	long long prev=-inf;
	for(int i=0;i<(int)C.size();i++){
		int le=i==0?0:C[i-1];
		//int ri=i==C.size()-1?N-1:C[i+1]-1;
		int ri=C[i];
		long long sum=0;
		for(int j=le;j<ri;j++) sum+=a[j];
	//	assert(prev<sum);
		prev=sum;
	}
	long long xx=0;
	if(C.size()>0){
		for(int i=C[C.size()-1];i<N;i++) xx+=a[i];
	//	assert(prev<xx);
	}*/
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/cassert:44,
                 from a.cc:2:
a.cc: In function 'int main()':
a.cc:104:24: error: 'flg' was not declared in this scope
  104 |                 assert(flg);
      |                        ^~~
Language: C

long long BIT[100010], bit_size; // long long は 64bit 整数．
void bit_init(int n){
	memset(BIT,0,n*(sizeof(long long)));
	bit_size = n;
}
long long bit_max(int n){ // [1,n] の最大値
	long long ans = 0;
	while(n > 0){
		ans = max(ans, BIT[n]);
		n &= n-1;
	}
	return ans;
}
void bit_setmax(int n, long long v){ // # [1,n] の最大値を v に更新する
	while (n < bit_size){
		BIT[n] = max(BIT[n], v);
		n += n & (-n);
	}
}
int main(){
	long long N,x,i=0;
	scanf("%lld",&N);
	bit_init(N+1);
	for(; i<N; ++i){
		scanf("%lld",&x);
		long long cost = bit_max(x);
		bit_setmax(x,cost+x);
	}
	printf("%lld\n",(1+N)*N/2 - bit_max(N));
}

Compiler output:
main.c: In function 'bit_init':
main.c:3:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    3 |         memset(BIT,0,n*(sizeof(long long)));
      |         ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | long long BIT[100010], bit_size; // long long は 64bit 整数．
main.c:3:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
    3 |         memset(BIT,0,n*(sizeof(long long)));
      |         ^~~~~~
main.c:3:9: note: include '<string.h>' or provide a declaration of 'memset'
main.c: In function 'bit_max':
main.c:9:23: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
    9 |                 ans = max(ans, BIT[n]);
      |                       ^~~
main.c: In function 'main':
main.c:22:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   22 |         scanf("%lld",&N);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | long long BIT[100010], bit_size; // long long は 64bit 整数．
main.c:22:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   22 |         scanf("%lld",&N);
      |         ^~~~~
main.c:22:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:29:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |         printf("%lld\n",(1+N)*N/2 - bit_max(N));
      |         ^~~~~~
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <algorithm>
#include <utility>
#include <vectortor>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define SORT(x) sort((x).begin(),(x).end())
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second
#define debug(x) #x << "=" << (x)
 
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int lli;
typedef pair<int,int> pii;
template<typename T> using vector=std::vectortor<T>;

const int INF=1<<30;
const long long int INF_=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

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

class SegmentTree{
	private:
	public:
	int size;
	vector<int> data;
	void Init(int n){
		size=1;
		while(size<n) size*=2;
		data=vector<int>(size*2-1,INF);
	}
	void Update(int k,int a){
		k+=size-1;
		data[k]=a;
		while(k>0){
			k=(k-1)/2;
			data[k]=min(data[k*2+1],data[k*2+2]);
		}
	}	
	int Query(int a,int b,int k,int l,int r){
		if(r<=a||b<=l) return INF;
		if(a<=l&&r<=b) return data[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 main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N;
	cin >> N;
	vector<int> x(N);
	REP(i,0,N) cin >> x[i];
	vector<int> s(N);
	s[0]=x[0];
	REP(i,1,N) s[i]+=s[i-1]+x[i];
	vector<vector<int>> dp(N,vector<int>(2));
	dp[0][0]=x[0];
	SegmentTree st;
	st.Init(N);
	st.Update(x[0]-1,-s[0]);
	REP(i,1,N){
		dp[i][0]=min(dp[i-1][0],dp[i-1][1])+x[i];
		dp[i][1]=min(s[i-1],st.Query(0,x[i],0,0,st.size)+s[i-1]);
		st.Update(x[i]-1,dp[i][1]-s[i]);
	}
	cout << min(dp[N-1][1],dp[N-1][0]) << endl;
	return 0;
}

Compiler output:
a.cc:4:10: fatal error: vectortor: No such file or directory
    4 | #include <vectortor>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

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

const int MAX_N = 1<<17;

int n;
int64_t dat[2*MAX_N-1];

void init(int n_){
    n = 1;
    while(n<n_)n*=2;
    for(int i=0;i<2*n-1;i++) dat[i]=INT_MAX;
}

//0-indexed, k-th to a
void update(int k, int64_t a){
    k+=n-1;
    dat[k]=a;
    while(k>0){
        k=(k-1)/2;
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}

//[a,b)???????°????
int64_t query(int a, int b, int k=0, int l=0, int r=n){
    if(r<=a||b<=l) return INT_MAX;
    if(a<=l&&r<=b) return dat[k];
    else{
        int64_t vl = query(a,b,k*2+1,l,(l+r)/2);
        int64_t vr = query(a,b,k*2+2,(l+r)/2,r);
        return min(vl,vr);
    }
}

using P = pair<int,int>;

int main(){
    int N;
    cin>>N;
    vector<P> V;
    vector<int> X;
    for(int i=0;i<N;i++){
        int x;
        cin>>x;
        V.emplace_back(x,i);
        X.push_back(x);
    }
    sort(V.begin(), V.end());
    vector<int> nth(N);
    for(int i=0;i<N;i++){
        nth[V[i].second]=i;
    }
    init(N);
    for(int i=0;i<N;i++){
        update(i,0);
    }
    for(int i=0;i<N;i++){
        int64_t sum = -X[i];
        if(nth[i]){
            sum+=query(0,nth[i]);
        }
        update(nth[i],sum);
    }
    int64_t ans = 0;
    for(auto x:X) ans+=x;
    ans+=query(0,N);
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:15:37: error: 'INT_MAX' was not declared in this scope
   15 |     for(int i=0;i<2*n-1;i++) dat[i]=INT_MAX;
      |                                     ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <map>
  +++ |+#include <climits>
    4 | #include <tuple>
a.cc: In function 'int64_t query(int, int, int, int, int)':
a.cc:30:27: error: 'INT_MAX' was not declared in this scope
   30 |     if(r<=a||b<=l) return INT_MAX;
      |                           ^~~~~~~
a.cc:30:27: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc: In function 'int main()':
a.cc:52:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   52 |     sort(V.begin(), V.end());
      |     ^~~~
      |     short
Language: C++

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

const int MAX_N = 1<<17;

int n;
int64_t dat[2*MAX_N-1];

void init(int n_){
    n = 1;
    while(n<n_)n*=2;
    for(int i=0;i<2*n-1;i++) dat[i]=1e12;
}

//0-indexed, k-th to a
void update(int k, int64_t a){
    k+=n-1;
    dat[k]=a;
    while(k>0){
        k=(k-1)/2;
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}

//[a,b)???????°????
int64_t query(int a, int b, int k=0, int l=0, int r=n){
    if(r<=a||b<=l) return INT_MAX;
    if(a<=l&&r<=b) return dat[k];
    else{
        int64_t vl = query(a,b,k*2+1,l,(l+r)/2);
        int64_t vr = query(a,b,k*2+2,(l+r)/2,r);
        return min(vl,vr);
    }
}

using P = pair<int,int>;

int main(){
    int N;
    cin>>N;
    vector<P> V;
    vector<int> X;
    for(int i=0;i<N;i++){
        int x;
        cin>>x;
        V.emplace_back(x,i);
        X.push_back(x);
    }
    sort(V.begin(), V.end());
    vector<int> nth(N);
    for(int i=0;i<N;i++){
        nth[V[i].second]=i;
    }
    init(N);
    for(int i=0;i<N;i++){
        update(i,0);
    }
    for(int i=0;i<N;i++){
        int64_t sum = -X[i];
        if(nth[i]){
            sum+=query(0,nth[i]);
        }
        update(nth[i],sum);
    }
    int64_t ans = 0;
    for(auto x:X) ans+=x;
    ans+=query(0,N);
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int64_t query(int, int, int, int, int)':
a.cc:30:27: error: 'INT_MAX' was not declared in this scope
   30 |     if(r<=a||b<=l) return INT_MAX;
      |                           ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <map>
  +++ |+#include <climits>
    4 | #include <tuple>
a.cc: In function 'int main()':
a.cc:52:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   52 |     sort(V.begin(), V.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <tuple>
#include <climits>
using namespace std;

const int MAX_N = 1<<17;

int n;
int64_t dat[2*MAX_N-1];

void init(int n_){
    n = 1;
    while(n<n_)n*=2;
    for(int i=0;i<2*n-1;i++) dat[i]=LLONG_MAX;
}

//0-indexed, k-th to a
void update(int k, int64_t a){
    k+=n-1;
    dat[k]=a;
    while(k>0){
        k=(k-1)/2;
        dat[k]=min(dat[k*2+1],dat[k*2+2]);
    }
}

//[a,b)???????°????
int64_t query(int a, int b, int k=0, int l=0, int r=n){
    if(r<=a||b<=l) return LLONG_MAX;
    if(a<=l&&r<=b) return dat[k];
    else{
        int64_t vl = query(a,b,k*2+1,l,(l+r)/2);
        int64_t vr = query(a,b,k*2+2,(l+r)/2,r);
        return min(vl,vr);
    }
}

using P = pair<int,int>;

int main(){
    int N;
    cin>>N;
    vector<P> V;
    vector<int> X;
    for(int i=0;i<N;i++){
        int x;
        cin>>x;
        V.emplace_back(x,i);
        X.push_back(x);
    }
    sort(V.begin(), V.end());
    vector<int> nth(N);
    for(int i=0;i<N;i++){
        nth[V[i].second]=i;
    }
    init(N);
    for(int i=0;i<N;i++){
        update(i,0);
    }
    for(int i=0;i<N;i++){
        int64_t sum = -X[i];
        if(nth[i]){
            sum+=query(0,nth[i]);
        }
        update(nth[i],sum);
    }
    int64_t ans = 0;
    for(auto x:X) ans+=x;
    ans+=query(0,N);
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   53 |     sort(V.begin(), V.end());
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
#define int long long
#define MAX 100001
using namespace std;
int n,p,A[MAX*2],N;
void Segtree(int n_){
  n=1;
  while(n<n_)n*=2;
}
void update(int k,int x){
  k+=n-1;
  A[k]=x;
  while(k>0){
    k=(k-1)/2;
    A[k]=max(A[k*2+1],A[k*2+2]);
  }
}
int find(int a,int b,int k,int l,int r){
  if(r<=a||b<=l)return 0;
  if(a<=l&&r<=b)return A[k];
  int v1=find(a,b,k*2+1,l,(l+r)/2);
  int v2=find(a,b,k*2+2,(l+r)/2,r);
  return max(v1,v2);
}
int main(){
  cin>>n;
  N=n;
  Segtree(n+1);
  for(int i=0;i<N;i++){
    scanf("%lld",&p);
    int v=find(0,p,0,0,n);
    update(p,v+p);
  }
  cout<<N*(N+1)/2-find(0,N+1,0,0,n)<<endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>

#define ALL(a) (a).begin(). (a).end()
typedef long long ll;

using namespace std;

int main(){
	int n; cin >> n;

	vector<ll> dp(n,0);
	vector<ll> sum(n,0);
	vector<ll> a(n);
	for(auto &e : a)cin >> e;
	for(auto itr = a.rbegin(); itr != a.rend(); ++itr){
		int idx = distance(dp.begin(),lower_bound(ALL(dp), a))-1;
		dp[idx] = *itr;
		sum[idx] = *itr;
		if(idx != 0){
			sum[idx] += sum[idx-1];
		}
	}
	ll ans = a.accumulate() - max_element(ALL(sum));
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:29: error: expected unqualified-id before '(' token
    3 | #define ALL(a) (a).begin(). (a).end()
      |                             ^
a.cc:16:59: note: in expansion of macro 'ALL'
   16 |                 int idx = distance(dp.begin(),lower_bound(ALL(dp), a))-1;
      |                                                           ^~~
a.cc:23:20: error: 'class std::vector<long long int>' has no member named 'accumulate'
   23 |         ll ans = a.accumulate() - max_element(ALL(sum));
      |                    ^~~~~~~~~~
a.cc:3:29: error: expected unqualified-id before '(' token
    3 | #define ALL(a) (a).begin(). (a).end()
      |                             ^
a.cc:23:47: note: in expansion of macro 'ALL'
   23 |         ll ans = a.accumulate() - max_element(ALL(sum));
      |                                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <climits>
using namespace std;

long long bit[100010] = {};

void add(int x,int v){
	for(int i = x ; i < 100010 ; i += i & -i ){
		bit[i] = max(bit[i],v);
	}
}

long long get(int x){
	long long ans = 0;
	for(int i = x ; i > 0 ; i -= i & -i ){
		ans = max(bit[i],ans);
	}
	return ans;
}

int main(){
	int n;
	cin >> n;
	long long ans = 0;
	for(int i = 0 ; i < n ; i++){
		int a;
		cin >> a;
		add(a,get(a)+a);
	}
	cout << 1ll*n*(n+1) / 2 - get(100001) << endl;
}

Compiler output:
a.cc: In function 'void add(int, int)':
a.cc:12:29: error: no matching function for call to 'max(long long int&, int&)'
   12 |                 bit[i] = max(bit[i],v);
      |                          ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 |                 bit[i] = max(bit[i],v);
      |                          ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |                 bit[i] = max(bit[i],v);
      |                          ~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<climits>

const int MAX_N=100000;

using namespace std;

int n,dat[2*MAX_N-1];

void init(int n_){
	n=1;
	while(n<n_)n*=2;
	for(int i=0;i<2*n-1;i++)dat[i]=0;
}

void update(int k,int a){
	k+=n-1;
	dat[k]=a;
	
	while(k>0){
		k=(k-1)/2;
		dat[k]=max(dat[2*k+1],dat[2*k+2]);
	}
}

int query(int a,int b,int k,int l,int r){
	if(r<=a || b<=l)return 0;
	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 max(vl,vr);
	}
}

int main(void){
	
	long long in,n_,ans=0;
	cin >> n_;
	
	init(n_);
	
	for(int i=0;i<n_;i++){
		cin >> in;
		update(in,in+query(1,in+1,0,0,n));
		ans=max(ans,dat[in+n-1]);
	}
	cout << n_*(n_+1)/2-ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:24: error: no matching function for call to 'max(long long int&, int&)'
   48 |                 ans=max(ans,dat[in+n-1]);
      |                     ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:48:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   48 |                 ans=max(ans,dat[in+n-1]);
      |                     ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:48:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   48 |                 ans=max(ans,dat[in+n-1]);
      |                     ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

typedef long long Int;

Int bit[105000];

void setnum(int pos, int val){
	while(pos < 105000){
		bit[pos] = max(val, bit[pos]);
		pos += pos & -pos;
	}
}

Int maxnum(int pos){
	Int res = 0;
	while(pos){
		res = max(res, bit[pos]);
	}
	return res;
}

int main(){
	Int n, sum = 0, x;
	cin >> n;	
	for(int i = 0;i < n;i++){
		cin >> x;
		sum += x;
		Int p = p + maxnum(p);
		setnum(x, p);
	}
	cout << sum - maxnum(10100) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void setnum(int, int)':
a.cc:12:31: error: no matching function for call to 'max(int&, Int&)'
   12 |                 bit[pos] = max(val, bit[pos]);
      |                            ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:31: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'Int' {aka 'long long int'})
   12 |                 bit[pos] = max(val, bit[pos]);
      |                            ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:12:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |                 bit[pos] = max(val, bit[pos]);
      |                            ~~~^~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

typedef long long Int;

Int bit[105000];

void setnum(int pos, Int val){
	while(pos < 105000){
		bit[pos] = max(val, bit[pos]);
		pos += pos & -pos;
	}
}

Int maxnum(int pos){
	Int res = 0;
	while(pos){
		res = max(res, bit[pos]);
		pos -= pos &-pos
	}
	return res;
}

int main(){
	Int n, sum = 0, x;
	cin >> n;	
	for(int i = 0;i < n;i++){
		cin >> x;
		sum += x;
		Int p = p + maxnum(p);
		setnum(x, p);
	}
	cout << sum - maxnum(10100) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'Int maxnum(int)':
a.cc:21:33: error: expected ';' before '}' token
   21 |                 pos -= pos &-pos
      |                                 ^
      |                                 ;
   22 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int logMaxStep = 30;

typedef long long ll;
typedef vector< vector<ll> > Graph;

int GetLogStep(int S) {
	int res;
	for (res = 0; (1 << res) <= S; ++res);
	return res;
}
Graph nextG(const Graph& g1, const Graph& g2) {
	int N = g1.size();
	Graph res(N, vector<ll>(N, 0));
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			for (int k = 0; k < N; ++k) {
				if (g1[i][k] > 0 && g2[k][j] > 0) {
					res[i][j] = max(res[i][j], g1[i][k]+g2[k][j]);
				}
			}
		}
	}
	return res;
}
vector<int> nextDP(vector<ll>& dp, Graph& g) {
	int N = g.size();
	vector<int> prevV(N, -1);
	vector<ll> ndp(N, -1);
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (dp[i] >= 0 && g[i][j] > 0) {
				if (dp[i]+g[i][j] > ndp[j]) {
					ndp[j] = dp[i]+g[i][j];
					prevV[j] = i;
				}
			}
		}
	}
	for (int i = 0; i < N; ++i) {
		dp[i] = ndp[i];
	}
	return prevV;
}
ll GetMaxScore(vector<Graph>& powG, int S) {
	int N = powG[0].size();
	int logS = GetLogStep(S);
	vector<ll> dp(N, 0);
	for (int i = 0; i < logS; ++i) {
		Graph& g = powG[i];
		if ( (1 << i) & S ) {
			nextDP(dp, g);
		}
	}
	ll res = -1;
	for (int i = 0; i < dp.size(); ++i) {
		res = max(res, dp[i]);
	}
	return res;
}
int check200Step(Graph& G, int K) {
	int N = G.size();
	vector<ll> dp(N, 0);
	vector< vector<int> > prevV;
	ll lastAns = -1;
	for (int t = 0; t < 1000; ++t) {
		prevV.push_back( nextDP(dp, G) );
		int aid = 0;
		for (int i = 0; i < dp.size(); ++i) {
			if (dp[i] > dp[aid]) aid = i;
		}
		if (dp[aid] >= K) {
			cout << t+1 << endl;
			if (t+1 <= 100) {
				vector<int> vl;
				int v = aid; vl.push_back(v);
				for (int i = t; i >= 0; --i) {
					v = prevV[i][v];
					vl.push_back(v);
				}
				reverse(vl.begin(), vl.end());
				for (int i = 0; i < vl.size(); ++i) {
					if (i) cout << " ";
					cout << vl[i];
				}
				cout << endl;
			}
			return -2;
		}
		lastAns = dp[aid];
	}
	return lastAns;
}
int main() {
	int N, E, K; cin >> N >> E >> K;
	Graph G(N, vector<ll>(N, 0));
	for (int i = 0; i < E; ++i) {
		int a, b; ll c; cin >> a >> b >> c;
		G[a][b] = max(G[a][b], c);
	}
	int result = check1000Step(G, K);
	if (result > 0) {
		vector<Graph> powG(logMaxStep+1); powG[0] = G;
		for (int i = 0; i < logMaxStep; ++i) {
			powG[i+1] = nextG(powG[i], powG[i]);
		}

		for (int i = N; i <= N+100; ++i) {
			if (GetMaxScore(powG, i+1) >= result) {
				assert(GetMaxScore(powG, i+1) > GetMaxScore(powG, i));
			}
		}
		int l = 0, r = K+1;
		for (int t = 0; t < logMaxStep; ++t) {
			int m = (l + r) / 2;
			if ( GetMaxScore(powG, m) >= K ) {
				r = m;
			}
			else {
				l = m;
			}
		}
		assert(r - l <= 1);
		assert(r <= K);
		cout << r << endl;
	}
	else if (result == -1) {
		cout << -1 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:104:22: error: 'check1000Step' was not declared in this scope; did you mean 'check200Step'?
  104 |         int result = check1000Step(G, K);
      |                      ^~~~~~~~~~~~~
      |                      check200Step
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
#define bigas(a,b) if(a<b){a=b;}
using namespace std;
int main(void){
	int h=0,i=0,j=0,m=0,ex=0,ans=0,V,E,K,x,y,z;
	static int ya[18][150][150]={0};//ya[i][x][y]???x??????y???2^i??¬???????????´????????¢??°?????????
	static int gen[150]={0};//gen[x]???x??´??????????????§?????°
	static int ima[150]={0};
	static int pre[101][150]={0};//??????????????\??????
	static int poi[101][150]={0};//??????
	scanf("%d %d %d",&V,&E,&K);
	for(i=0;i<E;i++){
		scanf("%d %d %d",&x,&y,&z);
		bigas(ya[0][x][y],z);
	}
	for(h=1;h<101;h++){
		for(i=0;i<V;i++){
			for(j=0;j<V;j++){
				if(poi[h][j]<poi[h-1][i]+ya[0][i][j]){
					poi[h][j]=poi[h-1][i]+ya[0][i][j];
					pre[h][j]=i;
					if(poi[h][j]>K){ex=1;K=poi[h][j];ans=j;}
				}
			}
		}
		if(ex==1){break;}
	}
	if(ex==1){
		printf("%d\n",h);
		ima[h]=ans;
		for(i=h-1;i>=0;i--){
			ima[i]=pre[i+1][ima[i+1]];
		}
		for(i=0;i<=h;i++){
			printf("%d ",ima[i]);
		}
		return 0;
	}
	for(h=1;h<17;h++){//2^i??¬????±???????
		for(i=0;i<V;i++){//i??????
			for(j=0;j<V;j++){//j?????§
				for(m=0;m<V;m++){//m????????£???
					bigas{ya[h][i][j],ya[h-1][i][m]+ya[h-1][m][j]};
				}
			}
		}
	}
	//??????????????¬??°??????????????§????±???????
	for(h=17;h>=0;h--){
		for(i=0;i<V;i++){
			for(j=0;j<V;j++){
				ima[j]=gen[i]+ya[h][i][j];
				if(ima[j]>=K){ex=1;break;}
			}
			if(ex==1){break;}
		}
		if(ex==0){
			ans+=(1<<h);
			for(i=0;i<V;i++){
			gen[i]=ima[i];
			}
		}
		ex=0;
	}
	ans++;
	printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:41: error: 'bigas' was not declared in this scope
   45 |                                         bigas{ya[h][i][j],ya[h-1][i][m]+ya[h-1][m][j]};
      |                                         ^~~~~
Language: C++


//stl????????????
//I don't know STL???
//I plactice now???
//OH! WRONG ANSWER!!
#include<cstdio>
#include<vector>
#include<algorithm>
#define bigas(a,b) if(a<b){a=b;}
using namespace std;
int main(void){
	int h=0,i=0,j=0,m=0,ex=0,ans=0,V,E,K,x,y,z;
	static int ya[18][150][150]={0};//ya[i][x][y]???x??????y???2^i??¬???????????´????????¢??°?????????
	static int gen[150]={0};//gen[x]???x??´??????????????§?????°
	static int ima[150]={0};
	static int pre[101][150]={0};//??????????????\??????
	static int poi[101][150]={0};//??????
	for(h=0;h<18;h++){
		for(i=0;i<150;i++){
			for(j=0;j<150;j++){
				ya[h][i][j]=-(1<<30);
				if(i==j){ya[h][i][j]=0;}
			}
		}
	}
	scanf("%d %d %d",&V,&E,&K);
	for(i=0;i<E;i++){
		scanf("%d %d %d",&x,&y,&z);
		bigas(ya[0][x][y],z);
	}
	for(h=1;h<101;h++){
		for(i=0;i<V;i++){
			for(j=0;j<V;j++){
				if(poi[h][j]<poi[h-1][i]+ya[0][i][j]){
					poi[h][j]=poi[h-1][i]+ya[0][i][j];
					pre[h][j]=i;
					if(poi[h][j]>=K){ex=1;K=poi[h][j];ans=j;}
				}
			}
		}
		if(ex==1){break;}
	}
	if(ex==1){
		printf("%d\n",h);
		ima[h]=ans;
		for(i=h-1;i>=0;i--){
			ima[i]=pre[i+1][ima[i+1]];
		}
		for(i=0;i<=h;i++){
			printf("%d ",ima[i]);
		}
		return 0;
	}
	h=0,i=0,j=0,m=0,ex=0,ans=0;
	
	//??????????????§????????????????§£???
	for(h=1;h<18;h++){//2^i??¬????±???????
		for(i=0;i<V;i++){//i??????
			for(j=0;j<V;j++){//j?????§
				for(m=0;m<V;m++){//m????????£???
					bigas(ya[h][i][j],ya[h-1][i][m]+ya[h-1][m][j]);
				}
			}
		}
	}
	//??????????????¬??°??????????????§????±???????
	for(h=17;h>=0;h--){
		for(i=0;i<V;i++){
			for(j=0;j<V;j++){
				bigas(ima[j],gen[i]+ya[h][i][j]);
				if(ima[j]>=K){ex=1;break;}
			}
		}
		if(ex==0){
			ans+=(1<<h);
			for(i=0;i<V;i++){
			gen[i]=ima[i];
			}
		}else{
			for(i=0;i<V;i++){
			ima[i]=gen[i];
			}
		}
		ex=0;
	}
	ans++;
	if(ans+500<(1<<18)){printf("%d\n",ans);}else{printf("-1\n");}

Compiler output:
a.cc: In function 'int main()':
a.cc:87:70: error: expected '}' at end of input
   87 |         if(ans+500<(1<<18)){printf("%d\n",ans);}else{printf("-1\n");}
      |                                                                      ^
a.cc:11:15: note: to match this '{'
   11 | int main(void){
      |               ^
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <bitset>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define sz size()
#define pb push_back
#define mp make_pair
#define ALL(X) (X).begin(),(X).end()

using namespace std;

const int INF = 1000000000;
const double eps = 1e-8;

int main(void) {
  int m;
  cin>>m;
  map<string,bitset<256>> val;
  REP(i,m) {
    string name;
    int minv, maxv;
    cin>>name>>minv>>maxv;
    bitset<256> bs;
    REP(j,256)
      bs[j] = false;
    FOR(j,minv,maxv+1)
      bs[j] = true;
    val[name] = bs;
  }
  stack<bitset<256>> stk;
  int n;
  cin>>n;
  bool flag = false;
  REP(i,n) {
    string str;
    cin>>str;
    if(val.find(str) != val.end())
      stk.push(val[str]);
    else if(str == "/") {
      if(stk.top()[0]) {
        flag = true;
        break;
      }else{
        bitset<256> bs,lhs,rhs;
        REP(j,256)bs[j] = false;
        rhs = stk.top();stk.pop();
        lhs = stk.top();stk.pop();
        REP(j,256)REP(k,256) {
          if(lhs[j] && rhs[k])
          bs[(j/k)%256] = true;
        }
        stk.push(bs);
      }
    }else if(str == "*") {
      bitset<256> bs,lhs,rhs;
      REP(j,256)bs[j] = false;
      rhs = stk.top();stk.pop();
      lhs = stk.top();stk.pop();
      REP(j,256)REP(k,256) {
        if(lhs[j] && rhs[k])
        bs[(j*k)%256] = true;
      }
      stk.push(bs);
    }else if(str == "+") {
      bitset<256> bs,lhs,rhs;
      REP(j,256)bs[j] = false;
      rhs = stk.top();stk.pop();
      lhs = stk.top();stk.pop();
      REP(j,256)REP(k,256) {
        if(lhs[j] && rhs[k])
        bs[(j+k)%256] = true;
      }
      stk.push(bs);
    }else if(str == "-") {
      bitset<256> bs,lhs,rhs;
      REP(j,256)bs[j] = false;
      rhs = stk.top();stk.pop();
      lhs = stk.top();stk.pop();
      REP(j,256)REP(k,256) {
        if(lhs[j] && rhs[k])
        bs[(256+j-k)%256] = true;
      }
      stk.push(bs);
    } else {
      bitset<256> bs,lhs,rhs;
      REP(j,256)bs[j] = false;
      bs[atoi(str.c_str())] = true;
      stk.push(bs);
    }
  }
  if(flag)
    cout<<"error"<<endl;
  else
    cout<<"correct"<<endl;
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef unsigned char uc;
int main(){
  int m;
  cin>>m;
  int l[m],r[m];
  map<string,int> ms;
  for(int i=0;i<m;i++){
    string s;
    cin>>s>>l[i]>>r[i];
    ms[s]=i;
  }
  int n;
  cin>>n;
  string ss[n];
  for(int i=0;i<n;i++) cin>>ss[i];
  bool f=0;
  time_t start=clock();
  srand(unsigned(time));
  while((double)(clock()-start)/CLOCKS_PER_SEC<1.7&&!f){
    stack<uc> sc;
    for(int i=0;!f&&i<n;i++){
      //cout<<i<<":"<<ss[i]<<endl;
      if(ms.find(ss[i])!=ms.end()){ 
	int j=ms[ss[i]],k=(l[j]+(rand()%(r[j]-l[j])));
	//cout<<ss[i]<<":"<<k<<endl;
	sc.push(k);
      }else if(isdigit(ss[i][0])){
	uc a=0;
	for(int j=0;j<(int)ss[i].size();j++) a=(uc)(a*10+ss[i][j]-'0');
	sc.push(a);
      }else{
	uc a,b;
	b=sc.top();sc.pop();
	a=sc.top();sc.pop();
	if(ss[i]=="+") sc.push(a+b);
	if(ss[i]=="-") sc.push(a-b);
	if(ss[i]=="*") sc.push(a*b);
	if(ss[i]=="/"){
	  if(b) sc.push(a/b);
	  else{
	    f=1;
	    break;
	  }
	}
      }
    }
  }
  cout<<(!f?"correct":"error")<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: cast from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' loses precision [-fpermissive]
   20 |   srand(unsigned(time));
      |         ^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef unsigned char uc;
int main(){
  int m;
  cin>>m;
  int l[m],r[m];
  map<string,int> ms;
  for(int i=0;i<m;i++){
    string s;
    cin>>s>>l[i]>>r[i];
    ms[s]=i;
  }
  int n;
  cin>>n;
  string ss[n];
  for(int i=0;i<n;i++) cin>>ss[i];
  bool f=0;
  time_t start=clock();
  srand(unsigned(time));
  while(((double)(clock()-start)/CLOCKS_PER_SEC)<1.7&&!f){
    stack<uc> sc;
    for(int i=0;!f&&i<n;i++){
      //cout<<i<<":"<<ss[i]<<endl;
      if(ms.find(ss[i])!=ms.end()){ 
	int j=ms[ss[i]],k=(l[j]+(rand()%(r[j]-l[j])));
	//cout<<ss[i]<<":"<<k<<endl;
	sc.push(k);
      }else if(isdigit(ss[i][0])){
	uc a=0;
	for(int j=0;j<(int)ss[i].size();j++) a=(uc)(a*10+ss[i][j]-'0');
	sc.push(a);
      }else{
	uc a,b;
	b=sc.top();sc.pop();
	a=sc.top();sc.pop();
	if(ss[i]=="+") sc.push(a+b);
	if(ss[i]=="-") sc.push(a-b);
	if(ss[i]=="*") sc.push(a*b);
	if(ss[i]=="/"){
	  if(b) sc.push(a/b);
	  else{
	    f=1;
	    break;
	  }
	}
      }
    }
  }
  cout<<(!f?"correct":"error")<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: cast from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' loses precision [-fpermissive]
   20 |   srand(unsigned(time));
      |         ^~~~~~~~~~~~~~