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

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

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;}

int N,M,A,B,P,Q;

void dfs(int k,int n,int s,vint &v,vint &latte){
    if(k==n){
        latte.pb(s);
        return;
    }
    dfs(k+1,n,s,v,latte);
    dfs(k+1,n,s+v[k],v,latte);
}

signed main(){
    cin>>N>>M>>A>>B>>P>>Q;

    if(A==1&&B==1){
        P+=Q;
        int ans=M;
        if(M/P>N)chmin(ans,abs(M-P*N));
        else{
            chmin(ans,abs(M-M/P*P));
            if(M/P+1<=N)chmin(ans,abs(M-M/P*P-P));
        }
        cout<<ans<<endl;
        return 0;
    }
    vector<int>v;
    int x=P,y=Q;
    for(int i=0;i<N;i++){
        v.pb(x+y);
        if(1.0*x*A>||1.0*y*B>1e15||x+y>M)break;
        x*=A;y*=B;
    }

    int n=v.size()/2;
    vint latte,malta;
    dfs(0,n,0,v,latte);
    dfs(n,v.size(),0,v,malta);
    sort(all(latte));
    sort(all(malta));


    int ans=M;

    int cur=latte.size()-1;
    for(int i=0;i<malta.size();i++){
        while(cur&&latte[cur]+malta[i]>M)cur--;
        chmin(ans,abs(M-latte[cur]-malta[i]));
    }

    cur=0;
    for(int i=(int)malta.size()-1;i>=0;i--){
        while(cur+1!=latte.size()&&latte[cur]+malta[i]<M)cur++;
        chmin(ans,abs(M-latte[cur]-malta[i]));
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:47:20: error: expected primary-expression before '||' token
   47 |         if(1.0*x*A>||1.0*y*B>1e15||x+y>M)break;
      |                    ^~
Language: C++

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

ll mul(ll a,ll b){
  if(a>INF/b)return INF;
  return a*b;
}

ll n,m,a,b,p,q;

void dfs(ll x,ll sum,vector<ll> &t,vector<ll> &T){
  if(x==(int)t.size()){
    T.push_back(sum);
  }else{
    dfs(x+1,sum,t,T);
    dfs(x+1,min(INF,sum+t[x]),t,T);
  }
}

ll solve(){
  ll MAX=1000000000000LL;
  
  assert( 1<= n &&n <= MAX );
  assert( 1<= m &&m <= MAX );
  assert( 1<= a &&a <= MAX );
  assert( 1<= b &&b <= MAX );
  assert( 1<= p &&p <= MAX );
  assert( 1<= q &&q <= MAX );
  
  if(a==1 && b==1){
    ll d=p+q;
    ll total=mul(d,n);
    //    if(total <= m)return m-total;
    return m%d);
    
  }
  
  vector<ll> t, u;
  ll ak=1,bk=1;


  for(int i=0;i<n;i++){
    if(i&1)t.push_back( mul(ak,p) + mul(bk,q) );
    else   u.push_back( mul(ak,p) + mul(bk,q) );
    ak=mul(ak,a);
    bk=mul(bk,b);
    if( i==40 )break;
  }
  
  vector<ll> T,U;
  dfs(0,0,t,T);
  dfs(0,0,u,U);
    
  sort(T.begin(),T.end());
  sort(U.begin(),U.end());
  
  ll res=m;
  for(int i=0;i<(int)T.size();i++){
    ll target=m-T[i];
    int index=lower_bound(U.begin(),U.end(),target)-U.begin();
    for(int j=index-2;j<=index+2;j++){
      if(0<=j && j<(int)U.size()){
        ll c=T[i]+U[j];
        res=min( res,  abs(m-c) );      
      }
    }
  }
  return res;
}

int main(){
  cin>>n>>m>>a>>b>>p>>q;
  cout<<solve()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'll solve()':
a.cc:36:15: error: expected ';' before ')' token
   36 |     return m%d);
      |               ^
      |               ;
a.cc:36:15: error: expected primary-expression before ')' token
Language: C++

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>   
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(ll i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	ll n,m,a,b,p,q;
	cin>>n>>m>>a>>b>>p>>q;
	if(a+b==2){
		ll t=p+q;
		ll T=min(n,m/t);
		ll out=m;
		loop(i,max(0ll,T-10),min(n+1,T+10))
			out=min(out,abs(t*i-m));
		cout<<out<<endl;
		return 0;
	}
	vi A,B;
	ll t=p;
	int co=0;
	while(1){
		A.pb(t);
		if(to_string(t).size()+to_string(a).size()>16)break;
		t*=a;
		if(a==1&&co==40)break;
		co++;
	}
	t=q;
	co=0;
	while(1){
		B.pb(t);
		if(to_string(t).size()+to_string(b).size()>16)break;
		t*=b;
		if(b==1&&co==40)break;
		co++;
	}
	//show1d(A);
	//show1d(B);
	vi in;
	rep(i,min((ll)A.size(),n))
		if(i<B.size()&&A[i]+B[i]<=3*m)in.pb(A[i]+B[i]);
	n=in.size()/2;
	ll N=1<<n;
	vi dp;
	rep(i,N){
		ll sum=0;
		rep(j,n)if(i&1<<j)sum+=in[j];
		if(sum<=3*m)dp.pb(sum);
	}
	sort(all(dp));
	ll nn=in.size()-n;
	N=1<<nn;
	ll out=m;
//	show1d(in);
	rep(i,N){
		ll sum=0;
		rep(j,nn)if(i&1<<j)sum+=in[n+j];
		if(sum>3*m)continue;
		auto it=upper_bound(all(dp),m-sum);
		if(it!=dp.end())out=min(out,abs(*it+sum-m));
		if(it==dp.begin())continue;
		it--;
		out=min(out,abs(*it+sum-m));
	}
//	show1d(dp);
	cout<<out<<endl;
}













0


Compiler output:
a.cc:131:1: error: expected unqualified-id before numeric constant
  131 | 0
      | ^
Language: C++

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

typedef long long ll;
typedef pair<int, int> i_i;
int MOD = 1000000007;

int main() {
	int n; cin >> n;
	vector<vector<int> > a(n, vector<int>(6, INT_MIN));
	vector<vector<i_i> > p(6, vector<i_i>(n));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 6; j++) {
			int x, y; scanf("%d%d", &x, &y);
			a[i][0] = max(a[i][0], x);
			a[i][1] = max(a[i][1], -x);
			a[i][2] = max(a[i][2], y);
			a[i][3] = max(a[i][3], -y);
			a[i][4] = max(a[i][4], x + y);
			a[i][5] = max(a[i][5], -(x + y));
		}
		for (int k = 0; k < 6; k++)
			p[k][i] = i_i(a[i][k], i);
	}
	for (int k = 0; k < 6; k++) {
		sort(p[k].begin(), p[k].end());
		reverse(p[k].begin(), p[k].end());
	}
	vector<int> index(6), cnt(n);
	queue<int> q;
	vector<int> b(6);
	for (;;) {
		cout << 'a' << endl;
		for (int k = 0; k < 6; k++)
			for (int& i = index[k]; i < n && -p[k][i].first <= b[k ^ 1]; i++) {
				int j = p[k][i].second;
				if (++cnt[j] == 6) q.push(j);
			}
		if (q.empty()) break;
		int i = q.front(); q.pop();
		for (int k = 0; k < 6; k++)
			b[k] = max(b[k], a[i][k] + 1);
	}
	int k; cin >> k;
	while (k--) {
		int x, y; cin >> x >> y;
		if (x <= b[0] && -x <= b[1] && y <= b[2] && -y <= b[3] && x + y <= b[4] && -(x + y) <= b[5])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:50: error: 'INT_MIN' was not declared in this scope
   15 |         vector<vector<int> > a(n, vector<int>(6, INT_MIN));
      |                                                  ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <set>
  +++ |+#include <climits>
    5 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
typedef pair<int,int> P;
int n,u,v,m,a[500][500],b[500][500];
P x[1000001],y[1000001];
int ar[500],ac[500],br[500],bc[500],a1,a2,b1,b2,xx,yy;
void inc(int &s,int r){
	s++;
	if(s==n){
		if(r==1) xx++;
		else yy++;
	}
}
int main(){
	cin>>n>>u>>v>>m;
	if(n==1){
		int o,s;
		cin>>o>>s;
		rep(i,m){
			int c;
			cin>>c;
			if(o==c&&s==c){
				puts("DRAW");
				return 0;
			}
			if(o==c){
				puts("USAGI");
				return 0;
			}
			if(s==c){
				puts("NEKO");
			}
		}
		puts("DRAW");
		retrun 0;
	}
	rep(i,1000001){
		x[i]=y[i]=P(-1,-1);
	}
	rep(i,n) rep(j,n){
		cin>>a[i][j];
		x[a[i][j]]=P(i,j);
	}
	rep(i,n) rep(j,n){
		cin>>b[i][j];
		y[b[i][j]]=P(i,j);
	}
	rep(i,m){
		int c;
		cin>>c;
		if(x[c].fs>=0){
			int X=x[c].fs,Y=x[c].sc;
			inc(ar[X],1);
			inc(ac[Y],1);
			if(X==Y) inc(a1,1);
			if(X+Y==n-1) inc(a2,1);
		}
		if(y[c].fs>=0){
			int X=y[c].fs,Y=y[c].sc;
			inc(br[X],2);
			inc(bc[Y],2);
			if(X==Y) inc(b1,2);
			if(X+Y==n-1) inc(b2,2);
		}
		if(xx>=u&&yy>=v){
			puts("DRAW");
			return 0;
		}
		if(xx>=u){
			puts("USAGI");
			return 0;
		}
		if(yy>=v){
			puts("NEKO");
			return 0;
		}
	}
	puts("DRAW");
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);++i)
#define rep(i,n) REP(i, 0, n)
typedef long long int i64;
typedef pair<int, int> pint;

