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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {if (a < b) {a = b; return 1;} return 0;}
template <typename A, typename B> inline bool chmin(A &a, B b) {if (a > b) {a = b; return 1;} return 0;}
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9+100;
const bool debug = 0;
/****************************/

struct SyntaxAnalysis {
	string s;
	int i;
	int val;
	
	SystaxAnalysis() {}
	
	int init(string _s) {
		s = _s;
		i = 0;
		
		val = expr(i);
		return val;
	}
	
	int expr(int &i) {
		int res = 0;
		if (s[i] >= '0' && s[i] <= '9') {
			res = s[i] - '0';
		}
		else {
			res = term(++i);
			++i;
		}
		return res;
	}
	
	int term(int &i) {
		int ope;
		if (s[i] == '+') ope = 0;
		else if (s[i] == '*') ope = 1;
		else ope = 2;
		
		int val1 = expr(++i);
		int val2 = expr(++i);
		
		int res;
		if (ope == 0) res = val1 | val2;
		else if (ope == 1) res = val1 & val2;
		else res = val1 ^ val2;
		return res;
	}
};

string make(int i) {
	string num = to_string(i);
	reverse(ALL(num));
	while (num.size() < 4) num += '0';
	reverse(ALL(num));
	return num;
}

string arrange(string str, string num) {
	REP(i, str.size()) {
		if (str[i] >= 'a' && str[i] <= 'd') {
			str[i] = num[str[i]-'a'];
		}
	}
	return str;
}

int main() {
	string s;
	while (cin >> s, s != ".") {
		string num;
		cin >> num;
		
		string tmp = arrange(s, num);
		
		SyntaxAnalysis sa;
		int hsorg = sa.init(tmp);
		
		int ans = 0;
		REP(i, 10000) {
			string cur = make(i);
			if (hsorg == sa.init(arrange(s, cur))) {
				ans++;
			}
		}
		
		if (debug) printf("@ ");
		cout << hsorg << " " << ans << endl;
	}
	return 0;
}

// C


Compiler output:
a.cc:21:9: error: ISO C++ forbids declaration of 'SystaxAnalysis' with no type [-fpermissive]
   21 |         SystaxAnalysis() {}
      |         ^~~~~~~~~~~~~~
a.cc: In member function 'int SyntaxAnalysis::SystaxAnalysis()':
a.cc:21:27: warning: no return statement in function returning non-void [-Wreturn-type]
   21 |         SystaxAnalysis() {}
      |                           ^
Language: C++


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#endif



int64_t dp[100][10][11];

int64_t func(int i, int a, int b)
{
	if (i == 1) {
		if (b == 10) { return 0; }
		return 1;
	}
	if (dp[i][a][b] != -1) {
		return dp[i][a][b];
	}

	if (b != 10) {
		return dp[i][a][b] = func(i - 1, a, b) * 2;
	}

	dp[i][a][b] = func(i - 1, a, 10);
	for (int bb = 0; bb < 10; ++bb) {
		if (a != bb) {
			dp[i][a][b] += func(i - 1, a, bb);
		}
	}
	return dp[i][a][b];
}

int64_t f2(int i, int a, int b, int next)
{
	if (b == 10) {
		if (a == next) {
			return func(i - 1, a, 10);
		}
		else {
			return func(i - 1, a, next);
		}
	}
	return func(i - 1, a, b);
}


int main()
{
	using namespace std;


	int64_t N;
	while (true)
	{
		cin >> N;
		if (N == 0) {
			break;
		}
		memset(dp, -1, sizeof(dp));

		int64_t n_2 = 1;
		int k = 2;
		for (;; ++k) {
			n_2 *= 2;
			if (n_2 >= (((int64_t)(1)) << 62)) {
				break;
			}
			int64_t sum = 9 * 9 * (n_2 - 1);
			if (sum >= N)
			{
				break;
			}
			else {
				N -= sum;
			}
		}

		for (int32_t i = 1; i <= 9; i++)
		{
			func(k, i, 10);
		}

		for (int32_t i = 1; i <= 9; i++)
		{
			//std::cerr << dp[k][i][10] << endl;
		}
		//std::cerr << "==============" << endl;




		int a, b = 10;
		for (int j = 1; j <= 9; ++j)
		{
			{a = j; }
			if (dp[k][a][b] < N) {
				N -= dp[k][a][b];
			}
			else {
				cout << a;
				break;
			}
		}
		for (int32_t i = k; i >= 2; --i)
		{
			if (b == 10) {
				for (int j = 0; j <= 9; ++j)
				{
					if (f2(i, a, b, j) < N) {
						N -= f2(i, a, b, j);
					}
					else {
						if (a == j) {
							cout << j;
						}
						else {
							b = j;
							cout << j;
						}
						break;
					}
				}
			}
			else {
				if (b>a) { std::swap(a, b); }
				if (f2(i, a, b, a) < N) {
					N -= f2(i, a, b, a);
					cout << b;
				}
				else {
					cout << a;
				}
			}
		}

		cout << std::endl;
	}


}



Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: 'memset' was not declared in this scope
   79 |                 memset(dp, -1, sizeof(dp));
      |                 ^~~~~~
a.cc:24:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   23 | #include <list>
  +++ |+#include <cstring>
   24 | #endif
Language: C++

//#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

#define SIZE 1000010

typedef long double ld;
typedef long long ll;

ll sum[SIZE] = {};
int a[SIZE], x[SIZE], p;

bool check(int n, const ll sum[], int p, ll x){
  ll l = 0, r = n; // [l,r)
  
  for(int i=0;i<n;i++){
    if(x - sum[i] > p) return false;
    if(sum[i] >= x) continue;
    
    ll d = x - sum[i];

    ll tl = 0, tr = 1e9;

    while(tl < tr){
      ll mid = (tr+tl+1)/2;
      if(p - mid*mid >= d) tl = mid;
      else tr = mid-1;
    }

    l = max(l, i - tl);
    r = min(r, i + tl + 1);
  }
  
  return l < r;
}

