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

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

int H,W,N;
int a[201][201];
int A[201][201];


int calc(int h,int w,int H,int W){
  return A[H][W]-A[H][w]-A[h][W]+A[h][w];
}

int mem[201][201][201][201][5];

int solve(int h,int w,int H,int W,int N){
  if(mem[h][w][H][W][N]!=-1)
    return mem[h][w][H][W][N];
  
  int res=0,total=calc(h,w,H,W);
  if(N==1)return total;
  
  for(int i=h;i<H;i++){
    for(int divi=1;divi<N;divi++){
      int v=solve(h,w,i,W,divi);
      int k=solve(i,w,H,W,N-divi);
      res=max(res, min(v,k) );
    }
  }
  for(int j=w;j<W;j++){
    for(int divi=1;divi<N;divi++){
      int v=solve(h,w,H,j,divi);
      int k=solve(h,j,H,W,N-divi);
      res=max(res, min(v,k) );
    }
  }
  return mem[h][w][H][W][N]res;
}

int compute(){
  if(N!=4)return 0;
  int res=0;
  for(int ah=1;ah+1<H;ah++){
    for(int bh=ah+1;bh<H;bh++){
      for(int aw=1;aw+1<W;aw++){
        for(int bw=aw+1;bw<W;bw++){
          int sum0=calc(0,0,ah,bw);
          int sum1=calc(0,bw,bh,W);
          int sum2=calc(bh,aw,H,W);
          int sum3=calc(ah,0,H,aw);
          res=max(res,min(min(sum0,sum1),min(sum2,sum3)));
          
          sum0=calc(0,0,bh,aw);
          sum1=calc(bh,0,H,bw);
          sum2=calc(ah,bw,H,W);
          sum3=calc(0,aw,ah,W);
          res=max(res,min(min(sum0,sum1),min(sum2,sum3)));
        }
      }
    }
  }
  return res;
}

int main(){
  scanf("%d %d %d",&H,&W,&N);
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      scanf("%d",&a[i][j]);
      A[i+1][j+1]=a[i][j]+A[i+1][j]+A[i][j+1]-A[i][j];
    }
  }

  int ans=max(solve(0,0,H,W,N),compute());
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int solve(int, int, int, int, int)':
a.cc:36:28: error: expected ';' before 'res'
   36 |   return mem[h][w][H][W][N]res;
      |                            ^~~
      |                            ;
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int a[201][201],h,w,n,mid;
bool used[201][201];
set<P>st;
int get_area(int &sx,int &sy,int &gx,int &gy){
  int res = a[gy][gx];
  if(sx!=0&&sy!=0)res=res-a[gy][sx-1]-a[sy-1][gx]+a[sy-1][sx-1];
  else if(sy!=0)res-=a[sy-1][gx];
  else if(sx!=0)res-=a[gy][sx-1];
  return res;
}
bool dfs(int y,int x,int dep){st.insert(P(y,x));
  int m=1e9;
  for(int i=y;i<h;i++){
    for(int j=x;j<w;j++){
 
      if(used[i][j])break;
      if(m<=j)break;
 
      if(get_area(x,y,j,i)>=mid){
        m=j;
 int f=1e9;
    for(int k=y;k<=i;k++)
      for(int l=x;l<=j;l++)
        if(used[k][l])goto L;
     
    for(int k=y;k<=i;k++)
      for(int l=x;l<=j;l++)
        used[k][l]=1;
     
 
    if(dep==n-1)return 1;
     
    for(int k=0;k<h;k++){
      for(int l=0;l<w;l++){
        if(!used[k][l]&&l<f){
          if((!k&&l&&used[k][l-1])||(k&&!l&&used[k-1][l])||(k&&l&&used[k][l-1]&&used[k-1][l])){
            if(st.count(P(k,l)))break;
            if(dfs(k,l,dep+1))return 1;
          }
          f=l;
          break;
        }
      }
    }
 
    for(int k=y;k<=i;k++)
      for(int l=x;l<=j;l++)
        used[k][l] = 0;
      L:;
    break;
      }
    }
  }
  return 0;
}
int main(){
  cin>>h>>w>>n;
  r(i,h)r(j,w)scanf("%d",&a[i][j]);
  r(i,h)r(j,w-1)a[i][j+1]+=a[i][j];
  r(i,h-1)r(j,w)a[i+1][j]+=a[i][j];
  int l=0,r=1e9;
  while(l<r){
    st.clear();
    memset(used,0,sizeof(used));
    mid = (l+r)/2;
    if(!dfs(0,0,0))r=mid;
    else l=mid+1;
  }
  cout<<l-1<<endl;
}

Compiler output:
a.cc:6:5: error: 'P' was not declared in this scope
    6 | set<P>st;
      |     ^
a.cc:6:6: error: template argument 1 is invalid
    6 | set<P>st;
      |      ^