map<int, pint> usam, nekom;
int usum[2][501], nsum[2][501];
int m[100000];
int main() {
    int N, U, V, M;
    scanf("%d%d%d%d", &N, &U, &V, &M);
    int num;
    rep(i, N) rep(j, N) {
        scanf("%d", &num);
        usam[num] = pint(j, i);
        memo[num] = 1;
    }
    rep(i, N) rep(j, N) {
        scanf("%d", &num);
        nekom[num] = pint(j, i);
        memo[num] = 1;
    }
    rep(i, M) scanf("%d", m + i);
    rep(i, M) {
        if(usam.count(m[i])) {
            usum[0][usam[m[i]].first]++;
            usum[1][usam[m[i]].second]++;
            if(usam[m[i]].first == usam[m[i]].second) usum[0][N]++;
            if(usam[m[i]].first == N - 1 - usam[m[i]].second) usum[1][N]++;
        }
        if(nekom.count(m[i])) {
            nsum[0][nekom[m[i]].first]++;
            nsum[1][nekom[m[i]].second]++;
            if(nekom[m[i]].first == nekom[m[i]].second) nsum[0][N]++;
            if(nekom[m[i]].first == N - 1 - nekom[m[i]].second) nsum[1][N]++;
        }
        int un = 0, vn = 0;
        rep(i, 2) rep(j, N + 1) if(usum[i][j] == N) un++;
        rep(i, 2) rep(j, N + 1) if(nsum[i][j] == N) vn++;
        if(N == 1) un = min(un, 1), vn = min(vn, 1);
        if(un >= U && vn >= V) break;
        else if(un >= U) goto USA;
        else if(vn >= V) goto NEKO;
    }
    puts("DRAW");
    return 0;;
  USA: puts("USAGI");
    return 0;
  NEKO: puts("NEKO");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'memo' was not declared in this scope
   19 |         memo[num] = 1;
      |         ^~~~
a.cc:24:9: error: 'memo' was not declared in this scope
   24 |         memo[num] = 1;
      |         ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int U[500][500];
int N[500][500];
int n, u, v, m;

string judge(){
  int a = 0, b = 0;
  bool f, g;
  for(int i = 0; i < n; ++i){
    f = true, g = true;
    for(int j = 0; j < n; ++j){
      if(U[i][j]) f = false;
      if(U[j][i]) g = false;
    }
    if(f) ++a;
    if(g) ++a;
  }
  f = true;
  g = true;
  for(int i = 0; i < n; ++i){
    if(U[i][i]) f = false;
    if(U[n-1-i][i]) g = false;
  }
  if(f) ++a;
  if(g) ++a;

  for(int i = 0; i < n; ++i){
    f = true, g = true;
    for(int j = 0; j < n; ++j){
      if(N[i][j]) f = false;
      if(N[j][i]) g = false;
    }
    if(f) ++b;
    if(g) ++b;
  }
  f = true;
  g = true;
  for(int i = 0; i < n; ++i){
    if(N[i][i]) f = false;
    if(N[n-1-i][i]) g = false;
  }
  if(f) ++b;
  if(g) ++b;

  if(a >= u && b >= v) return "DRAW";
  if(a >= u) return "USAGI";
  if(b >= v) return "NEKO";
  return "";
}

int mainn(){

  cin >> n >> u >> v >> m;
  for(int i = 0; i < n; ++i)
    for(int j = 0; j < n; ++j)
      cin >> U[i][j];
  for(int i = 0; i < n; ++i)
    for(int j = 0; j < n; ++j)
      cin >> N[i][j];

  int T[m];
  for(int i = 0; i < m; ++i) cin >> T[i];
  for(int i = 0; i < m; ++i){
    int t = T[i];
    for(int j = 0; j < n; ++j){
      for(int k = 0; k < n; ++k){
	if(U[j][k] == t) U[j][k] = 0;
	if(N[j][k] == t) N[j][k] = 0;
      }
    }
    string ans = judge();
    if(ans != ""){
      cout << ans << endl;
      return 0;
    }
  }
  cout << "DRAW" << endl;
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;i++)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;i++)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