bool solve(){
  int n, m;
  
  scanf("%d%d", &n, &m);
  if(n == 0) return false;
  
  memset(sum, 0, sizeof(sum));
  
  for(int i=0;i<m-1;i++){
    scanf("%d%d", a+i, x+i);
    x[i]--;
  }
  scanf("%d", &p);

  for(int i=0;i<m-1;i++){
    for(int j=0;j*j<a[i];j++){
      if(x[i]-j >= 0) sum[x[i]-j] += a[i] - j*j;
      if(x[i]+j < n && j > 0) sum[x[i]+j] += a[i] - j*j;
    }
  }
  
  ll l=0, r=1e18;

  while(l<r){
    ll mid = (l+r+1)/2;
    
    if(check(n, sum, p, mid)){
      l = mid;
    }else{
      r = mid-1;
    }
  }

  printf("%lld\n", l);
  
  return true;
}



int main(){
  while(solve());
}




Compiler output:
a.cc: In function 'bool solve()':
a.cc:46:3: error: 'memset' was not declared in this scope
   46 |   memset(sum, 0, sizeof(sum));
      |   ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cmath>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <string>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
typedef long long ll;
const int mod=1e9+7;
#define lol(i,n) for(int i=0;i<n;i++)

using namespace std;
string n;
int main() {
    cin >>n;
    if(n="ani")cout <<"square1001"<< endl;
    else cout <<"E869120"<< endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: could not convert 'n.std::__cxx11::basic_string<char>::operator=(((const char*)"ani"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   17 |     if(n="ani")cout <<"square1001"<< endl;
      |        ~^~~~~~
      |         |
      |         std::__cxx11::basic_string<char>
Language: C++

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

int main(){
	int a,b,c,d;
	cin>>a>>b>>>>c>>d;
	if(a*b%2&&(c+d)%2){
		cout<<"No"<<endl;
	}
	else{
		cout<<"Yes"<<endl;
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected primary-expression before '>>' token
    6 |         cin>>a>>b>>>>c>>d;
      |                    ^~
Language: C++

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var [a,b,c,d] = input.trim().split(" ").map(Number);
if((a*b+1)%2==0 && (a+b+1)%2)console.log("No");
else console.log("Yes");


Compiler output:
a.cc:1:21: warning: multi-character character constant [-Wmultichar]
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                     ^~~~
a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                        ^~~~~~~~~~~~
a.cc:1:54: warning: multi-character character constant [-Wmultichar]
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                                      ^~~~~~
a.cc:1:1: error: 'var' does not name a type
    1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
      | ^~~
a.cc:2:1: error: 'var' does not name a type
    2 | var [a,b,c,d] = input.trim().split(" ").map(Number);
      | ^~~
a.cc:3:1: error: expected unqualified-id before 'if'
    3 | if((a*b+1)%2==0 && (a+b+1)%2)console.log("No");
      | ^~
a.cc:4:1: error: expected unqualified-id before 'else'
    4 | else console.log("Yes");
      | ^~~~
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c=0;
	for(int i=0;i<a;i++){
		int b;
		cin>>b[i];
		if(b[i]%2==0){
			c++;
		}
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 cin>>b[i];
      |                       ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |                 if(b[i]%2==0){
      |                     ^
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c=0;
	for(int i=0;i<a;i++){
		int b;
		cin>>b[i];
		if((b[i])%2==0){
			c++;
		}
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 cin>>b[i];
      |                       ^
a.cc:11:22: error: invalid types 'int[int]' for array subscript
   11 |                 if((b[i])%2==0){
      |                      ^
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c;
	for(int i=0;i<a;i++){
		int b;
		cin>>b[i];
		if(b[i]%2){
			c++;
		}
		
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 cin>>b[i];
      |                       ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |                 if(b[i]%2){
      |                     ^
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c;
	for(int i=0;i<a;i++){
		int b;
		cin>>b[i];
		if(b[i]%2==0){
			c++;
		}
		
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 cin>>b[i];
      |                       ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |                 if(b[i]%2==0){
      |                     ^
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c=0;
	for(int i=0;i<a;i++){
		int b;
		cin>>b[i];
		if(b[i]%2==0){
			c++;
		}
		
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
   10 |                 cin>>b[i];
      |                       ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |                 if(b[i]%2==0){
      |                     ^
Language: C++

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

int main(){
	int a;
	cin>>a;
	int c=0;
	for(int i=0;i<a;i++){
		cin>>a[i];
		if(a[i]%2==0){
			c++;
		}
		
	}
	cout<<c<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: invalid types 'int[int]' for array subscript
    9 |                 cin>>a[i];
      |                       ^
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |                 if(a[i]%2==0){
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define mod 1000000007
#define S second
#define F first
#define int long long
using namespace std;

signed main(){
	int a,b,c,d;
	in>>a>>b>>c>>d;
	cout<<a+d-b-c<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'in' was not declared in this scope; did you mean 'yn'?
   12 |         in>>a>>b>>c>>d;
      |         ^~
      |         yn
Language: C++

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);

	int n, a, b, c;
	
	cin>>n>>a>>b>>c;
	
	cout<<N-(a+b-c)<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'N' was not declared in this scope
   25 |         cout<<N-(a+b-c)<<endl;
      |               ^
Language: C++

#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-9;
const ll MOD=1e9+7;
int main(){
    int n;cin>>n;
    vector<int> a(n);
    int sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    sort(all(a[i]));
    if(sum%2==0){
        cout<<sum/2<<endl;
        return 0;
    }
    for(int i=0;i<n;i++){
        if(a[i]%2){
            cout<<(sum-a[i])/2<<endl;
            return 0;
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'i' was not declared in this scope
   18 |     sort(all(a[i]));
      |                ^
a.cc:2:18: note: in definition of macro 'all'
    2 | #define all(vec) vec.begin(),vec.end()
      |                  ^~~
Language: C++

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);
	
	int n, ans = 0, t = 0;
	
	cin>>n;
	
	rep(i,n){
		cin>>A;
		if(A%2==0)ans++;
		else t++;
	}
	cout<<ans+t/2<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'A' was not declared in this scope
   26 |                 cin>>A;
      |                      ^
Language: C++

#include <iostream>
using namespace std;
int n,a,total=0,kisuusaisyou=101;
int main(){
	cin>>a;
	for(int i=0;i<a;i++){
		cin>>n;
		if(kisuusaisyou>n&&n%2==1)kisuusaisyou=n;
		total+=n;
	}
		if(total%2=-1){cout<<(total-kisuusaisyou)/2<<endl;
	}else{
		cout<<total/2<<endl;
	}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: lvalue required as left operand of assignment
   11 |                 if(total%2=-1){cout<<(total-kisuusaisyou)/2<<endl;
      |                    ~~~~~^~
Language: C++

gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max


Compiler output:
a.cc:1:34: error: too many decimal points in number
    1 | gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max
      |                                  ^~~~~~
a.cc:1:1: error: 'gets' does not name a type
    1 | gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max
      | ^~~~
a.cc:1:6: error: 'a' does not name a type
    1 | gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max
      |      ^
a.cc:1:30: error: 'p' does not name a type
    1 | gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max
      |                              ^
a.cc:1:77: error: expected unqualified-id before '.' token
    1 | gets;a=gets.split.map &:to_i;p [*1..100].select{|t|s=0;a.all?{|p|0<=s+=p-t}}.max
      |                                                                             ^
Language: C++

#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define mod 1000000007
#define S second
#define F first
#define int long long
using namespace std;
signed main(){
	int a,b,c,x=0,y=0;
	cin>>a>>b;
	f(i,a){
		cin>>c;
		x+=c;
	}
	f(i,b){
		cin>>d;
		y+=d;
	}
	cout<<x*y<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: 'd' was not declared in this scope
   17 |                 cin>>d;
      |                      ^
Language: C++

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

int main(){
	long long a,b;
	cin>>a>>b;
	int e=0;
	for(int i=0;i<a;i++){
		long long c[100000];
		cin>>c[i];
		for(int j=0;j<b;j++){
			long long d[100000];
			cin>>d[j];
			int l=i*j;
			int f[l]
			e+=f[l];
		}
	}
	cout<<e<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected initializer before 'e'
   16 |                         e+=f[l];
      |                         ^
Language: C++

#include <iostream>
using namespace std;
long int main(void){
    int N, M, A[100001]={}, B[100001]={}, sum_A=0, sum_B=0;
    cin >> N >> M;
    
    for(int i=1; i<=N; i++){
        cin >> A[i];
        sum_A += A[i];
    }
    
    for(int j=1; j<=M; j++){
        cin >> B[j];
        sum_B += B[j];
    }
    cout << sum_A * sum_B << endl;
    return 0;
}



Compiler output:
a.cc:3:6: error: '::main' must return 'int'
    3 | long int main(void){
      |      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define inf 1000000007
#define int long long

signed main() {
	int n;
	vector<pair<int, int>> v;
	rep(i, n) {
		int a, b;
		cin >> a >> b;
		v.push_back(make_pair(a, 1));
		v.push_back(make_pair(b + 1, -1));
	}
	sort(v.begin(), v.end());
	int now = 0;
	int ma = 0;
	for(auto i; v) {
		now += i.second;
		ma = max(ma, now);
	}
	cout << ma << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: declaration of 'auto i' has no initializer
   19 |         for(auto i; v) {
      |             ^~~~
a.cc:19:21: error: could not convert 'v' from 'std::vector<std::pair<long long int, long long int> >' to 'bool'
   19 |         for(auto i; v) {
      |                     ^
      |                     |
      |                     std::vector<std::pair<long long int, long long int> >
a.cc:19:22: error: expected ';' before ')' token
   19 |         for(auto i; v) {
      |                      ^
      |                      ;
Language: C++

//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0 }, dy[] = { 0,1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑


int n, ans, mon;
int main() {
	map<int, int>m;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int a, b;
		cin >> a >> b;
		++m[a];
		--m[b];
	}
	for (auto i : m) { mon += m.second; ans = max(ans, mon); }
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:37: error: 'class std::map<int, int>' has no member named 'second'
   49 |         for (auto i : m) { mon += m.second; ans = max(ans, mon); }
      |                                     ^~~~~~
Language: C++

#include <string>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
typedef long long ll;
const int mod=1e9+7;
#define lol(i,n) for(int i=0;i<n;i++)

using namespace std;
int a,b,c,d;
int main() {
    cin >> a>>b >> c>>d;
    if(((a%2==1||b%2==1)&&(c+d)%2==1)cout << "No"<< endl;
    else cout << "Yes"<< endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: expected ';' before 'cout'
   17 |     if(((a%2==1||b%2==1)&&(c+d)%2==1)cout << "No"<< endl;
      |                                      ^~~~
      |                                      ;
a.cc:18:5: error: expected primary-expression before 'else'
   18 |     else cout << "Yes"<< endl;
      |     ^~~~
a.cc:17:58: error: expected ')' before 'else'
   17 |     if(((a%2==1||b%2==1)&&(c+d)%2==1)cout << "No"<< endl;
      |       ~                                                  ^
      |                                                          )
   18 |     else cout << "Yes"<< endl;
      |     ~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include<string>
#include <numeric>
using namespace std;
#define rep(i,n) for(long long i=0;i<n;i++)
int main() {
	long long a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a%2!=0&&b%2!=0(c == 1 || d == 1) && ((c == (a + 1) / 2) || (d == (a + 1) / 2))) { cout << "No" << endl; }
	else { cout << "Yes" << endl; }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: expression cannot be used as a function
   15 |         if (a%2!=0&&b%2!=0(c == 1 || d == 1) && ((c == (a + 1) / 2) || (d == (a + 1) / 2))) { cout << "No" << endl; }
      |                          ~^~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define mod 1000000007
#define S second
#define F first
#define int long long
using namespace std;
vector<int> v;
int x[200010],b[100010],c[100010];
void mutu(int a,int aa){
	int l=0,r=(int)(v.size());
	while(r-l>=1){
		int i=(r+l)/2;
		if(a==0){
			if(v[i]==b[aa]){
				b[aa]=i;
				return ;
			}
			else if(v[i]<b[aa]) l=i+1;
			else r=i;
		}
		else{
			if(v[i]==c[aa]){
				c[aa]=i;
				return ;
			}
			else if(v[i]<c[aa]) l=i+1;
			else r=i;
		}
	}
}
signed main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if((a==3&&b==3&&abs(c-d)==1)||((a==3||a==5)&&(b==5||b==3)&&a!=b&&c=(a+1)/2&&d=(b+1)/2))puts("No");
	else puts("Yes");
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:83: error: lvalue required as left operand of assignment
   36 |         if((a==3&&b==3&&abs(c-d)==1)||((a==3||a==5)&&(b==5||b==3)&&a!=b&&c=(a+1)/2&&d=(b+1)/2))puts("No");
      |                                                                            ~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define mod 1000000007
#define S second
#define F first
#define int long long
using namespace std;
int x[500],y[500];
signed main(){
	f(;;){}
	return 0;
}



Compiler output:
a.cc:11:13: error: macro "f" requires 2 arguments, but only 1 given
   11 |         f(;;){}
      |             ^
a.cc:2:9: note: macro "f" defined here
    2 | #define f(i,n) for(int i=0;i<(n);i++)
      |         ^
a.cc: In function 'int main()':
a.cc:11:9: error: 'f' was not declared in this scope
   11 |         f(;;){}
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define inf 1000000007
#define int long long

signed main() {
	int n, m;
	cin >> n >> m;
	vector<pair<int, int>> ba(n);
	rep(i, n) {
		cin >> ba[i].second >> ba[i].first;
	}
	vector<pair<int, int>> cd(m);
	rep(i, m) {
		cin >> cd[i].first >> cd[i].second;
	}
	multi_set<int> se;
	int now = inf;
	vector<int> rui(m);
	rep(i, m) {
		now = min(now, cd[i].second);
		rui[i] = now;
	}
	now = 0;
	for(int i = m - 1; i >= 0; i--) {
		while(now < rui[i]) {
			if(i == m - 1) {
				se.insert(inf);
			}
			else {
				se.insert(cd[i + 1].first);
			}
			now++;
		}
	}
	rep(i, n) {
		se.insert(cd[0].first);
		now++;
	}
	sort(ba.begin(), ba.end(), greater<pair<int, int>>());
	int all = 0;
	for(auto i: ba) {
		auto it = se.upper_bound(i.second);
		if(it != se.end()) {
			all += i.first;
			se.erase(it);
		}
	}
	cout << all << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'multi_set' was not declared in this scope
   18 |         multi_set<int> se;
      |         ^~~~~~~~~
a.cc:5:13: error: expected primary-expression before 'long'
    5 | #define int long long
      |             ^~~~
a.cc:18:19: note: in expansion of macro 'int'
   18 |         multi_set<int> se;
      |                   ^~~
a.cc:29:33: error: 'se' was not declared in this scope
   29 |                                 se.insert(inf);
      |                                 ^~
a.cc:32:33: error: 'se' was not declared in this scope
   32 |                                 se.insert(cd[i + 1].first);
      |                                 ^~
a.cc:38:17: error: 'se' was not declared in this scope
   38 |                 se.insert(cd[0].first);
      |                 ^~
a.cc:44:27: error: 'se' was not declared in this scope
   44 |                 auto it = se.upper_bound(i.second);
      |                           ^~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n,m,a[2e5],b[2e5],j,k,ans;
priority_queue<ll> Q;
void Ad(ll c,ll d){
    for(;j<n&&a[j]<c;j++)Q.push(b[j]);
    for(;k>d;k--)if(!Q.empty()){ans+=Q.top(); Q.pop();}
}
int main(){
    cin>>n>>m;
    for(int i=0;i<n;i++)cin>>a[i]>>b[i];
    j=0,k=n+1,ans=0;
    for(int i=0;i<m;i++){
	ll c,d;cin>>c>>d;Ad(c,d);
    }
    Ad(2e9,1);
    cout<<ans<<endl;
    return 0;
}



Compiler output:
a.cc:4:10: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    4 | ll n,m,a[2e5],b[2e5],j,k,ans;
      |          ^~~
a.cc:4:10: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
    4 | ll n,m,a[2e5],b[2e5],j,k,ans;
      |          ^~~
      |          |
      |          double
a.cc:4:10: error: size of array 'a' has non-integral type 'double'
a.cc:4:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    4 | ll n,m,a[2e5],b[2e5],j,k,ans;
      |                 ^~~
a.cc:4:17: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
    4 | ll n,m,a[2e5],b[2e5],j,k,ans;
      |                 ^~~
      |                 |
      |                 double
a.cc:4:17: error: size of array 'b' has non-integral type 'double'
Language: C++

#include<iostream>
using namespace std;
int main(){
    double a,b;
    cin>>a>>b;
    cout<<(a+b>=360?a+b-360:a+b/2<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:34: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |     cout<<(a+b>=360?a+b-360:a+b/2<<endl;
      |                             ~~~~~^~~~~~
a.cc:6:40: error: expected ')' before ';' token
    6 |     cout<<(a+b>=360?a+b-360:a+b/2<<endl;
      |           ~                            ^
      |                                        )
Language: C

/*
 * ID: 3001
 * Proble: GPA janken, combination
 */

#include <stdio.h>

int main(void)
{
    float a[500000];
    int c[4001] = {};
    int s[4001] = {};

    int n;
    scanf("%d", &n);

    int i;
    for (i = 0; i < n; i++)
        scanf("%f", a + i);

    for (i = 0; i < n; i++) 
        c[(int)(a[i] * 1000)]++;

    int k = n;
    for (i = 4000; i >= 0 && n > 0; i--) {
        if (c[i] == 0)
            continue;
        s[i] = n * 3 - c[i] * 2;
        n -= c[i];
    }

    for (i = 0; i < n; i++)
        printf("%d\n", s[a[i] * 1000]);

    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:33:25: error: array subscript is not an integer
   33 |         printf("%d\n", s[a[i] * 1000]);
      |                         ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)

int main(){
  int n,i;
  cin>>n;
  vector<double> a(n),tmp(n);
  rep(i,n)cin>>a[i];
  tmp=a;
  sort(tmp.begin(),tmp.end());
  /*  rep(i,n)                                                                    
    cout<<tmp[i]<<endl;                                                           
    cout<<endl;*/
  rep(i,n){
    int ans=lower_bound(tmp.begin(),tmp.end(),a[i])-tmp.begin();
    //cout<<i<<" "<<ans<<endl;                                                    
    ans*=3;
    ans+=upper_bound(tmp.begin(),tmp.end(),a[i])-lower_bound(tmp.begin(),tmp.end(),a[i])-1;
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(tmp.begin(),tmp.end());
      |   ^~~~
      |   short
a.cc:20:10: error: 'upper_bound' was not declared in this scope
   20 |     ans+=upper_bound(tmp.begin(),tmp.end(),a[i])-lower_bound(tmp.begin(),tmp.end(),a[i])-1;
      |          ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)

int main(){
  int n,i;
  cin>>n;
  vector<double> a(n),tmp(n);
  rep(i,n)cin>>a[i];
  tmp=a;
  sort(tmp.begin(),tmp.end());
  rep(i,n){
    int ans=lower_bound(tmp.begin(),tmp.end(),a[i])-tmp.begin();
    ans*=3;
    ans+=upper_bound(tmp.begin(),tmp.end(),a[i])-lower_bound(tmp.begin(),tmp.end(),a[i])-1;
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(tmp.begin(),tmp.end());
      |   ^~~~
      |   short
a.cc:16:10: error: 'upper_bound' was not declared in this scope
   16 |     ans+=upper_bound(tmp.begin(),tmp.end(),a[i])-lower_bound(tmp.begin(),tmp.end(),a[i])-1;
      |          ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
double x;
int a[5002];
int b[5002],c[5002];
main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x;
        x*=1000;
        a[I]=(int)x;
    }
    for(int i=0;i<n;i++){
        b[(int)(a[i])]++;
        c[(int)(a[i])]++;
    }
    for(int i=1;i<=4000;i++)b[i]+=b[i-1];
    for(int i=0;i<n;i++){
      int sum=0;
        if(a[i]>0)sum+=b[(int)(a[i]-1)]*3;
        sum+=c[(int)(a[i])]-1;
        cout<<sum<<endl;
    }
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:12:11: error: 'I' was not declared in this scope
   12 |         a[I]=(int)x;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
double x;
int a[5002];
int b[5002],c[5002];
main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%lf",&x);
        x*=1000;
        a[i]=x;
        b[x]++;
    }
    for(int i=0;i<n;i++) c[i]=b[i];
    for(int i=1;i<=4000;i++) b[i]+=b[i-1];
    for(int i=0;i<n;i++){
      int sum=0;
      if(a[i]>0)sum+=b[a[i]-1]*3;
      sum+=c[a[i]]-1;
      cout<<sum<<endl;
    }
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:10: error: invalid types 'int [5002][double]' for array subscript
   13 |         b[x]++;
      |          ^
Language: C++

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

using namespace std;

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


string tostr(int i) {
	stringstream ss(i);
	return ss.str();
}

int toint(string s) {
	stringstream ss(s);
	int i;
	ss >> i;
	return i;
}


signed main() {

	string s;
	cin >> s;
	int c = s[2] - '0';
	vector<int> a(c + 1);
	a[c] = 1;

	rep(i, s.size()) {
		if (s[i] == '+' || s[i] == '-') {
			int j;
			for (j = i; j < s.size() && s[j] != 'x'; j++);
			int k = 0;
			if (s[j] == 'x') {
				if (s[j + 1] == '^') {
					k = s[j + 2] - '0';
				}
				else {
					k = 1;
				}
				j--;
			}
			auto t = s.substr(i + 1, j - i);
			int m = toint(t);
			if (s[i] == '-') m *= -1;
			a[k] = m;
		}
	}

	vector<int> ans;

	for (int x = -2 * 100000; x <= 2 * 100000; x++) {
		int sum = 0;
		rep(i, a.size()) {
			a[i];
			//i
			int px = 1;
			for (int j = 0; j < i; j++) {
				px *= x;
			}
			sum += a[i] * px;
		}
		if (sum == 0) {
			ans.push_back(-x);
		}
	}

	string l = "(x";
	string r = ")";

	reverse(ans.begin(), ans.end());

	rep(i, ans.size()) {
		cout << l;
		if (ans[i] > 0) {
			cout << "+";
		}
		cout << ans[i];
		cout << r;
	}
	cout << endl;



}

Compiler output:
a.cc: In function 'std::string tostr(long long int)':
a.cc:13:25: error: invalid conversion from 'long long int' to 'std::ios_base::openmode' [-fpermissive]
   13 |         stringstream ss(i);
      |                         ^
      |                         |
      |                         long long int
In file included from a.cc:4:
/usr/include/c++/14/sstream:1043:45: note:   initializing argument 1 of 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::ios_base::openmode = std::ios_base::openmode]'
 1043 |       basic_stringstream(ios_base::openmode __m)
      |                          ~~~~~~~~~~~~~~~~~~~^~~
a.cc: In function 'int main()':
a.cc:59:28: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; reference = long long int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   59 |                         a[i];
      |                            ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:75:9: error: 'reverse' was not declared in this scope
   75 |         reverse(ans.begin(), ans.end());
      |         ^~~~~~~
Language: C++

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

bool test(vector<int> &K, int a, int n){
    for(int i=n;i>0;i--){
        K[i-1]-=K[i]*a;
    }
    if(!K[0]){
        for(int i=0;i<n;i++){
            K[i]=K[i+1];
        }
        K.pop_back();
        return true;
    }
    return false;
}

int main(){
    int n;
    cin.ignore();//x
    cin.ignore();//^
    cin>>n;
    vector<int> k(n+1);
    k[n]=1;
    string S;
    cin>>S;
    int i=0;
    while(true){
        int d=0;
        int f = (S[i]=='+'?1:-1);
        for(i++;S[i]!='x'&&i<S.size();i++){
            d*=10;
            d+=S[i]-'0';
        }
        d*=f;
        if(i==S.size()){
            k[0]=d;
            break;
        }else{
            i++;
            if(i<S.size()&&S[i]=='^'){
                k[S[i+1]-'0']=d;
                i+=2;
            }else{
                k[1]=d;
            }
        }
    }
    vector<int> ans;
    for(int i=n;i>0;i--){
        for(int a=-(k[0]>0?k[0]:-k[0]);a<=(k[0]>0?k[0]:-k[0]);a++){
            if(!a||k[0]%a) continue;
            vector<int> K=k;
            if(test(K,a,i)){
                k=K;
                ans.push_back(a);
                break;
            }
        }
    }
    sort(ans.begin(), ans.end());
    for(auto d:ans){
        cout<<"(x"<<(d>0?"+":"")<<d<<')';
    }
    cout<<endl;
    return 0;
}

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

 #include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long LL;
int N;
int P;
int X[111];
int Y[111];
int dp[111][111][111];
int cal(int x,int y){
    x--;y--;
    if(x==y)return max(Y[x]-X[x],0);

    int need=max(Y[x]-X[x],0);//?????\????????????????????£??????
    for(int i=x+1;i<=y;i++){
        int nX=max(0,X[i]-ans);
        need=max(Y[i]-nX,0);
    }
    return need;
}
int main(){
    cin>>N>>P;
    REP(i,N){
        cin>>X[i]>>Y[i];
    }
    //dp????????????????????????
    REP(i,111){
        REP(j,111){
            REP(k,111){
                dp[i][j][k]=-1;
            }
        }
    }
    dp[0][0][0]=P;
    
    //dp?????´??°
    REP(i,N+1){
        if(i==0)continue;
        REP(j,N+1){
            //????????????
            REP(k,i){
                dp[i][j][i]=max(dp[i][j][i],dp[i-1][j][k]);
            }
            if(j==0)continue;
            //??????
            REP(k,N+1){               
                dp[i][j][k]=max(dp[i][j][k],dp[i-1][j-1][k]-cal(k+1,i));
            }
            //????????????
            dp[i][j][i-1]=max(dp[i][j][i-1],dp[i-1][j-1][i-1]-cal(i,i));
        }
    }
    //
    int ans=0;
    REP(i,N+1){
        REP(j,N+1){
            REP(k,N+1){
                if(dp[i][j][k]!=-1){
                   ans=max(ans,j);
                }
            }
        }
    }
    
   /* REP(i,N+1){
        REP(j,N+1){
            REP(k,N+1){
                cout<<"dp[i]["<<j<<"]["<<k<<"]="<<dp[i][j][k] <<" "<<endl;;
            }
        }
        cout<<endl;
    }*/
    
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int cal(int, int)':
a.cc:17:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         int nX=max(0,X[i]-ans);
      |                           ^~~
      |                           abs
Language: C++

N,P=map(int,input().split())
xs=[]
ys=[]
dp=[[[1e9 for i in range(N+1)] for j in range(N+1)] for k in range(N+1)]
memo=[[0 for i in range(N+1)] for j in range(N+1)]
for i in range(N):
    x,y=map(int,input().split())
    xs.append(x)
    ys.append(y)

for start in range(N):
    for now in range(start,N+1):
        if(now==start):
            memo[start][now]=0
        else:
            nx=max(0,xs[now-1]-memo[start][now-1])
            memo[start][now]=memo[start][now-1]+max(0,ys[now-1]-nx)


dp[0][0][0]=0
for now in range(N):
    for l in range(now+1):
        for score in range(N):
           dp[now+1][l][score+1]=min(dp[now+1][l][score+1],dp[now][l][score]+memo[l][now+1]-memo[l][now])
           dp[now+1][now+1][score]=min(dp[now+1][now+1][score],dp[now][l][score])

ans=0
for l in range(N+1):
    for score in range(N):
        if(dp[N][l][score]<=P):
            ans=max(ans,score)


print(ans)       

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,P=map(int,input().split())
      | ^
Language: C++

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

enum Type{
	pre_yes,
	pre_no,
};

struct Info{
	Info(int arg_rest,Type arg_type){
		rest = arg_rest;
		type = arg_type;
	}
	int rest;
	Type type;
};

int dp[1000001][2],next_dp[1000001][2];

int main(){

	int N,P;
	scanf("%d %d",&N,&P);

	for(int i = 0; i <= P; i++){
		dp[i][pre_no] = -1;
		dp[i][pre_yes] = -1;

		next_dp[i][pre_no] = -1;
		next_dp[i][pre_yes] = -1;
	}

	int X[N],Y[N];
	for(int i = 0; i < N; i++){
		scanf("%d %d",&X[i],&Y[i]);
	}

	int ans = 0,minimum = P,next_minimum = P,today_value;
	vector<Info> Updated;

	dp[P][pre_no] = 0;
	dp[P][pre_yes] = 0;
	next_dp[pre_no] = 0;
	next_dp[pre_yes] = 0;

	for(int day = 0; day < N; day++){
		for(int rest = P; rest >= minimum; rest--){

			if(dp[rest][pre_no] != -1){

				if(X[day] >= Y[day]){

					next_dp[rest][pre_no] = dp[rest][pre_no]+1;
					ans = max(ans,next_dp[rest][pre_no]);
					Updated.push_back(Info(rest,pre_no));

				}else{ //X[day] < Y[day]

					if(rest >= Y[day]-X[day]){
						if(next_dp[rest-(Y[day]-X[day])][pre_yes] < dp[rest][pre_no]+1){
							next_dp[rest-(Y[day]-X[day])][pre_yes] = dp[rest][pre_no]+1;
							ans = max(ans,dp[rest][pre_no]+1);
							Updated.push_back(Info(rest-(Y[day]-X[day]),pre_yes));
							next_minimum = min(next_minimum,rest-(Y[day]-X[day]));
						}
					}
				}
			}

			if(dp[rest][pre_yes] == 0 || dp[rest][pre_yes] == -1)continue;

			today_value = max(0,X[day]-(Y[day-1]-X[day-1]));

			if(today_value >= Y[day]){
				if(next_dp[rest][pre_no] < dp[rest][pre_yes]+1){
					next_dp[rest][pre_no] = dp[rest][pre_yes]+1;
					ans = max(ans,next_dp[rest][pre_no]);
					Updated.push_back(Info(rest,pre_no));
				}
			}else{ //today_value < Y[day]

				if(next_dp[rest][pre_no] < dp[rest][pre_yes]){
					next_dp[rest][pre_no] = dp[rest][pre_yes];
					Updated.push_back(Info(rest,pre_no));
				}

				if(rest >= Y[day]-today_value){
					if(next_dp[rest-(Y[day]-today_value)][pre_yes] < dp[rest][pre_yes]+1){
						next_dp[rest-(Y[day]-today_value)][pre_yes] = dp[rest][pre_yes]+1;
						ans = max(ans,dp[rest][pre_yes]+1);
						Updated.push_back(Info(rest-(Y[day]-today_value),pre_yes));
						next_minimum = min(next_minimum,rest-(Y[day]-today_value));
					}
				}
			}
		}
		for(int k = 0; k < Updated.size(); k++){
			dp[Updated[k].rest][Updated[k].type] = next_dp[Updated[k].rest][Updated[k].type];
		}
		Updated.clear();
		minimum = next_minimum;
	}

	printf("%d\n",ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:25: error: incompatible types in assignment of 'int' to 'int [2]'
   58 |         next_dp[pre_no] = 0;
      |         ~~~~~~~~~~~~~~~~^~~
a.cc:59:26: error: incompatible types in assignment of 'int' to 'int [2]'
   59 |         next_dp[pre_yes] = 0;
      |         ~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef long long ll;
struct Edge{
	int from, to;
	ll len, rou;
	double cost;
};


struct UF{
	int n;
	vi d, r;
	UF(int n) : n(n), d(n, -1), r(n, 0){};
	int root(int i) {
		if(d[i] < 0) return i;
		return d[i] = root(d[i]);
	}
	bool same(int x, int y) {
		x = root(x);
		y = root(y);
		return x == y;
	}
	bool unite(int x, int y) {
		x = root(x);
		y = root(y);
		if(x == y) return false;

		if(r[x] < r[y]) swap(x, y);
		else if(r[x] == r[y]) r[x]++;
		d[x] += d[y];
		d[y] = x;
		return true;
	} 
	int size(int i) {
		return -d[root(i)];
	}
};

int n, m;
vi a, b, c, d;

vector<Edge> es;

bool used[100010];

int main(){
	cin >> n >> m;
	a.resize(m);
	b.resize(m);
	c.resize(m);
	d.resize(m);
	for(int i = 0; i < m; i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
		// a[i]--;
		// b[i]--;
		es.push_back({a[i], b[i], c[i], d[i], (double)d[i]/c[i]});
	}
	sort(es.begin(), es.end(), [&](const Edge& ea, const Edge& eb){
		if(abs(ea.cost-eb.cost) < EPS) {
			return ea.len > eb.len; 
		}
		else return ea.cost>eb.cost;
	});
	// for(int i = 0; i < m; i++) {
	// 	cout<<es[i].from<<" "<<es[i].to<<" "<<es[i].len<<" "<<es[i].rou<<" "<<es[i].cost<<endl;
	// }
	ll rou = 0LL, len = 0LL;
{
	UF uf(n);
	for(int i = 0; i < m; i++) {
		int from = es[i].from;
		int to = es[i].to;
		if(uf.same(from, to)) continue;
		uf.unite(from, to);
		used[i] = true;
	}
	for(int i = 0; i < m; i++) {
		if(used[i]) continue;
		rou += es[i].rou;
		len += es[i].len;
		//cout<<i<<endl;
	}
	//cout<<(double) rou/len << endl;
	if(len == 0LL) {
		cout<<0<<endl;
		return 0;
	}
}
	double ans = (double) rou / len;

		rou = 0LL;len = 0LL;
{
	UF uf(n);
	for(int i = 0; i < m; i++) {
		int from = es[i].from;
		int to = es[i].to;
		if(uf.same(from, to)) continue;
		uf.unite(from, to);
		used[i] = true;
	}
	for(int i = 0; i < m; i++) {
		if(used[i]) continue;
		rou += es[i].rou;
		len += es[i].len;
		//cout<<i<<endl;
	}
	//cout<<(double) rou/len << endl;
	if(len == 0LL) {
		cout<<0<<endl;
		return 0;
	}
}
printf("%.15lf\n", min(ans, (double) rou / len));
}

Compiler output:
a.cc: In lambda function:
a.cc:63:43: error: 'EPS' was not declared in this scope
   63 |                 if(abs(ea.cost-eb.cost) < EPS) {
      |                                           ^~~
a.cc:67:9: warning: control reaches end of non-void function [-Wreturn-type]
   67 |         });
      |         ^
Language: C++

#error "tsurai"

#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <queue>
#include <functional>

template <class T>
using pqueue=std::priority_queue<T, std::vector<T>, std::greater<T>>;

struct Edge {
  size_t a, b;
  intmax_t c, d;
  Edge(size_t a, size_t b, intmax_t c, intmax_t d): a(a), b(b), c(c), d(d) {}
};

using Graph=std::vector<std::vector<Edge>>;

bool ok(const Graph &g, double p) {
  std::vector<bool> visited(g.size());

  pqueue<std::pair<size_t, double>> q;
  q.emplace(0, 0);
  visited[0] = true;
  double res=0;
  while (!q.empty()) {
    size_t v=q.top().first;
    double w=q.top().second;
    q.pop();
    if (visited[v]) continue;
    visited[v] = true;
    res += w;

    for (const auto &e: g[v]) {
      if (visited[e.b]) continue;
      double nw=e.d-p*e.c;
      q.emplace(e.b, nw);
    }
  }

  return res < p;
}
 
int main() {
  size_t n, m;
  scanf("%zu %zu", &n, &m);

  if (n == m+1)
    return !printf("0\n");

  Graph g(n);
  for (size_t i=0; i<m; ++i) {
    size_t a, b;
    intmax_t c, d;
    scanf("%zu %zu %jd %jd", &a, &b, &c, &d);
    --a;
    --b;

    g[a].emplace_back(a, b, c, d);
    g[b].emplace_back(b, a, c, d);
  }

  double lb=0, ub=1e12;
  for (int i=0; i<200; ++i) {
    double p=0.5*(lb+ub);
    (ok(g, p)? lb:ub) = p;
  }
  printf("%.12f\n", lb);
}



Compiler output:
a.cc:1:2: error: #error "tsurai"
    1 | #error "tsurai"
      |  ^~~~~
Language: C++

16 19
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2
2 3
3 4
3 5
1 6
6 7
6 8
7 8
8 9
8 10
10 11
11 12
12 10
1 13
13 14
14 15
15 13
14 16
15 16

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

#include <map>
#include <vector>
#include <cstdlib>
using namespace std;
vector <map <int,int> > li(100000);
int n,m,k,r=2;
void dfs1(int y,int x){
  if(li[y][x]==0||li[y][x]==2) return;
  if(y==n-1||x==0){
    r=0;
    return;
  }
  li[y][x]=2;
  for(int i=-2;i<=2;i++)
    for(int j=-2;j<=2;j++)
      if(abs(i)==2||abs(j)==2)
	if(0<=y+i&&y+i<n&&0<=x+j&&x+j<m)
	  if(li[y+i][x+j]==1) li[y+i][x+j]=3;
  for(int i=-1;i<=1;i++)
    for(int j=-1;j<=1;j++)
      if(abs(i)==1||abs(j)==1)
	if(0<=y+i&&y+i<n&&0<=x+j&&x+j<m)
	  if(li[y+i][x+j]==1||li[y+i][x+j]==3) dfs1(y+i,x+j); 
}
void dfs2(int y,int x){
  if(li[y][x]==0||li[y][x]==4) return;
  if(li[y][x]==2){r=2;return;}
  if(li[y][x]==3||y==1||x==m-1){r=1;return;}
  li[y][x]=4;
  for(int i=-1;i<=1;i++)
    for(int j=-1;j<=1;j++)
      if(abs(i)==1||abs(j)==1)
	if(0<=y+i&&y+i<n&&0<=x+j&&x+j<m)
	  if(li[y+i][x+j]) dfs2(y+i,x+j); 
}
int main(){
  int y,x;
  cin>>n>>m>>k;
  for(int i=0;i<k;i++){
    cin>>y>>x;
    li[y][x]=1;
  }
  for(int i=1;i<m-1&&r==2;i++) dfs1(0,i);
  for(int i=1;i<n-1&&r==2;i++) dfs1(i,m-1);
  for(int i=1;i<m-1&&r==2;i++) dfs2(n-1,i);
  for(int i=1;i<n-1&&r==2;i++) dfs2(i,0);
  /*  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++) cout<<li[i][j]<<" ";
    cout<<endl;
    } */
  cout<<r<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: 'cin' was not declared in this scope
   38 |   cin>>n>>m>>k;
      |   ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <cstdlib>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:51:3: error: 'cout' was not declared in this scope
   51 |   cout<<r<<endl;
      |   ^~~~
a.cc:51:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:51:12: error: 'endl' was not declared in this scope
   51 |   cout<<r<<endl;
      |            ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <cstdlib>
  +++ |+#include <ostream>
    4 | using namespace std;