a.cc:6:6: error: template argument 2 is invalid
a.cc:6:6: error: template argument 3 is invalid
a.cc: In function 'bool dfs(int, int, int)':
a.cc:14:34: error: request for member 'insert' in 'st', which is of non-class type 'int'
   14 | bool dfs(int y,int x,int dep){st.insert(P(y,x));
      |                                  ^~~~~~
a.cc:14:41: error: 'P' was not declared in this scope
   14 | bool dfs(int y,int x,int dep){st.insert(P(y,x));
      |                                         ^
a.cc:40:19: error: request for member 'count' in 'st', which is of non-class type 'int'
   40 |             if(st.count(P(k,l)))break;
      |                   ^~~~~
a.cc: In function 'int main()':
a.cc:66:8: error: request for member 'clear' in 'st', which is of non-class type 'int'
   66 |     st.clear();
      |        ^~~~~
Language: Java

#include <iostream>
#include <cmath>
using namespace std;
 
int main(){
    while(1){
        int r0,w0,c,r;
        cin >> r0 >> w0 >> c >> r;
        if(r0==0) break;
 
        if(w0*c > r0){
            cout << (int)ceil((double)(w0*c-r0)/r) << endl;
        }else{
            cout << 0 << endl;
        }
    }
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cmath>
^
Main.java:8: error: not a statement
        cin >> r0 >> w0 >> c >> r;
                             ^
Main.java:12: error: not a statement
            cout << (int)ceil((double)(w0*c-r0)/r) << endl;
                                                   ^
Main.java:14: error: not a statement
            cout << 0 << endl;
                      ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
6 errors
Language: C

#include <stdio.h>
int main(void){
   int w0,R0,R,C,x;
   while(1){
       scanf("%d %d %d %d",&R0,&w0,&C,&R);
       if(R0<1||w0<1||C<1||R<1)
       break;
       if(R0<(C*w0)){
           if((C*w0-R0)%R==0){
               x=(C*w0-R0)/R;
           }
           else{
               x=(C*w0-R0)/R+1;
           }
       }
       else{
           x=0;
       }
       printf("%d\n",x);
   }
   return 0;


Compiler output:
main.c: In function 'main':
main.c:21:4: error: expected declaration or statement at end of input
   21 |    return 0;
      |    ^~~~~~
Language: C++

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

signed main()
{
  int A, B, C, D;
  
  while(cin >> A >> B >> C >> D, A || B || C || D) {
    cout << max(0LL, (B * C - A + D - 1) / D) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: no matching function for call to 'max(long long int, int)'
    9 |     cout << max(0LL, (B * C - A + D - 1) / D) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:9:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |     cout << max(0LL, (B * C - A + D - 1) / D) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:9:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |     cout << max(0LL, (B * C - A + D - 1) / D) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
int R0,W,C,R;
while(true)
{
cin >> R0 >> W0 >> C >>R ;
if(R0 == 0) break;
cout << static_cast<int>((C*W0-R0)/R + 1) << endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 'W0' was not declared in this scope; did you mean 'W'?
    9 | cin >> R0 >> W0 >> C >>R ;
      |              ^~
      |              W
Language: C++

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

using namespace std;

int main(){

  double Ra,Wa,C,R;
  while(cin >> Ra >> Wa >> C >> R,Ra+Wa+C+R){
    if(Ra / Wa >= C)
      cout << "0" << endl;
    int n = 1;
    else{
      while(((Ra + R * n) / Wa) < C){
	n++;
      }
      cout << n << endl;
    }
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else{
      |     ^~~~
Language: C++

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-6;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

const int64 mod = 1e9+7;

int main(void){
	int32 R0, W0, C, R;
	while(cin >> R0 >> W0 >> C >> R && R0+W0+C+R){
		cout << max(0, (C*W0-R0+R-1)/R) << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: no matching function for call to 'max(int, int32)'
   29 |                 cout << max(0, (C*W0-R0+R-1)/R) << endl;
      |                         ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:29:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int32' {aka 'long int'})
   29 |                 cout << max(0, (C*W0-R0+R-1)/R) << endl;
      |                         ~~~^~~~~~~~~~~~~~~~~~~~
/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:
/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:29:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |                 cout << max(0, (C*W0-R0+R-1)/R) << endl;
      |                         ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e,i;
	while(1){
		cin >> a >> b >> c >> d;
		f=0;
		if(a==0 && b ==0 && c==0 && d==0) break;
		for(i=0;i<100;i++){
			e=a/b;
			if(e<c){
				a+=d;
			}else{
				break;
			}
		}
		cout << i << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'f' was not declared in this scope
    7 |                 f=0;
      |                 ^
Language: C++

import Control.Applicative
import Data.List

main = do
    xs <- init . map (map (read :: String -> Double) . words) . lines <$> getContents
    let x = do
        [r0, w0, c, r] <- xs
        return . show . max 0 . ceiling $ (w0*c-r0) / r
    putStrLn . intercalate "\n" $ x


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Applicative
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <stdio.h>
int main(void){
   int w0,R0,R,C,x;
   while(1){
       scanf("%d %d %d %d",&R0,&w0,&C,&R);
       if(R0<1||w0<1||C<1||R<1){
       break;
}
       if(R0<(C*w0)){
           if((C*w0-R0)%R==0){
               x=(C*w0-R0)/R;
           }
           else{
               x=(C*w0-R0)/R+1;
           }
       }
       else{
           x=0;
       }
       printf("%d\n",x);
   }
   return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected '}' at end of input
   22 |    return 0;
      |             ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int main(){
  string s;
  while(cin>>s,s[0]!='#'){
    string t[9];
    int q=0,r=0,a,b,c,d;
    r(i,s.size()){
      if(s[i]=='/')r++,q=0;
      else if(s[i]=='b')t[r]+='b',q++;
      else r(j,s[i]-'0')t[r]+='.',q++;
    }
    cin>>a>>b>>c>>d;
    a--;b--;c--;d--;
    if(t[a][b]=='.')t[a][b]='b',t[c][d]='.';
    else t[a][b]='.',t[c][d]='b';
    r(i,r+1){r(j,q){
      if(t[i][j]=='b')cout<<'b';
      else{
        int p=0;
        for(;j<q;j++,p++)if(t[i][j+1]!='.')break;
        cout<<p+1;
      }
      }
      if(i!=r)cout<<'/';
    }
    cout<<endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:29:4: error: expected '}' at end of input
   29 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>

#define say(args) cout << (args) << endl
#define rep(i, a) for (int i = 0; i < a; i++)

using namespace std;

typedef struct point {
  int x;
  int y;
} Point;

string make_key(int x, int y) {
  char xx = x + '0', yy = y + '0';
  char orig[] = {xx, ',', yy};
  return string(orig, end(orig));
}

void exec(string& jfen) {
  int nums[4];
  rep(i, 4) {
    int n;
    cin >> nums[i];
  }
  Point before = { nums[1] - 1, nums[0] - 1 };
  Point next   = { nums[3] - 1, nums[2] - 1 };

  map<string, int> board;

  int x = 0, y = 0;
  int x_limit;
  for (auto c : jfen) {
    if (c == '/') {
      y += 1;
      x_limit = x;
      x = 0;
    }
    else if (c == 'b') {
      board[ make_key(x, y) ] = 1;
      x += 1;
    }
    else if (c <= '9' && c >= '1') {
      // char to int
      for (int i = 0; i < c - '0'; i++) {
        board[ make_key(x, y) ] = 0;
        x += 1;
      }
    }
  }
  int y_limit = y + 1;

  board[ make_key(before.x, before.y) ] = 0;
  board[ make_key(next.x, next.y) ]     = 1;

  for (int y = 0; y < y_limit; y++) {
    for (int x = 0; x < x_limit; x++) {
      if (board[ make_key(x, y) ] == 1) {
        cout << "b";
      } else {
        int count = 1;
        while (board[ make_key(x + 1, y)] == 0 && x < x_limit - 1) {
          count += 1;
          x += 1;
        }
        cout << count;
      }
    }
    if (y < y_limit - 1) {
      cout << "/";
    }
  }
  puts("");
}

int main() {
  string jfen;
  cin >> jfen;
  while (jfen[0] != '#' && jfen.length() != 1) {
    exec(jfen);
    cin >> jfen;
 

Compiler output:
a.cc: In function 'int main()':
a.cc:87:17: error: expected '}' at end of input
   87 |     cin >> jfen;
      |                 ^
a.cc:85:48: note: to match this '{'
   85 |   while (jfen[0] != '#' && jfen.length() != 1) {
      |                                                ^
a.cc:87:17: error: expected '}' at end of input
   87 |     cin >> jfen;
      |                 ^
a.cc:82:12: note: to match this '{'
   82 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;
typedef long long ll;

int N, X[104], Y[104], CXL, CYL, CXR, CYR;
int w, h;
vector<ll> vx, vy;

int compress(int n, int *p, vector<ll> &s) {
  REP(i, 0, n) s.push_back(p[i]);
  sort(s.begin(), s.end());
  s.erase(unique(s.begin(), s.end()), s.end());
  return s.size();
}

bool isin(int x, int y) {
  return CXL <= x && x <= CXR && CYL <= y && y <= CYR;
}

bool ok(int xl, int yl, int xr, int yr) {
  if(isin(xl, yl) && isin(xr, yr)) return false;
  int x = xl + xr, y = yl + yr;
  int cx = 0, cy = 0;
  REP(i, 0, N) {
    int c = i, n = (i + 1) % N;
    int x1 = 2 * min(X[c], X[n]), x2 = 2 * max(X[c], X[n]);
    int y1 = 2 * min(Y[c], Y[n]), y2 = 2 * max(Y[c], Y[n]);
    if(y1 == y2 && y < y1 && x1 < x && x < x2) cx++;
    if(x1 == x2 && x < x1 && y1 < y && y < y2) cy++;
  }
  return cx % 2 == 1 && cy % 2 == 1;
}

int main(void) {
  while(cin >> N, N) {
    REP(i, 0, N) cin >> X[i] >> Y[i];
    REP(i, 0, 4) cin >> X[N + i] >> Y[N + i];
    CXL = min(X[N], min(X[N + 1], min(X[N + 2], X[N + 3])));
    CYL = min(Y[N], min(Y[N + 1], min(Y[N + 2], Y[N + 3])));
    CXR = max(X[N], max(X[N + 1], max(X[N + 2], X[N + 3])));
    CYR = max(Y[N], max(Y[N + 1], max(Y[N + 2], Y[N + 3])));
    vx.clear();
    vy.clear();
    w = compress(N + 4, X, vx);
    h = compress(N + 4, Y, vy);

    ll ans = 0;
    REP(i, 0, w - 1) REP(j, 0, h - 1) if(ok(vx[i], vy[j], vx[i + 1], vy[j + 1])) ans += (vx[i + 1] - vx[i]) * (vy[j + 1] - vy[j]);
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int compress(int, int*, std::vector<long long int>&)':
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(s.begin(), s.end());
      |   ^~~~
      |   short
a.cc:14:11: error: 'unique' was not declared in this scope
   14 |   s.erase(unique(s.begin(), s.end()), s.end());
      |           ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,j,n) for(int i=(j);i<(n);i++)
using namespace std;

int dp[102][1<<15];
int w[1<<15];

int main(){
  int n,m;
  while(cin>>n>>m,n){
    vector<int> s(n),d(m);
    REP(i,n)cin>>s[i];
    REP(i,m)cin>>d[i];
    sort(s.begin(),s.end());
    sort(d.begin(),d.end());
    REP(bit,i<<n){
      REP(j,n){
        if(bit&(1<<j)){
          w[bit]+=s[j];
        }
      }
    }

    FOR(i,1,m+1){//position at demand
      REP(bit,1<<n){
        dp[i][bit] = min(dp[i][bit],dp[i-1][bit] + abs(w[i]-d[i]));
        REP(k,n){
          if(bit&(1<<k)){
            dp[i][bit] = min(dp[i][bit],dp[i][bit^(1<<k)]);
          }
        }
      }
    }
    int ans = 0;
    REP(i,1<<n){
      ans = min(ans,dp[m][i]);
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'i' was not declared in this scope
   20 |     REP(bit,i<<n){
      |             ^
a.cc:5:33: note: in definition of macro 'REP'
    5 | #define REP(i,n) for(int i=0;i<(n);i++)
      |                                 ^
Language: C++

#include<iostream>
#include<climits>
#include<bitset>

using namespace std;

int n,m;
long long s[16], d[101];

int main(){
    while(cin >> n >> m && n){
        for(int i=0;i<n;i++) cin >> s[i];
        d[0] = 0LL;
        for(int i=1;i<=m;i++) cin >> d[i];
        sort(d, d+m+1);

        long long sigma[1<<n];
        sigma[0] = 0LL;
        for(int j=0;j<(1<<n);j++){
            for(int k=0;k<n;k++){
                if(j & (1 << k)) continue;
                sigma[j|(1<<k)] = sigma[j] + s[k];
            }
        }

        long long dp[m+1][1<<n];
        fill(dp[0], dp[m+1], 1e8);
        for(int j=0;j<(1<<n);j++) dp[0][j] = 0LL;
        for(int i=1;i<=m;i++) dp[i][0] = dp[i-1][0] + d[i];
        for(int i=1;i<=m;i++) cerr << i << " " << bitset<2>(0) << ": " << dp[i][0] << endl;
        for(int i=1;i<=m;i++){
            for(int j=0;j<(1<<n);j++){
                for(int k=0;k<n;k++){
                    if(j & (1 << k)) continue;
                    dp[i][j|(1<<k)] = min(dp[i][j], dp[i-1][j|(1<<k)] + abs(sigma[j|(1<<k)] - d[i]));
                }
                cerr << i << " " << bitset<2>(j) << ": " << dp[i][j] << endl;
            }
        }

        cout << dp[m][(1<<n)-1] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |         sort(d, d+m+1);
      |         ^~~~
      |         short
Language: C++

以外の点数を適当に配置
            ll add = combination_duplicate(S, free_pt);

            // 引き分けの位置
            (add *= combination_array(S, C)) %= MOD;

            // 勝ちの位置
            (add *= combination_array(A+B, A)) %= MOD;

            // P, Q の計算 (それぞれ A 以上・B 以上でなければならない)
            int P = X - free_pt, Q = Y - free_pt;

            if(P < A || Q < B) continue;
            if(A == 0 && P > 0) continue;
            if(B == 0 && Q > 0) continue;
            P -= A, Q -= B;
            if(A > 0) (add *= combination_duplicate(A, P)) %= MOD;
            if(B > 0) (add *= combination_duplicate(B, Q)) %= MOD;

            (ans += add) %= MOD;
            // printf("D = %d, add = %lld\n", D, add);
        }
        printf("%lld\n", ans);
    }
    return 0;
}



Compiler output:
a.cc:1:1: error: '\U00004ee5\U00005916\U0000306e\U000070b9\U00006570\U00003092\U00009069\U00005f53\U0000306b\U0000914d\U00007f6e' does not name a type
    1 | 以外の点数を適当に配置
      | ^~~~~~~~~~~~~~~~~~~~~~
a.cc:5:17: error: expected ')' before '*=' token
    5 |             (add *= combination_array(S, C)) %= MOD;
      |             ~   ^~~
      |                 )
a.cc:8:17: error: expected ')' before '*=' token
    8 |             (add *= combination_array(A+B, A)) %= MOD;
      |             ~   ^~~
      |                 )
a.cc:11:21: error: 'X' was not declared in this scope
   11 |             int P = X - free_pt, Q = Y - free_pt;
      |                     ^
a.cc:11:25: error: 'free_pt' was not declared in this scope
   11 |             int P = X - free_pt, Q = Y - free_pt;
      |                         ^~~~~~~
a.cc:13:13: error: expected unqualified-id before 'if'
   13 |             if(P < A || Q < B) continue;
      |             ^~
a.cc:14:13: error: expected unqualified-id before 'if'
   14 |             if(A == 0 && P > 0) continue;
      |             ^~
a.cc:15:13: error: expected unqualified-id before 'if'
   15 |             if(B == 0 && Q > 0) continue;
      |             ^~
a.cc:16:13: error: 'P' does not name a type
   16 |             P -= A, Q -= B;
      |             ^
a.cc:17:13: error: expected unqualified-id before 'if'
   17 |             if(A > 0) (add *= combination_duplicate(A, P)) %= MOD;
      |             ^~
a.cc:18:13: error: expected unqualified-id before 'if'
   18 |             if(B > 0) (add *= combination_duplicate(B, Q)) %= MOD;
      |             ^~
a.cc:20:17: error: expected ')' before '+=' token
   20 |             (ans += add) %= MOD;
      |             ~   ^~~
      |                 )
a.cc:22:9: error: expected declaration before '}' token
   22 |         }
      |         ^
a.cc:23:15: error: expected constructor, destructor, or type conversion before '(' token
   23 |         printf("%lld\n", ans);
      |               ^
a.cc:24:5: error: expected declaration before '}' token
   24 |     }
      |     ^
a.cc:25:5: error: expected unqualified-id before 'return'
   25 |     return 0;
      |     ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C

t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      |   ^~~~
main.c: In function 'main':
main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      |                         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      |                         ^~~~~
main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:47: error: expected ')' before ';' token
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      |                        ~                      ^
      |                                               )
main.c:1:54: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | t;main(long long n){for(scanf("%lld",&n);n;t++;)n/=2;printf("%d\n",t);}
      |                                                      ^~~~~~
main.c:1:54: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:54: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:54: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

#define FOR(i,s,t )for(int i = s; i <t ; i++)
using LL = long long; using ll = LL;
using PLL = pair<LL, LL>; using  pll = PLL;
using PII = pair<int, int>; using  pii = PII;
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))



int main() {
	LL n;
	cin >> n;
	LL i = 1;
	int cnt = 0;
	while (i<=n)	{
		i <<= 1;
		cnt++;
	}
	cout << cnt << endl;

	return 0;
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

include<bits/stdc++.h>

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

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;

void compute(ll n,int e){
  ll remain = n;
  int cnt = 0;
  while( remain && cnt+1 < e ) {
      remain /= 2;
      ++cnt;
  }
  if( remain ) {
    if( remain+(ll)cnt <= 50LL ) {
      cnt = cnt + (int)remain;
    } else {
      cnt = 50;
    }
  }
  cnt = min(cnt,50);

  cout << cnt << endl;
}

int main(){
  // ll n ;
  // cin >> n;
  // if( n == 0 ) cout << 0 << endl;
  // else {
  //   int cnt = 0;
  //   while( n ){
  //     n >>= 1;
  //     ++cnt;
  //   }
  //   cout << cnt << endl;
  // } return 0;
  int n,m;
  cin >> n >> m;

    rep(i,(int)(n/2)+1) cout << "0 ";
    rep(i,n-((int)(n/2)+1)) {
      if( i ) cout << ' ';
      cout << m;
    } puts("");

  return 0;
  int T;
  cin >> T;
  while( T-- ) {
    ll N;
    int E;
    cin >> N >> E;
    compute(N,E);
  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:9:18: error: 'INT_MAX' was not declared in this scope
    9 | const int IINF = INT_MAX;
      |                  ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | include<bits/stdc++.h>
a.cc: In function 'void compute(ll, int)':
a.cc:25:9: error: 'min' was not declared in this scope
   25 |   cnt = min(cnt,50);
      |         ^~~
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << cnt << endl;
      |   ^~~~
a.cc:27:18: error: 'endl' was not declared in this scope
   27 |   cout << cnt << endl;
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:43:3: error: 'cin' was not declared in this scope
   43 |   cin >> n >> m;
      |   ^~~
a.cc:45:25: error: 'cout' was not declared in this scope
   45 |     rep(i,(int)(n/2)+1) cout << "0 ";
      |                         ^~~~
a.cc:47:15: error: 'cout' was not declared in this scope
   47 |       if( i ) cout << ' ';
      |               ^~~~
a.cc:48:7: error: 'cout' was not declared in this scope
   48 |       cout << m;
      |       ^~~~
a.cc:49:7: error: 'puts' was not declared in this scope
   49 |     } puts("");
      |       ^~~~
Language: C++

nclude<bits/stdc++.h>

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

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;

void compute(ll n,int e){
  ll remain = n;
  int cnt = 0;
  while( remain && cnt+1 < e ) {
      remain /= 2;
      ++cnt;
  }
  if( remain ) {
    if( remain+(ll)cnt <= 50LL ) {
      cnt = cnt + (int)remain;
    } else {
      cnt = 50;
    }
  }
  cnt = min(cnt,50);

  cout << cnt << endl;
}

int main(){
  // ll n ;
  // cin >> n;
  // if( n == 0 ) cout << 0 << endl;
  // else {
  //   int cnt = 0;
  //   while( n ){
  //     n >>= 1;
  //     ++cnt;
  //   }
  //   cout << cnt << endl;
  // } return 0;
  int n,m;
  cin >> n >> m;

    rep(i,(int)(n/2)+1) cout << "0 ";
    rep(i,n-((int)(n/2)+1)) {
      if( i ) cout << ' ';
      cout << m;
    } puts("");

  return 0;
  int T;
  cin >> T;
  while( T-- ) {
    ll N;
    int E;
    cin >> N >> E;
    compute(N,E);
  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<bits/stdc++.h>
      | ^~~~~~
a.cc:9:18: error: 'INT_MAX' was not declared in this scope
    9 | const int IINF = INT_MAX;
      |                  ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | nclude<bits/stdc++.h>
a.cc: In function 'void compute(ll, int)':
a.cc:25:9: error: 'min' was not declared in this scope
   25 |   cnt = min(cnt,50);
      |         ^~~
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << cnt << endl;
      |   ^~~~
a.cc:27:18: error: 'endl' was not declared in this scope
   27 |   cout << cnt << endl;
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:43:3: error: 'cin' was not declared in this scope
   43 |   cin >> n >> m;
      |   ^~~
a.cc:45:25: error: 'cout' was not declared in this scope
   45 |     rep(i,(int)(n/2)+1) cout << "0 ";
      |                         ^~~~
a.cc:47:15: error: 'cout' was not declared in this scope
   47 |       if( i ) cout << ' ';
      |               ^~~~
a.cc:48:7: error: 'cout' was not declared in this scope
   48 |       cout << m;
      |       ^~~~
a.cc:49:7: error: 'puts' was not declared in this scope
   49 |     } puts("");
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
	cin >> n >> m;
	int l = (n - 1) / 2;
	for(int i = 0; i < l; i++) printf(i ? "%d" : " %d", 0);
	for(int i = l; i < n; i++) printf(i : "%d" : " %d", m);
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:44: error: expected ')' before ':' token
    8 |         for(int i = l; i < n; i++) printf(i : "%d" : " %d", m);
      |                                          ~ ^~
      |                                            )
a.cc:8:43: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    8 |         for(int i = l; i < n; i++) printf(i : "%d" : " %d", m);
      |                                           ^
      |                                           |
      |                                           int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
for(int i=0;i<a;i++){
      if(i)cout<<' ';
      if(i<n/2)cout<<0;
      else cout<<b;
}cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'n' was not declared in this scope
    8 |       if(i<n/2)cout<<0;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
for(int i=0;i<a;i++){
      if(i)cout<<' ';
      if(I<a/2)cout<<0;
      else cout<<b;
}cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'I' was not declared in this scope
    8 |       if(I<a/2)cout<<0;
      |          ^
Language: C++

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


typedef long long ll;
using namespace std;

#define mod 1000000007
#define INF 1000000000 //(int)1e9
#define LLINF 8000000000000000000 //(ll)2e18
#define PI  3.1415926536

#define SIZE 510

int gcd(int a,int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}

int main(){
    int t;
    int h,w;
    
    scanf("%d",&t);
    
    for(int i=0;i<t;i++){
        int a=0,b=0;
        
        scanf("%d%d",&h,&w);
        
        if(h==w){
            printf("1 0");
        }else if(h%2==0 || w%2==0){
            puts("1 1");
        }else{
            assert()
            a = max(h,w)/2+1;
            b = max(h,w)/2;
            
            a/=gcd(a,b);
            b/=gcd(a,b);
            
            printf("%d %d\n",a,b);
        }
    }
    
}

Compiler output:
In file included from /usr/include/c++/14/cassert:44,
                 from a.cc:13:
a.cc: In function 'int main()':
a.cc:48:13: error: expected primary-expression before ')' token
   48 |             assert()
      |             ^~~~~~
Language: C++

include<bits/stdc++.h>

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

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;

void compute(ll n,int e){
  ll remain = n;
  int cnt = 0;
  while( remain && cnt+1 < e ) {
    remain /= 2;
    ++cnt;
  }
  if( remain ) {
    if( remain+(ll)cnt <= 50LL ) {
      cnt = cnt + (int)remain;
    }
  }
  cnt = min(cnt,50);

  cout << cnt << endl;
}

int main(){
  int T;
  cin >> T;
  while( T-- ) {
    ll N;
    int E;
    cin >> N >> E;
    compute(N,E);
  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:9:18: error: 'INT_MAX' was not declared in this scope
    9 | const int IINF = INT_MAX;
      |                  ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | include<bits/stdc++.h>
a.cc: In function 'void compute(ll, int)':
a.cc:23:9: error: 'min' was not declared in this scope
   23 |   cnt = min(cnt,50);
      |         ^~~
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << cnt << endl;
      |   ^~~~
a.cc:25:18: error: 'endl' was not declared in this scope
   25 |   cout << cnt << endl;
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:30:3: error: 'cin' was not declared in this scope
   30 |   cin >> T;
      |   ^~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#include <windows.h>
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
bool test = 0;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
#define MAX (int)1e6 + 5

signed main(void) {
	int i, j, k, l;
	int K;
	string m[2][100];
	cin >> K;
	rep(i, K) cin >> m[0][i];
	rep(i, K) cin >> m[1][i];
	int pow[2] = {};
	bool win[2] = {};
	string kougekida = "kougekida";
	string mamoru = "mamoru";
	string tameru = "tameru";
	rep(i, K) {
		if (m[0][i] == kougekida) {
			if (m[1][i] == kougekida) {
				if (pow[0] == 0 && pow[1] == 0) continue;
			}
		}
		if (m[0][i] == kougekida) {
			if (pow[0] == 0) {
				win[1] = true;
				break;
			}
		}
		if (m[1][i] == kougekida) {
			if (pow[1] == 0) {
				win[0] = true;
				break;
			}
		}
		if (m[0][i] == kougekida) {
			if (m[!0][i] == kougekida) {
				if (pow[0] > pow[!0]) {
					win[0] = true;
					break;
				}
				else if (pow[0] < pow[!0]) {
					win[!0] = true;
					break;
				}
				pow[0] = pow[!0] = 0;
			}
		}

		rep(j, 2) {
			if (m[j][i] == kougekida) {
				if (m[!j][i] == mamoru) {
					if (pow[j] == 5) {
						win[j] = true;
						break;
					}
					else {
						pow[j] = 0;
					}
				}
				if (m[!j][i] == tameru) {
					win[j] = true;
					break;
				}

			}
		}

		rep(j, 2) {
			if (m[j][i] == tameru) {
				if (pow[j] == 5) continue;
				else {
					pow[j]++;
				}
			}
		}
		if (test) {
			dump(pow[0]);
			dump(pow[1]);
		}
	}
	if (win[0]) puts("Isono-kun");
	else if (win[1]) puts("Nakajima-kun");
	else puts("Hikiwake-kun");
	return 0;
}

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

L0, R0 = input().split()
L0 = int(L0)
R0 = int(R0)
L1, R1 = input().split()
L1 = int(L1)
R1 = int(R1)


def swap(a,b):#b = max
    if (a > b):
        tmp = a
        a = b
        b = tmp
    return a,b

p = 1
while max(L0,R0)!=0 and max(L1,R1)!=0:
    L0,R0 = swap(L0,R0) #attacker
    L1,R1 = swap(L1,R1) 
    atackmax = R0
    if atackmax + L1 >= 5:
        L1 = 0
    elif atackmax + R1 >= 5:
        R1 = 0
    else:
        if L0 != 0:
            if L1 != 0:
                L1 = L1 + L0
            else:
                R1 = R1 + L0
        else:
            if L1 != 0:
                L1 = L1 + R0
            else:
                R1 = R1 + R0
#    print(L0,R0)
#    print(L1,R1)
    if max(L1,R1) == 0:
        if (p == 1):
            print("ISONO")
        else:
            print("NAKAJIMA")
        break

    t0 = L0    
    t1 = R0    
    L0 = L1
    R0 = R1
    L1 = t0
    R1 = t1
    p *= -1




Compiler output:
a.cc:9:15: error: stray '#' in program
    9 | def swap(a,b):#b = max
      |               ^
a.cc:18:25: error: stray '#' in program
   18 |     L0,R0 = swap(L0,R0) #attacker
      |                         ^
a.cc:36:6: error: invalid preprocessing directive #print
   36 | #    print(L0,R0)
      |      ^~~~~
a.cc:37:6: error: invalid preprocessing directive #print
   37 | #    print(L1,R1)
      |      ^~~~~
a.cc:1:1: error: 'L0' does not name a type
    1 | L0, R0 = input().split()
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,aa,b,bb,c=0;
  cin>>a>>aa>>b>>bb;
cout<<"ISONO"<<endl;
  else cout<<"NAKAJIMA"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'else' without a previous 'if'
    7 |   else cout<<"NAKAJIMA"<<endl;
      |   ^~~~
Language: C

har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}

Compiler output:
main.c:1:1: error: unknown type name 'har'; did you mean 'char'?
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      | ^~~
      | char
main.c:1:14: warning: data definition has no type or storage class
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |              ^
main.c:1:14: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:23: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                       ^
main.c:1:25: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                         ^
main.c:1:27: error: return type defaults to 'int' [-Wimplicit-int]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                           ^~~~
main.c: In function 'main':
main.c:1:38: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                                      ^~~~
main.c:1:93: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                                                                                             ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
main.c:1:93: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    1 | har s[1<<20];m[1<<20],n,t;main(){for(gets(s);s[n];m[++n]=--t)for(;t&&s[~t]-s[n];t=m[~t]);n=!printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",(t-=~n)+n/3/t*t,s);}
      |                                                                                             ^~~~~~
main.c:1:93: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

char s[1<<20];m[1<<20],n;main(t){t=--*m;for(gets(s);s[n];m[++n]=++t)for(;~t&&s[t]-s[n];t=m[t]);t=n-t;printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",t*=n/3/t+1,s);}

Compiler output:
a.cc:1:15: error: 'm' does not name a type
    1 | char s[1<<20];m[1<<20],n;main(t){t=--*m;for(gets(s);s[n];m[++n]=++t)for(;~t&&s[t]-s[n];t=m[t]);t=n-t;printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",t*=n/3/t+1,s);}
      |               ^
a.cc:1:30: error: expected constructor, destructor, or type conversion before '(' token
    1 | char s[1<<20];m[1<<20],n;main(t){t=--*m;for(gets(s);s[n];m[++n]=++t)for(;~t&&s[t]-s[n];t=m[t]);t=n-t;printf(t*2<n?"Love %.*s!\n":"mitomerarenaiWA\n",t*=n/3/t+1,s);}
      |                              ^
Language: C++

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

void z_algorithm(string& S,vector<int>& res)
{
    int sz = (int)S.size();
    res.resize(sz);
    int c = 0;
    for(int i = 1; i < sz; i++){
        if(i+res[i-c] < c+res[c]){
            res[i] = res[i-c];
        }else{
            int j = max(0, c+res[c]-i);
            while (i+j < sz && S[j] == S[i+j]) ++j;
            res[i] = j;
        }
    }
    res[0] = sz;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    if(n>500000){
        cout << "MURI" << endl
        return 0;
    }
    vector<int> a,b;
    z_algorithm(s,a);
    reverse(s.begin(),s.end());
    z_algorithm(s,b);
    int ma = -1;
    for(int i=n/3-2;i<n/2+2;i++){
        if(i<=0||i>=n)continue;
        int tmp = n-2*i;
        if(a[i]==n-i&&b[i]==n-i&&tmp>0&&(n-3*(tmp))/2>0){
            ma = max(ma,tmp);
        }
    }
    // for(int i=0;i<n;i++){
    //     cout << a[i] << " ";
    // }
    // cout << endl;
    // for(int i=0;i<n;i++){
    //     cout << b[i] << " ";
    // }
    // cout << endl;
    
    if(ma==-1){
        cout << "mitomerarenaiWA" << endl;
    }else{
        int x = ma;
        int y = (n-3*ma)/2;
        printf("Love ");
        for(int i=0;i<x+y;i++){
            printf("%c",s[n-i-1]);
        }
        printf("!\n");
    }
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:32:31: error: expected ';' before 'return'
   32 |         cout << "MURI" << endl
      |                               ^
      |                               ;
   33 |         return 0;
      |         ~~~~~~
Language: C++

#include <stdafx.h>
#include <iostream>


using namespace std;

int main() {

	int L, N, i, j, k, weight = 0;

	cin >> L >> N;

	int x[5000], w[5000], xx[5000], ww[5000];

	for (i = 0; i < N; i++) {
		cin >> x[i] >> w[i];
		weight = weight + x[i] * w[i];
	}

	j = 0;

	for (i = L * -1; i <= L; i++) {
		if (i == 0)
			i++;

		ww[j] = weight / i;

		if (ww[j] != 0) {
			xx[j] = i;
			j++;
			weight = weight % i;
			if (weight == 0)
				k = 1;
		}
		if (k == 1)
			break;
	}

	for (i = 0; i < j; i++)
		cout << xx[i] <<" " << ww[i] << "\n";

	rewind(stdin);
	k = getchar();

	return 0;
}

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

int main() {

	int L, N, i, j, k, l = 0, weight = 0;

	cin >> L >> N;

	int x[5000], w[5000], xx[5000], ww[5000];

	for (i = 0; i < N; i++) {
		cin >> x[i] >> w[i];
		weight = weight + x[i] * w[i];
	}

	j = 0;

	if (weight > 0) {
		l = L * -1;
	}
	if (weight < 0) {
		weight = weight * -1;
	}

	for (i = l; i <= L; i++) {
		if (i == 0)
			i++;

		ww[j] = weight / i;

		if (ww[j] != 0) {
			xx[j] = i;
			j++;
			weight = weight % i;
			if (weight == 0)
				k = 1;
		}
		if (k == 1) {
			break;
		}
		
			cout << 0;
			return 0;
		
	}

	cout << j - 1 << "\n";
	for (i = 0; i < j; i++)
		cout << xx[i] <<" " << ww[i] << "\n";

	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> L >> N;
      |         ^~~
a.cc:40:25: error: 'cout' was not declared in this scope
   40 |                         cout << 0;
      |                         ^~~~
a.cc:45:9: error: 'cout' was not declared in this scope
   45 |         cout << j - 1 << "\n";
      |         ^~~~