#define int ll

main()
{
  int n,u,v,m; cin >> n >> u >> v >> m;
  map<int,pii> usamap,nekomap;
  rep(i,n) rep(j,n){
    int a; cin >> a;
    usamap[a] = pii(i,j);
  }
  rep(i,n) rep(j,n){
    int a; cin >> a;
    nekomap[a] = pii(i,j);
  }
  if(n > 1){
    vi usatate(n),usayoko(n),nekotate(n),nekoyoko(n);
    int usaright = 0, usaleft = 0, nekoright = 0, nekoleft = 0;
    int x = 0, y = 0;
    rep(i,m){
      int a; cin >> a;
      auto usa = usamap.find(a), neko = nekomap.find(a);
      if(usa != usamap.end()){
	usatate[usa->snd.fst]++;
	usayoko[usa->snd.snd]++;
	if(usa->snd.fst == usa->snd.snd){
	  usaleft++;
	  if(usaleft == n) x++;
	}
	if(usa->snd.fst + usa->snd.snd == n-1){
	  usaright++;
	  if(usaright == n) x++;
	}
	if(usatate[usa->snd.fst] == n) x++;
	if(usayoko[usa->snd.snd] == n) x++;
      }
      if(neko != nekomap.end()){
	nekotate[neko->snd.fst]++;
	nekoyoko[neko->snd.snd]++;
	if(neko->snd.fst == neko->snd.snd){
	  nekoleft++;
	  if(nekoleft == n) y++;
	}
	if(neko->snd.fst + neko->snd.snd == n-1){
	  nekoright++;
	  if(nekoright == n) y++;
	}
	if(nekotate[neko->snd.fst] == n) y++;
	if(nekotate[neko->snd.fst] == n) y++;
      }
      if(x >= u and y >= v) cout << "DRAW\n";
      else if(x >= u) cout << "USAGI\n";
      else if(y >= v) cout << "NEKO\n";
      if(x >= u or y >= v) return 0;
    }
  }else{
    rep(i,m){
      int a; cin >> a;
      int x = usamap.count(a), y = nekomap.count(a);
      if(x and y) cout << "DRAW\n";
      else if(x) cout << "USAGI\n";
      else if(y) cout << "NEKO\n";
      if(x or y) return 0;
    }
  }
  
  cout << "DRAW\
}


Compiler output:
a.cc:97:11: warning: missing terminating " character
   97 |   cout << "DRAW\
      |           ^
a.cc:97:11: error: missing terminating " character
   97 |   cout << "DRAW\
      |           ^~~~~~
   98 | }
      | ~          
a.cc:34:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   34 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:97:10: error: expected primary-expression at end of input
   97 |   cout << "DRAW\
      |          ^
a.cc:97:10: error: expected '}' at end of input
a.cc:35:1: note: to match this '{'
   35 | {
      | ^
Language: C++

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys

sys.setrecursionlimit(1000000)

n, u, v, m = map(int, raw_input().split())

m1 = {}
m2 = {}

for i in range(n):
    lst_ = map(int, raw_input().split())
    for j in range(n):
        l = [i, n + j]
        if i == j:
            l.append(2 * n)
        if i + j == n - 1:
            l.append(2 * n + 1)
        m1[lst_[j]] = l

for i in range(n):
    lst_ = map(int, raw_input().split())
    for j in range(n):
        l = [i, n + j]
        if i == j:
            l.append(2 * n)
        if i + j == n - 1:
            l.append(2 * n + 1)
        m2[lst_[j]] = l

mu = {}
mv = {}

for loop in range(m):
    num = input()
    if num in m1:
        l = m1[num]
        for p in l:
            if not p in mu:
                mu[p] = 1
            else:
                mu[p] += 1
            if mu[p] == n:
                u -= 1
    
    if num in m2:
        l = m2[num]
        for p in l:
            if not p in mv:
                mv[p] = 1
            else:
                mv[p] += 1
            if mv[p] == n:
                v -= 1
    if u <= 0 or v <= 0:
        if u < v:
            print "USAGI"
        elif u > v:
            print "NEKO"
        else:
            print "DRAW"
        exit()

print "DRAW"


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:3:1: error: 'from' does not name a type
    3 | from collections import deque
      | ^~~~
a.cc:12:1: error: 'm2' does not name a type
   12 | m2 = {}
      | ^~
a.cc:14:1: error: expected unqualified-id before 'for'
   14 | for i in range(n):
      | ^~~
a.cc:35:1: error: 'mv' does not name a type
   35 | mv = {}
      | ^~
a.cc:37:1: error: expected unqualified-id before 'for'
   37 | for loop in range(m):
      | ^~~
Language: Java

import java.util.*;

public class MainSix {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			int q = sc.nextInt();
			if (n == 0 && q == 0)
				break;
			int[] begin = new int[n];
			int[] end = new int[n];
			String[] era = new String[n];
			for (int i = 0; i < n; i++) {
				era[i] = sc.next();
				int y = sc.nextInt();
				end[i] = sc.nextInt();
				begin[i] = end[i] - y + 1;
			}
			for (int i = 0; i < q; i++) {
				int y = sc.nextInt();
				for (int j = 0; j < n; j++) {
					if (y >= begin[j] && y <= end[j]) {
						System.out.println(era[j] + " " + (y - begin[j] + 1));
						break;
					} else if (j == n - 1)
						System.out.println("unknown");
				}
			}
		}
		sc.close();
	}
}

Compiler output:
Main.java:3: error: class MainSix is public, should be declared in a file named MainSix.java
public class MainSix {
       ^
1 error
Language: C

#include <iostream>
#include <cstring>
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>

using namespace std;

const int N=10006, INF=0x3fffffff;

int dis[N];
bool vs[N], n, m;
struct data {
    int u, dis, cost;
    data() {}
    data(int _u, int _dis, int _cost) : u(_u), dis(_dis), cost(_cost) {}
};
vector <data> arc[N];
queue <int> Q;

struct ARC {
    int s, t, val;
    ARC() {}
    ARC(int _s, int _t, int _val) : s(_s), t(_t), val(_val) {}
    bool operator <(const ARC &T) const {
        return val<T.val;
    }
};
vector <ARC> hehe;

void BFS() {
    while(!Q.empty()) Q.pop();
    for(int i=1; i<=n; i++) dis[i]=INF;
    memset(vs, 0, sizeof vs);
    vs[1]=1, Q.push(1), dis[1]=0;
    while(!Q.empty()) {
        int cur=Q.front();
        Q.pop(), vs[cur]=0;
        int len=(int)arc[cur].size();
        for(int i=0; i<len; i++) {
            int u=arc[cur][i].u;
            int DIS=arc[cur][i].dis;
            if(dis[u]>dis[cur]+DIS) {
                dis[u]=dis[cur]+DIS;
                if(!vs[u]) vs[u]=1, Q.push(u);
            }
        }
    }
}

void update(int id) {
    int len=(int)arc[id].size();
    for(int i=0; i<len; i++) {
        int u=arc[id][i].u;
        int DIS=arc[id][i].dis;
        int COST=arc[id][i].cost;
        if(dis[id]+DIS!=dis[u] || vs[u]) continue;
        hehe.push_back(ARC(id, u, COST));
    }
}

int main() {
    freopen("/home/lovezzt/桌面/in.txt", "r", stdin);
    while(scanf("%d%d", &n, &m), n!=0 || m!=0) {
        for(int i=1; i<=n; i++) arc[i].clear();
        for(int i=0, a, b, c, d; i<m; i++) {
            scanf("%d%d%d%d", &a, &b, &c, &d);
            arc[a].push_back(data(b, c, d));
            arc[b].push_back(data(a, c, d));
        }
        BFS();
        memset(vs, 0, sizeof vs);
        int sum=0, tot=1;
        vs[1]=1;
        update(1);
        hehe.clear();
        while(tot<n) {
            int len=(int)hehe.size();
            int Min=INF, id;
            for(int i=0; i<len; i++) {
                int t=hehe[i].t;
                int 
            }
        }
    }
    return 0;
}

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

#include<stdio.h>
struct D{int f,e;char n[20];};
int N,Q,i,q;
D Y[1005];
int main()
{
	for(;scanf("%d%d",&N,&Q),N;)
	{
		for(i=0;i<N;Y[i].f=Y[i].e-Y[i].f+1,i++)
			scanf("%s%d%d",Y[i].n,&Y[i].f,&Y[i].e);
		for(;Q--;)
		{
			scanf("%d",&q);
			for(i=0;i<N;i++)
				if(Y[i].f<=q&&q<=Y[i].e)
				{
					printf("%s %d\n",Y[i].n,q-Y[i].f+1);
					break;
				}
			if(i==N)
				puts("Unknown");
		}
	}
	return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'D'; use 'struct' keyword to refer to the type
    4 | D Y[1005];
      | ^
      | struct 
main.c: In function 'main':
main.c:9:33: error: request for member 'f' in something not a structure or union
    9 |                 for(i=0;i<N;Y[i].f=Y[i].e-Y[i].f+1,i++)
      |                                 ^
main.c:9:40: error: request for member 'e' in something not a structure or union
    9 |                 for(i=0;i<N;Y[i].f=Y[i].e-Y[i].f+1,i++)
      |                                        ^
main.c:9:47: error: request for member 'f' in something not a structure or union
    9 |                 for(i=0;i<N;Y[i].f=Y[i].e-Y[i].f+1,i++)
      |                                               ^
main.c:10:44: error: request for member 'n' in something not a structure or union
   10 |                         scanf("%s%d%d",Y[i].n,&Y[i].f,&Y[i].e);
      |                                            ^
main.c:10:52: error: request for member 'f' in something not a structure or union
   10 |                         scanf("%s%d%d",Y[i].n,&Y[i].f,&Y[i].e);
      |                                                    ^
main.c:10:60: error: request for member 'e' in something not a structure or union
   10 |                         scanf("%s%d%d",Y[i].n,&Y[i].f,&Y[i].e);
      |                                                            ^
main.c:15:40: error: request for member 'f' in something not a structure or union
   15 |                                 if(Y[i].f<=q&&q<=Y[i].e)
      |                                        ^
main.c:15:54: error: request for member 'e' in something not a structure or union
   15 |                                 if(Y[i].f<=q&&q<=Y[i].e)
      |                                                      ^
main.c:17:62: error: request for member 'n' in something not a structure or union
   17 |                                         printf("%s %d\n",Y[i].n,q-Y[i].f+1);
      |                                                              ^
main.c:17:71: error: request for member 'f' in something not a structure or union
   17 |                                         printf("%s %d\n",Y[i].n,q-Y[i].f+1);
      |                                                                       ^
Language: C++

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2242

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

int WY[(int)1e9+10][2];
string EBY[1010];
int N, Q;

int main() {
  while (cin >> N >> Q && N) {
    fill(&WY[0][0], &WY[0][0]+((int)1e9+10)*2, 0);
    fill(EBY, EBY+1010, "");
    EBY[0] = "Unknown";
    for (int i=1; i<=N; i++) {
      string en;
      int eby, wy;
      cin >> en >> eby >> wy;
      EBY[i] = en;
      for (; eby>0; ) {
	WY[wy][0] = i;
	WY[wy][1] = eby;
	eby--;
	wy--;
      }
    }
    for (int i=0; i<Q; i++) {
      int q;
      cin >> q;
      cout << EBY[WY[q][0]]; 
      if (WY[q][0] != 0) cout << " " << WY[q][1];
      cout << endl;
    }
  }
}

Compiler output:
/tmp/cccclAkQ.o: in function `main':
a.cc:(.text+0x43): relocation truncated to fit: R_X86_64_PC32 against symbol `EBY[abi:cxx11]' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `EBY[abi:cxx11]' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x6d): relocation truncated to fit: R_X86_64_PC32 against symbol `EBY[abi:cxx11]' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0xda): relocation truncated to fit: R_X86_64_PC32 against symbol `EBY[abi:cxx11]' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x152): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x1a4): relocation truncated to fit: R_X86_64_PC32 against symbol `EBY[abi:cxx11]' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x234): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x244): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x260): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/cccclAkQ.o
a.cc:(.text+0x28a): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cccclAkQ.o
/tmp/cccclAkQ.o: in function `__tcf_0':
a.cc:(.text+0x2dd): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;

class calender{
public:
  string s;
  int ey,wy;
  bool operator<(const calender &a)const{
    return wy < a.wy;
  }
};
int main(){
  int n,q;
  while(cin>>n>>q,n){
    calender c[1000];
    for(int i=0;i<n;i++)cin>>c[i].s>>c[i].ey>>c[i].wy;
    sort(c,c+n);
    for(int i=0;i<q;i++){
      int query;
      cin>>query;
      for(int i=0;i<n;i++){
	if(query <= c[i].wy){
	  if(c[i].wy - query < c[i].ey){
	    cout << c[i].s << " " << c[i].ey - (c[i].wy - query)<< endl;
	  }else{
	    cout << "Unknown" << endl;
	  }
	  break;
	}
      }
    }
  }
  return 0;
}

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

#include<iostream>
#include<vector>
#include<string>
using namespace std;
struct era{
  int s,e;
  string name;
  bool operator<(const era&e)const{
    return s < e.s;
  }
};
int main(){
  int n,q;
  int i,j,k;
  era e;
  string str;
  int b,w;
  cin >> n >> q;
  while(n+q!=0){
    vector<era> v;
    for(i=0;i<n;i++){
      cin >> str >> b >> w;
      e.name=str;
      e.s=w-b+1;e.e=w;
      v.push_back(e);
    }
    sort(v.begin(),v.end());
    for(i=0;i<q;i++){
      cin >> b;
      int st=0,en=v.size()-1,no;
      no=(st+en)/2;
      for(j=0;j<100;j++){
	if(v[no].s<b) st = no;
	else en=no;
	no=(st+en)/2;
      }
      if(v[no].s<=b&&b<=v[no].e) cout << v[no].name <<" "<<  (b-v[no].s+1) << endl;
      else cout << "Unknown" << endl;
    }
    
    cin >> n >> q;
  }
  return 0;
}

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

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

struct P {
  int start, end;
  string name;

  P(int s, int e, string n) : start(s), end(e), name(n) { }
};

bool operator < (P a, P b) {
  return a.start != b.start ? a.start < b.start : a.end < b.end;
}

int main() {
  for(int N, Q; cin >> N >> Q && N; ) {
    vector<P> ps;

    for(int i = 0; i < N; i++) {
      int west, japan;
      string name;

      cin >> name >> japan >> west;

      ps.push_back(P(west - japan + 1, west, name));
    }

    sort(ps.begin(), ps.end());

    for(int i = 0; i < Q; i++) {
      int year;
      cin >> year;

      string answer = "Unknown";

      for(int j = 0; j < N; j++) {
        if(ps[j].start <= year && year <= ps[j].end) {
          answer = ps[j].name;
          year = year - ps[j].start + 1;
          break;
        }
      }

      if(answer == "Unknown") {
        cout << answer << endl;
      } else {
        cout << answer << " " << year << endl;
      }
    }
  }
}

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

#include <stack>
#include <utility>
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <map>
using namespace std;

int main()
{
	int n, q;
	while (cin >> n >> q) {
		if (n == 0)break;
		map<string,pair< int,int>> his;
		string str[1009];
		int b,c;
		string a;
		for (int i = 0; i < n; i++) {
			cin >> a >> b >> c;
			(his[a]).first = c - b + 1; str[i] = a; (his[a]).second = c;
		}
		for (int i = 0; i < q; i++) {
			cin >> b; c = INT_MAX / 2; int k;
			for (int j = 0; j < n;j++){
				if ((his[str[j]]).first <= b &&(b<=his[str[j]].second)&& (k = b - (his[str[j]]).first)+1 < c) {
					c = k; a = str[j];
				}
			}if (c == INT_MAX / 2)cout << "Unknown" << endl;
			else
			cout << a <<" "<< c+1 << endl;
		}
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: 'INT_MAX' was not declared in this scope
   24 |                         cin >> b; c = INT_MAX / 2; int k;
      |                                       ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <map>
  +++ |+#include <climits>
    8 | using namespace std;
Language: C++

#include <string>
#include <iostream>
using namespace std;
int N, Q, v[1000], w[1000], x; char s[1000][20];
int main() {
	while (cin >> N >> Q, N | Q) {
		for (int i = 0; i < N; i++) scanf("%s%d%d", s[i], &v[i], &w[i]);
		for (int i = 0; i < Q; i++) {
			scanf("%d", &x); int f = 0;
			for (int j = 0; j < N; j++) {
				if (w[j] - v[j] < x && x <= w[j]) {
					printf("%d %d\n", s[j], x - w[j] + j[j]); f = 1; break;
				}
			}
			if (!f) cout << "Unknown" << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:77: error: invalid types 'int[int]' for array subscript
   12 |                                         printf("%d %d\n", s[j], x - w[j] + j[j]); f = 1; break;
      |                                                                             ^
Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

char seq[1000000];
int dp[2][2][3][3];

inline bool valid(int l, int r) { return l <= r; }
inline int X(int index) { return (seq[index] - '1') % 3; }

int main() {
  while (gets(seq), seq[0] != '#') {
    int len = strlen(seq);
    MEMSET(dp, 0x00);
    REP(i, 2) REP(j, 3) REP(k, 3) { if (!valid(j, k)) { dp[0][i][j][k] = 1 << 30; } }
    REP(iter, len) {
      int prev = iter & 1;
      int next = prev ^ 1;
      MEMSET(dp[next], 0x0f);
      int nx = X(iter);
      REP(lx, 3) {
        REP(rx, 3) {
          if (!valid(lx, rx)) { continue; }
          if (valid(nx, rx)) {
            dp[next][0][nx][rx] = min(dp[next][0][nx][rx], dp[prev][0][lx][rx] + 1);
            dp[next][0][nx][rx] = min(dp[next][0][nx][rx], dp[prev][1][lx][rx]);
          }
          if (valid(lx, nx)) {
            dp[next][1][lx][nx] = min(dp[next][1][lx][nx], dp[prev][0][lx][rx]);
            dp[next][1][lx][nx] = min(dp[next][1][lx][nx], dp[prev][1][lx][rx] + 1);
          }
        }
      }
    }
    int ans = 1 << 30;
    REP(i, 2) REP(j, 3) REP(k, 3) { ans = min(ans, dp[len & 1][i][j][k]); }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:10: error: 'gets' was not declared in this scope; did you mean 'getw'?
   29 |   while (gets(seq), seq[0] != '#') {
      |          ^~~~
      |          getw
Language: C++

#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int dp[2][2][4][4];
char c[100010];

int main(){
	while(gets(c)){
		if(c[0]=='#')break;
		memset(dp,0,sizeof(dp));
		rep2(i,1,strlen(c)+1){
			int cur=i%2,pre=1-cur,a=(c[i-1]-'0')%3;
			if(!a)a=3;
			rep(j,2)rep(k,4)rep(l,4)dp[cur][j][k][l]=INF;
			rep(j,2)rep2(k,1,4)rep2(l,max(k,a),4){
				dp[cur][0][a][l]=min(dp[cur][0][a][l],dp[pre][j][k][l]+(j<1));
			}
			rep(j,2)rep2(k,1,a+1)rep2(l,k,4){
				dp[cur][1][k][a]=min(dp[cur][1][k][a],dp[pre][j][k][l]+(j>0));
			}
		}
		int a=INF;
		rep(i,2)rep(j,4)rep(k,4)a=min(a,dp[strlen(c)%2][i][j][k]);
		cout<<a<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
   49 |         while(gets(c)){
      |               ^~~~
      |               getw
Language: C++

#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int dp[2][2][4][4];
char c[100010];

int main(){
	while(scanf("%s",c)){
		if(c[0]=='#')break;
		memset(dp,0,sizeof(dp));
		rep2(i,1,strlen(c)+1){
			int cur=i%2,pre=1-cur,a=(c[i-1]-'0')%3;
			if(!a)a=3;
			rep(j,2)rep(k,4)rep(l,k,4)dp[cur][j][k][l]=INF;
			rep(j,2)rep2(k,1,4)rep2(l,max(k,a),4){
				dp[cur][0][a][l]=min(dp[cur][0][a][l],dp[pre][j][k][l]+(j<1));
			}
			rep(j,2)rep2(k,1,a+1)rep2(l,k,4){
				dp[cur][1][k][a]=min(dp[cur][1][k][a],dp[pre][j][k][l]+(j>0));
			}
		}
		int a=INF;
		rep(i,2)rep(j,4)rep(k,4)a=min(a,dp[strlen(c)%2][i][j][k]);
		cout<<a<<endl;
	}
}

Compiler output:
a.cc:55:50: error: macro "rep" passed 3 arguments, but takes just 2
   55 |                         rep(j,2)rep(k,4)rep(l,k,4)dp[cur][j][k][l]=INF;
      |                                                  ^
a.cc:33:9: note: macro "rep" defined here
   33 | #define rep(i,n) rep2(i,0,n)
      |         ^~~
a.cc: In function 'int main()':
a.cc:55:41: error: 'rep' was not declared in this scope
   55 |                         rep(j,2)rep(k,4)rep(l,k,4)dp[cur][j][k][l]=INF;
      |                                         ^~~
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, 1, -1};

int main(){
	int dmg[26];
	string mp[100];
	int HP, HPmax;
	int reg[12];
	int dp[2][1<<12];
	while(cin >> HP >> HPmax, HP){
		int R, C; fin >> R >> C;
		for(int i=0;i<R;i++) cin >> mp[i];
		int T; cin >> T;
		for(int i=0;i<T;i++){
			char c; int d; cin >> c >> d;
			dmg[c-'A'] = d;
		}
		int S; cin >> S;
		vector<int> act;
		for(int i=0;i<S;i++){
			char c; int d; cin >> c >> d;
			for(int j=0;j<d;j++){
				if(c=='U') act.push_back(0);
				if(c=='D') act.push_back(1);
				if(c=='R') act.push_back(2);
				if(c=='L') act.push_back(3);
			}
		}
		int P; cin >> P;
		for(int i=0;i<P;i++) cin >> reg[i];
		memset(dp, 0, sizeof(dp));
		dp[0][(1<<P)-1] = HP;
		int x = 0, y = 0;
		int cur = 0, next = 1;
		for(int i=0;i<act.size();i++){
			memset(dp[next], 0, sizeof(dp[next]));
			x += dx[act[i]];
			y += dy[act[i]];
			int damage = dmg[mp[x][y]-'A'];
			for(int j=(1<<P)-1;j>=0;j--){
				if(dp[cur][j] == 0) continue;
				if(dp[cur][j] > damage) dp[next][j] = max(dp[next][j], dp[cur][j]-damage);
				for(int k=0;k<P;k++){
					if(!(j&(1<<k))) continue;
					dp[cur][j^(1<<k)] = max(min(HPmax, dp[cur][j]+reg[k]), dp[cur][j^(1<<k)]);
				}
			}
			swap(cur, next);
		}
		cout << (dp[cur][0] > 0 ? "YES" : "NO") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: 'fin' was not declared in this scope
   17 |                 int R, C; fin >> R >> C;
      |                           ^~~
a.cc:37:17: error: 'memset' was not declared in this scope
   37 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, 1, -1};

int main(){
	int dmg[26];
	string mp[100];
	int HP, HPmax;
	int reg[12];
	int dp[2][1<<12];
	while(cin >> HP >> HPmax, HP){
		int R, C; cin >> R >> C;
		for(int i=0;i<R;i++) cin >> mp[i];
		int T; cin >> T;
		for(int i=0;i<T;i++){
			char c; int d; cin >> c >> d;
			dmg[c-'A'] = d;
		}
		int S; cin >> S;
		vector<int> act;
		for(int i=0;i<S;i++){
			char c; int d; cin >> c >> d;
			for(int j=0;j<d;j++){
				if(c=='U') act.push_back(0);
				if(c=='D') act.push_back(1);
				if(c=='R') act.push_back(2);
				if(c=='L') act.push_back(3);
			}
		}
		int P; cin >> P;
		for(int i=0;i<P;i++) cin >> reg[i];
		memset(dp, 0, sizeof(dp));
		dp[0][(1<<P)-1] = HP;
		int x = 0, y = 0;
		int cur = 0, next = 1;
		for(int i=0;i<act.size();i++){
			memset(dp[next], 0, sizeof(dp[next]));
			x += dx[act[i]];
			y += dy[act[i]];
			int damage = dmg[mp[x][y]-'A'];
			for(int j=(1<<P)-1;j>=0;j--){
				if(dp[cur][j] == 0) continue;
				if(dp[cur][j] > damage) dp[next][j] = max(dp[next][j], dp[cur][j]-damage);
				for(int k=0;k<P;k++){
					if(!(j&(1<<k))) continue;
					dp[cur][j^(1<<k)] = max(min(HPmax, dp[cur][j]+reg[k]), dp[cur][j^(1<<k)]);
				}
			}
			swap(cur, next);
		}
		cout << (dp[cur][0] > 0 ? "YES" : "NO") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'memset' was not declared in this scope
   37 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

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

#define INF 1000000007LL
#define fir first
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sz size()

struct edge{
	int to, dist, cost;
	edge(int t,int d,int c): to(t), dist(d), cost(c) {}
};

int N,M,d[10010];
pi city[10010];
bool ok[10010];
vector<edge> G[10010];

void shortest(){
	
	priority_queue<pi, vector<pi>, greater<pi> > Q;
	fill(d,d+N,INF);
	d[0]=0;
	Q.push(pi(0,0));
	
	while(Q.sz){
		pi p=Q.top();
		Q.pop();
		int v=p.sec;
		if(p.fir > d[v]) continue;
		rep(i,G[v].sz){
			edge e=G[v][i];
			if(d[e.to] > d[v] + e.dist){
				d[e.to] = d[v] + e.dist;
				Q.push( pi(d[e.to], e.to) );
			}
		}
	}
}

int main(){
	while(cin>>N>>M && N){
		
		rep(i,N) G[i].clear();
		
		rep(i,M){
			int u,v,d,c;
			cin>>u>>v>>d>>c;
			u--; v--;
			G[u].pb( edge(v,d,c) );
			G[v].pb( edge(u,d,c) );
		}
		
		shortest();
		
		rep(i,N) city[i] = pi(d[i], i);
		sort(city,city+N);
		fill(ok,ok+N,0);
		ok[0]=1;
		int ans=0;
		
		rep2(i,1,N){
			int v=city[i].sec,mincost=INF;
			rep(j,G[v].sz){
				edge e=G[v][j];
				if(ok[e.to] && d[e.to]+e.dist == d[v]){
					mincost=min(mincost, e.cost);
				}
			}
			ans+=mincost;
			ok[v]=1;
		}
		
		cout<<ans<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   63 |                 sort(city,city+N);
      |                 ^~~~
      |                 short
Language: C

//
// Create by Running Photon on 2015-04-02
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <algorithm>
#include <cctype>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <set>
#include <vector>
using namespace std;

#define CLR(x) memset(x,0,sizeof x)
#define ll long long
const int inf=0x3f3f3f3f;
const int maxn=5e4+5;
const int MOD=5e5+5;
int cnt, head[maxn], nxt[maxn], pnt[maxn], dist[maxn], cost[maxn];
void add_edge(int u, int v, int ds, int cs){
    dist[cnt] = ds;
    cost[cnt] = cs;
    pnt[cnt] = v;
    nxt[cnt] = head[u];
    head[u] = cnt++;
}
int n, m;
int ans[maxn], dp[maxn];
typedef pair <int, int> sta;
int dijkstra(){
    int ret = 0;
    priority_queue <sta, vector<sta>, greater<sta> >pq;
    memset(dp, 0x3f, sizeof dp);
    memset(ans, 0x3f, sizeof ans);
    pq.push(sta(0, 1)); dp[1] = 0;
    while(!pq.empty()){
        int u = pq.top().second;
        int d = pq.top().first;
        pq.pop();
        if(d > dp[u]) continue;
        for(int i = head[u]; i != -1; i = nxt[i]){
            int v = pnt[i];
            if(dp[v] > dp[u] + dist[i]){
                ans[v] = cost[i];
                dp[v] = dp[u] + dist[i];
                pq.push(sta(dp[v], v));
            }
            else if(dp[v] == dp[u] + dist[i] && ans[v] > cost[i]){
                ans[v] = cost[i];
            }
        }
    }
    for(int i = 2; i <= n; i++) ret += ans[i];
    return ret;
}
int main()
{
#ifdef LOCAL
	freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
#endif
	ios_base::sync_with_stdio(0);

	while(scanf("%d%d", &n, &m) != EOF && n && m){
        cnt = 0;
        memset(head, -1, sizeof head);
        for(int i = 1; i <= m; i++){
            int u, v, dis, cs;
            scanf("%d%d%d%d", &u, &v, &dis, &cs);
            add_edge(u, v, dis, cs);
            add_edge(v, u, dis, cs);
        }
        printf("%d\n", dijkstra());
	}
	return 0;
}

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

#include <iostream>  
#include <stdio.h>  
#include <stdlib.h>  
#include<string.h>  
#include<algorithm>  
#include<math.h>  
#include<queue>  
using namespace std;  
typedef long long ll;  
const int maxn=10010,INF=99999999;  
int ip,n,m,head[maxn],dis[maxn],jl[maxn];  
bool vis[maxn];  
struct data  
{  
    int next,to,d,w;  
} tu[maxn*maxn];  
  
void init()  
{  
    ip=0;  
    memset(head,-1,sizeof(head));  
}  
  
void add(int a,int b,int d,int w)  
{  
    tu[ip].to=b,tu[ip].d=d,tu[ip].w=w,tu[ip].next=head[a],head[a]=ip++;  
}  
  
void spfa()  
{  
    for(int i=1; i<=n; i++)  
        dis[i]=jl[i]=INF;  
    dis[1]=0;  
    jl[1]=0;  
    memset(vis,0,sizeof(vis));  
    queue<int>q;  
    q.push(1);  
    while(!q.empty())  
    {  
        int t=q.front();  
        q.pop();  
        vis[t]=0;  
        for(int k=head[t]; k!=-1; k=tu[k].next)  
        {  
            int d=tu[k].d,v=tu[k].to,w=tu[k].w;  
            if(dis[t]+d<dis[v])  
            {  
                jl[v]=w;///??最小花?  
                dis[v]=dis[t]+d;  
                if(!vis[v])  
                {  
                    vis[v]=1;  
                    q.push(v);  
                }  
            }  
            else if(dis[t]+d==dis[v]&&w<jl[v])///??最小花?  
                jl[v]=w;  
        }  
    }  
    int ans=0;  
    for(int i=1; i<=n; i++)  
        ans+=jl[i];  
    printf("%d\n",ans);  
}  
  
  
int main()  
{  
    while(~scanf("%d%d",&n,&m)&&m+n)  
    {  
        init();  
        while(m--)  
        {  
            int a,b,d,w;  
            scanf("%d%d%d%d",&a,&b,&d,&w);  
            add(a,b,d,w);  
            add(b,a,d,w);  
        }  
        spfa();  
    }  
    return 0;  
}  

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

//YPZ_YPZ_YPZ_YPZ_YPZ
#include<algorithm>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<set>
#include<queue>

#define ll long long
#define RG register
#define il inline
#define inf 1073741824
#define rep(i,a,b) for(register int i=a;i<=b;++i)
#define file(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout);
using namespace std;
const int N=10010,M=20010;
struct Edge{
	int to,net,w,c;
}e[M*2];
int head[N],num_e,n,m;

il void add(int x,int y,int w,int c){
	e[++num_e].to=y,e[num_e].w=w,e[num_e].c=c,e[num_e].net=head[x],head[x]=num_e;
}

il int gi() {
  RG int res=0,f=1;RG char ch=getchar();while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
  if(ch=='-')f=-1,ch=getchar();while(ch>='0'&&ch<='9') res=res*10+ch-'0',ch=getchar();
  return res*f;
}

int dis[N],p[N],C;
bool inq[N];

il void spfa(int s){
	rep(i,1,n) dis[i]=inf;
	dis[s]=0; queue<int> q;q.push(s);RG int u;
	while(!q.empty()){
		u=q.front(); q.pop(); inq[u]=0;
		for(int i=head[u];i!=-1;i=e[i].net){
			int to=e[i].to;
			if(dis[to]>=dis[u]+e[i].w){
				if(dis[to]>dis[u]+e[i].w){
					dis[to]=dis[u]+e[i].w;
					if(p[to]!=-1) C-=e[p[to]].c;
					C+=e[i].c;
					p[to]=i;
					if(!inq[to]) q.push(to),inq[to]=1;
				}
				else if(dis[to]==dis[u]+e[i].w){
					if(e[p[to]].c > e[i].c){
						C=C-e[p[to]].c+e[i].c;
						p[to]=i;
					}
				}
			}
		}
	}
}

int main(){
	while(scanf("%d%d",&n,&m)!=EOF){
		if(!n&&!m)break; RG int u,v,w,c;
		memset(head,-1,sizeof(head)),num_e=-1;
		memset(p,-1,sizeof(p)); C=0;
		rep(i,1,m) u=gi(),v=gi(),w=gi(),c=gi(),add(u,v,w,c),add(v,u,w,c);
		spfa(1);
		printf("%d\n",C);
	}
  return 0;
}

Compiler output:
main.c:2:9: fatal error: algorithm: No such file or directory
    2 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.