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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/


void make(vs& v, string s)
{
	int n = s.size();
	REP(i, n + 1)
	{
		if (i == n || isdigit(s[i]))
		{
			REP(j, 10)
			{
				string t = s;
				if (j == 0 && (i == 0 || !isdigit(s[i - 1]))) continue;
				string ins;
				ins += '0' + j;
				t.insert(i, ins);
				v.push_back(t);
			}
		}
	}
	FOR(i, 1, n)
	{
		if (isdigit(s[i-1]) && isdigit(s[i]) && s[i] != '0')
		{
			string t = s;
			t.insert(i, "+");
			v.push_back(t);
			t = s;
			t.insert(i, "-");
			v.push_back(t);
			t = s;
			t.insert(i, "*");
			v.push_back(t);
			t = s;
			t.insert(i, "&");
			v.push_back(t);
			t = s;
			t.insert(i, "|");
			v.push_back(t);
			t = s;
			t.insert(i, "^");
			v.push_back(t);
		}
	}
}

int num(const string& s, int& p)
{
	assert(isdigit(s[p]));
	int res = 0;
	while (isdigit(s[p]))
	{
		res *= 10;
		res += s[p] - '0';
		p++;
	}
	return res;
}

int btor(const string& s, int& p);

int term(const string& s, int& p)
{
	int res;
	if (s[p] == '(')
	{
		p++;
		res = btor(s, p);
		assert(s[p] == ')');
		p++;
	}
	else if (isdigit(s[p]))
	{
		res = num(s, p);
	}
	else assert(false);
	return res;
}

int mul(const string& s, int& p)
{
	int lhs = term(s, p);
	while (s[p] == '*')
	{
		p++;
		int rhs = term(s, p);
		lhs = lhs *rhs;
	}
	return lhs;
}
int plu(const string& s, int& p)
{
	int lhs = mul(s, p);
	while (s[p] == '+' || s[p] == '-')
	{
		char c = s[p];
		p++;
		int rhs = mul(s, p);
		if (c == '+') lhs = lhs + rhs;
		if (c == '-') lhs = lhs - rhs;
	}
	return lhs;
}

int btand(const string& s, int& p)
{
	int lhs = plu(s, p);
	while (s[p] == '&')
	{
		p++;
		int rhs = plu(s, p);
		lhs = lhs & rhs;
	}
	return lhs;
}
int btxor(const string& s, int& p)
{
	int lhs = btand(s, p);
	while (s[p] == '^')
	{
		p++;
		int rhs = btand(s, p);
		lhs = lhs ^ rhs;
	}
	return lhs;
}

int btor(const string& s, int& p)
{
	int lhs = btxor(s, p);
	while (s[p] == '|')
	{
		p++;
		int rhs = btxor(s, p);
		lhs = lhs | rhs;
	}
	return lhs;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n; string s, t; 
	while (cin >> n >> s, n)
	{
		vs v;
		make(v, s);
		if (n % 2 == 1)
		{
			int ans = 0;
			for (auto i : v)
			{
				int p = 0;
				chmax(ans, btor(i, p));
			}
			cout << ans << endl;
		}
		else
		{
			int ans = 0;
			for (auto i : v)
			{
				int tmp = INF;
				vs vv;
				make(vv, i);
				for (auto j : vv)
				{
					int p = 0;
					chmin(tmp, btor(j, p));
				}
				chmax(ans, tmp);
			}
			cout << ans << endl;
		}
	}
	return 0;
}???

Compiler output:
a.cc:195:2: error: expected unqualified-id before '?' token
  195 | }???
      |  ^
Language: C++

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

int main(){

	int n,t;
	int m=0;
	int k=0;
	string sn,st,an,at;
	string c="";
	cin>>n>>t;

	vector<string> name;
	map<int,string> a;

	for(int i=0;i<n;i++){
		cin>>st>>sn>>an>>at;
		if(c==sn){
		int b=((st[0]-'0')*10+(st[1]-'0'))*60+(st[3]-'0')*10+st[4]-'0';
		if(b-k>=t){
		 m++;
		 name.push_back(sn);
		a["sn"]=b-k;
		}
	}
		k=((at[0]-'0')*10+(at[1]-'0'))*60+(at[3]-'0')*10+at[4]-'0';
		c=an;
	}
	cout<<m<<endl;
	for(int i=0;i<name.length();i++){
		cout<<name[i]<<" "<<a[name[i]]<<endl;
	}
 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'map' was not declared in this scope
   16 |         map<int,string> a;
      |         ^~~
a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    3 | #include <vector>
  +++ |+#include <map>
    4 | using namespace std;
a.cc:16:13: error: expected primary-expression before 'int'
   16 |         map<int,string> a;
      |             ^~~
a.cc:25:17: error: 'a' was not declared in this scope
   25 |                 a["sn"]=b-k;
      |                 ^
a.cc:32:28: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   32 |         for(int i=0;i<name.length();i++){
      |                            ^~~~~~
a.cc:33:37: error: 'a' was not declared in this scope
   33 |                 cout<<name[i]<<" "<<a[name[i]]<<endl;
      |                                     ^
Language: C++

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

int main(){

	int n,t;
	int m=0;
	int k=0;
	string sn,st,an,at;
	string c="";
	cin>>n>>t;

	vector<string> name;
	map<string,int> a;

	for(int i=0;i<n;i++){
		cin>>st>>sn>>an>>at;
		if(c==sn){
		int b=((st[0]-'0')*10+(st[1]-'0'))*60+(st[3]-'0')*10+st[4]-'0';
		if(b-k>=t){
		 m++;
		 name.push_back(sn);
		a[sn]=b-k;
		}
	}
		k=((at[0]-'0')*10+(at[1]-'0'))*60+(at[3]-'0')*10+at[4]-'0';
		c=an;
	}
	cout<<m<<endl;
	for(int i=0;i<name.length();i++){
		cout<<name[i]<<" "<<a[name[i]]<<endl;
	}
 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   33 |         for(int i=0;i<name.length();i++){
      |                            ^~~~~~
Language: C++

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

int main(){

	int n,t;
	int m=0;
	int k=0;
	string sn,st,an,at;
	string c="";
	cin>>n>>t;

	vector<string> name;
	map<string,int> a;

	for(int i=0;i<n;i++){
		cin>>st>>sn>>an>>at;
		if(c==sn){
		int b=((st[0]-'0')*10+(st[1]-'0'))*60+(st[3]-'0')*10+st[4]-'0';
		if(b-k>=t){
		 m++;
		 name.push_back(sn);
		a[sn]=b-k;
		}
	}
		k=((at[0]-'0')*10+(at[1]-'0'))*60+(at[3]-'0')*10+at[4]-'0';
		c=an;
	}
	cout<<m<<endl;
	for(int i=0;i<neme.size();i++){
		cout<<name[i]<<" "<<a[name[i]]<<endl;
	}
 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:23: error: 'neme' was not declared in this scope; did you mean 'name'?
   33 |         for(int i=0;i<neme.size();i++){
      |                       ^~~~
      |                       name
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int a[10000], b[10000], cnt; char c;
string S[10000];
vector<int>A;
vector<string>B;
int n, m;
int main() {
	cin >> n >> m;
	for (int i = 0; i < n * 2; i++) {
		cin >> a[i] >> c >> b[i] >> S[i];
		if (i >= 1 && i % 2 == 0) {
			if ((a[i] * 60 + b[i]) - (a[i - 1] * 60 + b[i - 1]) >= m) {
				B.push_back(S[i]); A.push_back((a[i] * 60 + b[i]) - (a[i - 1] * 60 + b[i - 1));
			}
		}
	}
	cout << A.size() << endl;
	for (int i = 0; i < A.size(); i++) {
		cout << B[i] << ' ' << A[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:109: error: expected ']' before ')' token
   16 |                                 B.push_back(S[i]); A.push_back((a[i] * 60 + b[i]) - (a[i - 1] * 60 + b[i - 1));
      |                                                                                                             ^
      |                                                                                                             ]
Language: C++

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

using namespace std;
typedef pair<int, int> P;
class Data
{
public:
	string station;
	P start;
	P arrival;
};
class Ans
{
public:
	string station;
	int time;
	Ans(string station, int time) : station(station), time(time){}
};

void solve()
{
	int N, T;
	cin >> N >> T;
	vector<Data> data(N);
	for (int i = 0; i < N; ++i)
	{
		string station2;
		scanf_s("%d:%d", &data[i].start.first, &data[i].start.second);
		cin >> data[i].station;
		scanf_s("%d:%d", &data[i].arrival.first, &data[i].arrival.second);
		cin >> station2;
	}
	vector<Ans> ans;
	for (int i = 0; i < N - 1; ++i)
	{
		int startTime = data[i + 1].start.first * 60 + data[i + 1].start.second;
		int arrivalTime = data[i].arrival.first * 60 + data[i].arrival.second;
		if (startTime - arrivalTime >= T)
		{
			Ans a(data[i+ 1].station, startTime - arrivalTime);
			ans.push_back(a);
		}
	}
	if (ans.empty())
	{
		cout << 0 << endl;
		return;
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); ++i)
	{
		cout << ans[i].station << " " << ans[i].time << endl;
	}
}

int main()
{
	solve();
	return(0);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   30 |                 scanf_s("%d:%d", &data[i].start.first, &data[i].start.second);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
#define MAX_N 10
int x[MAX_N][MAX_N]; int N, A[MAX_N];
int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i]; x[i + 1][A[i]] = 1;
	}
	int P[MAX_N];
	for (int i = 1; i <= N; i++) {
		int cx = i;
		for (int j = 1; j <= N; j++) {
			if (x[j][cx] == 1) { cx++; }
			if (x[j][cx - 1] == 1) { cx--; }
		}
		P[i] = cx;
	}
	int maxn = N;
	for (int i = 0; i < (int)pow(N, N); i++) {
		int D[MAX_N], y[MAX_N][MAX_N];
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N; k++) { y[i][j] = 0; }
		}
		for (int j = 0; j < N; j++) {
			D[i] = (i / (int)(pow(N, j))) % N;
			y[D[i] + 1][A[i]]++;
		}
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N - 1; k++) {
				if (y[i][j] >= 2) { goto E; }
				if (y[i][j] == 1 || y[i][j + 1] == 1) { goto E; }
			}
		}
		int cy = 0;
		for (int j = 1; j <= N; j++) {
			cy = j;
			for (int k = 1; k <= N; k++) {
				if (x[k][cy] == 1) { cy++; }
				if (x[k][cy - 1] == 1) { cy--; }
			}
			D[j] = cy;
		}
		for (int j = 1; j <= N; j++) {
			if (P[j] != D[j]) { goto E; }
		}
		int maxv = 0;
		for (int j = 1; j <= N; j++) {
			int S = (i / (int)pow(N, j - 1)) % N;
			maxv = max(maxv, S + 1);
		}
		if (maxn > maxv) { maxn = maxv; }
	E:;
	}
	cout << maxv << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: jump to label 'E'
   55 |         E:;
      |         ^
a.cc:47:50: note:   from here
   47 |                         if (P[j] != D[j]) { goto E; }
      |                                                  ^
a.cc:49:21: note:   crosses initialization of 'int maxv'
   49 |                 int maxv = 0;
      |                     ^~~~
a.cc:55:9: error: jump to label 'E'
   55 |         E:;
      |         ^
a.cc:33:58: note:   from here
   33 |                                 if (y[i][j] >= 2) { goto E; }
      |                                                          ^
a.cc:49:21: note:   crosses initialization of 'int maxv'
   49 |                 int maxv = 0;
      |                     ^~~~
a.cc:37:21: note:   crosses initialization of 'int cy'
   37 |                 int cy = 0;
      |                     ^~
a.cc:57:17: error: 'maxv' was not declared in this scope; did you mean 'maxn'?
   57 |         cout << maxv << endl;
      |                 ^~~~
      |                 maxn
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
#define MAX_N 10
int x[MAX_N][MAX_N]; int N, A[MAX_N];
int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i]; x[i + 1][A[i]] = 1;
	}
	int P[MAX_N];
	for (int i = 1; i <= N; i++) {
		int cx = i;
		for (int j = 1; j <= N; j++) {
			if (x[j][cx] == 1) { cx++; }
			if (x[j][cx - 1] == 1) { cx--; }
		}
		P[i] = cx;
	}
	int maxn = N;
	for (int i = 0; i < (int)pow(N, N); i++) {
		int D[MAX_N], y[MAX_N][MAX_N];
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N; k++) { y[i][j] = 0; }
		}
		for (int j = 0; j < N; j++) {
			D[i] = (i / (int)(pow(N, j))) % N;
			y[D[i] + 1][A[i]]++;
		}
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N - 1; k++) {
				if (y[i][j] >= 2) { goto E; }
				if (y[i][j] == 1 || y[i][j + 1] == 1) { goto E; }
			}
		}
		int cy = 0;
		for (int j = 1; j <= N; j++) {
			cy = j;
			for (int k = 1; k <= N; k++) {
				if (x[k][cy] == 1) { cy++; }
				if (x[k][cy - 1] == 1) { cy--; }
			}
			D[j] = cy;
		}
		for (int j = 1; j <= N; j++) {
			if (P[j] != D[j]) { goto E; }
		}
		int maxv = 0, S = 0;
		for (int j = 1; j <= N; j++) {
			S = (i / (int)pow(N, j - 1)) % N;
			maxv = max(maxv, S + 1);
		}
		if (maxn > maxv) { maxn = maxv; }
	E:;
	}
	cout << maxn << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: jump to label 'E'
   55 |         E:;
      |         ^
a.cc:47:50: note:   from here
   47 |                         if (P[j] != D[j]) { goto E; }
      |                                                  ^
a.cc:49:31: note:   crosses initialization of 'int S'
   49 |                 int maxv = 0, S = 0;
      |                               ^
a.cc:49:21: note:   crosses initialization of 'int maxv'
   49 |                 int maxv = 0, S = 0;
      |                     ^~~~
a.cc:55:9: error: jump to label 'E'
   55 |         E:;
      |         ^
a.cc:33:58: note:   from here
   33 |                                 if (y[i][j] >= 2) { goto E; }
      |                                                          ^
a.cc:49:31: note:   crosses initialization of 'int S'
   49 |                 int maxv = 0, S = 0;
      |                               ^
a.cc:49:21: note:   crosses initialization of 'int maxv'
   49 |                 int maxv = 0, S = 0;
      |                     ^~~~
a.cc:37:21: note:   crosses initialization of 'int cy'
   37 |                 int cy = 0;
      |                     ^~
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
#define MAX_N 10
int x[MAX_N][MAX_N]; int N, A[MAX_N];
int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i]; x[i + 1][A[i]] = 1;
	}
	int P[MAX_N];
	for (int i = 1; i <= N; i++) {
		int cx = i;
		for (int j = 1; j <= N; j++) {
			if (x[j][cx] == 1) { cx++; }
			if (x[j][cx - 1] == 1) { cx--; }
		}
		P[i] = cx;
	}
	int maxn = N, maxv, S;
	for (int i = 0; i < (int)pow(N, N); i++) {
		int D[MAX_N], y[MAX_N][MAX_N];
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N; k++) { y[i][j] = 0; }
		}
		for (int j = 0; j < N; j++) {
			D[i] = (i / (int)(pow(N, j))) % N;
			y[D[i] + 1][A[i]]++;
		}
		for (int j = 0; j < MAX_N; j++) {
			for (int k = 0; k < MAX_N - 1; k++) {
				if (y[i][j] >= 2) { goto E; }
				if (y[i][j] == 1 || y[i][j + 1] == 1) { goto E; }
			}
		}
		int cy = 0;
		for (int j = 1; j <= N; j++) {
			cy = j;
			for (int k = 1; k <= N; k++) {
				if (x[k][cy] == 1) { cy++; }
				if (x[k][cy - 1] == 1) { cy--; }
			}
			D[j] = cy;
		}
		for (int j = 1; j <= N; j++) {
			if (P[j] != D[j]) { goto E; }
		}
		maxv = 0;
		for (int j = 1; j <= N; j++) {
			S = (i / (int)pow(N, j - 1)) % N;
			maxv = max(maxv, S + 1);
		}
		if (maxn > maxv) { maxn = maxv; }
	E:;
	}
	cout << maxn << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: jump to label 'E'
   55 |         E:;
      |         ^
a.cc:33:58: note:   from here
   33 |                                 if (y[i][j] >= 2) { goto E; }
      |                                                          ^
a.cc:37:21: note:   crosses initialization of 'int cy'
   37 |                 int cy = 0;
      |                     ^~
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int x[9][9]; int N, M, A[9], P[9], cx, pows[9][9];
int power2(int a, int b) { int res = 1; for (int i = 0; i < b; i++) { res *= a; }return res; }
int main() {
	for (int i = 0; i < 9; i++) { for (int j = 0; j < MAX_N; j++) { pows[i][j] = power2(i, j); } }
	cin >> N >> M; for (int i = 0; i < M; i++) { cin >> A[i]; x[i + 1][A[i]] = 1; }
	for (int i = 1; i <= N; i++) {
		cx = i;
		for (int j = 1; j <= M; j++) {
			if (x[j][cx] == 1) { cx++; }
			else if (x[j][cx - 1] == 1) { cx--; }
		}
		P[i] = cx;
	}
	int Q = M, maxv, S, cy;
	int D[9], F[9], y[9][9];
	for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { y[i][j] = 0; } }
	for (int i = 0; i < pows[M][M]; i++) {
		if (i >= 1) {
			for (int j = 0; j < M; j++) {
				y[D[j] + 1][A[j]] = 0;
			}
		}
		for (int j = 0; j < M; j++) {
			D[j] = (i / pows[M][j]) % M;
			y[D[j] + 1][A[j]]++;
		}
		for (int j = 0; j < M; j++) {
			if (y[D[j] + 1][A[j]] >= 2) { goto E; }
			if (y[D[j] + 1][A[j] + 1] >= 1) { goto E; }
		}
		for (int j = 1; j <= N; j++) {
			cy = j;
			for (int k = 1; k <= M; k++) {
				if (y[k][cy] == 1) { cy++; }
				else if (y[k][cy - 1] == 1) { cy--; }
			}
			F[j] = cy;
		}
		for (int j = 1; j <= N; j++) {
			if (P[j] != F[j]) {
				goto E;
			}
		}
		maxv = 0;
		for (int j = 1; j <= M; j++) {
			S = (i / pows[M][j - 1]) % M;
			maxv = max(maxv, S + 1);
		}
		if (Q > maxv) { Q = maxv; }
	E:;
	}
	cout << Q << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:59: error: 'MAX_N' was not declared in this scope
    8 |         for (int i = 0; i < 9; i++) { for (int j = 0; j < MAX_N; j++) { pows[i][j] = power2(i, j); } }
      |                                                           ^~~~~
Language: C++

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

template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }

int n, m;

vector<int> amida(const vector<int>& a) {
	vector<int> res;
	res.reserve(n);
	for(int i = 0; i < n; ++i) {
		int pos = i;
		for(int j = 0; j < m; ++j) {
			if(pos == a[j]) {
				--pos;
			}
			else if(pos + 1 == a[j]) {
				++pos;
			}
		}
		res.emplace_back(pos);
	}

	return res;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> n >> m;

	vector<int> a(m);
	for(int i = 0; i < m; ++i) {
		cin >> a[i];
	}

	vector<int> goals = amida(a);

	sort(a.begin(), a.end());
	int ans = INT_MAX;

	do {
		if(goals == amida(a)) {
			vector<int> h(n + 1, 0);
			for(int i = 0; i < m; ++i)
				h[a[i]] = max({h[a[i] - 1], h[a[i]], h[a[i] + 1]}) + 1;

			chmin(ans, *max_element(h.begin(), h.end()));
		}
	} while(next_permutation(a.begin(), a.end()));

	cout << ans << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:19: error: 'INT_MAX' was not declared in this scope
   44 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

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

int n, m;
int ans;
vector<int> p, fa;

vector<int> getPerm(const vector<int> &a){
  vector<int> res;
  for(int i = 0; i < n; i++){
    res.push_back(i);
  }
  for(int i = 0; i < m; i++){
    swap(res[a[i]], res[a[i] + 1]);
  }
  return res;
}

int getMinStep(const vector<int> &a){
  vector<int> pre;
  int res = 0;

  for(int i = 0; i < m; i++){
    bool flg = true;

    for(int j = 0; j < pre.size(); j++){
      if(pre[j] == a[i] || pre[j] == a[i] + 1 ||
         pre[j] + 1 == a[i] || pre[j] + 1 == a[i] + 1){
        flg = false;
        break;
      }
    }

    if(!flg){
      pre.clear();
      res++;
    }
    pre.push_back(a[i]);
  }
  if(pre.size() != 0){
    res++;
  }
  return res;
}

void dfs(int idx, vector<int> va, bool *used){
  if(idx == m){
    if(getPerm(va) == p){
      ans = min(ans, getMinStep(va));
    }
    return;
  }

  va.push_back(-1);

  for(int i = 0; i < m; i++){
    if(used[i]) continue;

    used[i] = true;
    va[idx] = fa[i];
    dfs(idx + 1, va, used);
    used[i] = false;
  }
}

void solve(){
  p = getPerm(fa);

  ans = m;
  bool used[100];
  memset(used, 0, sizeof(used));
  vector<int> va;
  dfs(0, va, used);

  cout << ans << endl;
}

int main(){
  while(cin >> n >> m){
    fa.clear();
    for(int i = 0; i < m; i++){
      int x;
      cin >> x;
      fa.push_back(x - 1);
    }

    solve();
  }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:72:3: error: 'memset' was not declared in this scope
   72 |   memset(used, 0, sizeof(used));
      |   ^~~~~~
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 | using namespace std;
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

    int a[m+1];
    for (int i=1; i<=m; ++i) {
        cin >> a[i];
    }

    int max_height = 0;

    int h[n+1];
    memset(h, 0, sizeof h);

    for (int i=1; i<=m; ++i) {
        h[a[i]] = max(h[a[i]-1], h[a[i]+1]) + 1;
        max_height = max(max_height, h[a[i]]);
    }

    cout << max_height;

    return 0;
}

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

#include<iostream>
#include<math.h>
using namespace std;
int main(){    
	int N,D;
	int p[50][50];
	int choice[50][50];
	int P = 0;
	int M,a;
	int room[50];
	int num[50];
	int money = 10000;
	int b = 0;
	
	cin >> N >> D;
	
	if(1 <= N && N <= 50 && 1 <= D && D <= 50){
	// ((input
	for(int m=1;m<=N;m++)
	{
		for(int n=1;n<=D;n++)
		{
			cin >> p[m][n];
			if(1 >= p[m][n] && p[m][n]>= 10000){
				break;
			}
		}
	}
	// ))input
	
	// ((minimum
	for(int n=1;n<=D;n++)
	{
		money = 10000;
		for(int m=1;m<=N;m++)
		{
			if(p[m][n] <money){
				room[n] =m;
				money = p[m][n];
			}else if(p[m][n] == money){
				if(room[n-1] == m){
				room[n]=room[n-1];
				}
				}
			}
		}
		P += money;
	}
	// ))minimum
	
	// ((move
	for(int i = 2;i <=D ;i++){
		if(room[i] != room[i-1]){
			M++;
		}
	}
	// ))move
	
	// ((result
	cout << P << " " << M<< endl;
	for(int i = 1; i  <= D ;i++){
		cout << room[i] << endl;
	}
	// ))result
	
	}
}

Compiler output:
a.cc:67:1: error: expected declaration before '}' token
   67 | }
      | ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int main(){    
	int N,D;
	int p[50][50];
	int choice[50][50];
	int P = 0;
	int M,a;
	int room[50];
	int num[50];
	int money = 10000;
	int b = 0;
	
	cin >> N >> D;
	
	if(1 <= N && N <= 50 && 1 <= D && D <= 50){
	// ((input
	for(int m=1;m<=N;m++)
	{
		for(int n=1;n<=D;n++)
		{
			cin >> p[m][n];
			if(1 >= p[m][n] && p[m][n]>= 10000){
				break;
			}
		}
	}
	// ))input
	
	// ((minimum
	for(int n=1;n<=D;n++)
	{
		money = 10000;
		b++;
		for(int m=1;m<=N;m++)
		{
			if(p[m][n] <money){
				room[n] =m;
				money = p[m][n];
			}else if(p[m][n] == money){
				if(room[n-1] == m){
				room[n]=room[n-1];
				}
				}
			}
		}
		P += money;
	}
	// ))minimum
	
	// ((move
	for(int i = 2;i <=D ;i++){
		if(room[i] != room[i-1]){
			M++;
		}
	}
	// ))move
	
	// ((result
	cout << P << " " << M<< endl;
	for(int i = 1; i  <= D ;i++){
		cout << room[i] << endl;
	}
	// ))result
	
	}
}

Compiler output:
a.cc:68:1: error: expected declaration before '}' token
   68 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define inf (1<<29)
using namespace std;

    int N, D;
    int p[50][50];
    int minp[50];
    int dp[100][100];
int main() {
    cin >> N >> D;
    int i,j;
    for (i = 0; i < N; i++) {
      for(j = 0; j < D; j++) {
        cin >> p[i][j];
      }
    }
    int sum = 0;
    for(j = 0; j < D; j++) {
      minp[j] = 1000000;
      for(i = 0; i < N; i++) {
        if(minp[j] > p[i][j]) {
          minp[j] = p[i][j];
        }
      }
      sum += minp[j];
    }

    int count_min[50];
    memset(count_min, 100, sizeof(count_min));
    for(i = 0; i < N; i++) {
      if(minp[D-1] == p[i][D-1]){
        dp[i][D-1] = 0;
      } else {
        dp[i][D-1] = 100;
      }
      for(j = 0; j < D-1; j++) {
        dp[i][j] = 100;
      }
    }
    count_min[D-1] = 0;

    for(j = D-2; j >= 0; j--) {
      for(i = 0; i < N; i++) {
        if(minp[j] != p[i][j]) continue;

        if(dp[i][j+1] == count_min[j+1]) {
          dp[i][j] = count_min[j+1];
        } else {
          dp[i][j] = count_min[j+1] + 1;
        }
        count_min[j] = min(count_min[j], dp[i][j]);
      }
    }
    int ans[50];
    int prev = -1;

    int temp;

    for(j = 0; j < D; j++) {
      for(i = N - 1; i >= 0; i--) {
        if(count_min[j] == dp[i][j]) {
          if(prev == i){
            temp = i;
            break;
          }
          temp = i;
        }
      }
      prev = temp;
      ans[j] = temp;
    }
    cout << sum << " " << count_min[0] << endl;

    for(j = 0; j < D; j++) {
      cout << ans[j] + 1 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: 'memset' was not declared in this scope
   32 |     memset(count_min, 100, sizeof(count_min));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #define REP(i,s,n) for(int i=s;i<n;i++)
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int d[50][50], p[50][50], M, n, m;
vector<int>dp[50][50]; int g[50][50];
int main() {
	cin >> n >> m; int S = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> d[i][j]; M = min(M, d[i][j]);
		}
		for (int j = 0; j < m; j++) {
			if (d[i][j] == M)p[i][j] = 1;
		}
		S += M;
	}
	for (int i = 0; i < 50; i++) {
		for (int j = 0; j < 50; j++)g[i][j] = 1 << 30;
	}
	for (int i = 0; i < n; i++) {
		if (p[0][i] == 1)dp[0][i].push_back(i);
	}
	for (int i = 1; i < m; i++) {
		for (int j = 0; j < n; j++) {
			if (p[i][j] == 0)continue;
			for (int k = 0; k < n; k++) {
				if (p[i - 1][k] == 0)continue;
				vector<int>D = dp[i - 1][k];
				D.push_back(j);
				int L = 1; if (j == k)L = 0;
				if (g[i - 1][k] + L < g[i][j]) {
					g[i][j] = g[i - 1][k] + L;
					dp[i][j] = D;
				}
				else if (g[i - 1][k] + L < g[i][j] && D < dp[i][j]) {
					dp[i][j] = D;
				}
			}
		}
	}
	cout << S << endl;
	vector<pair<int, vector<int> > >X;
	for (int i = 0; i < n; i++) {
		X.push_back(make_pair(g[n - 1][i], dp[n - 1][i]));
	}
	sort(X.begin(), X.end()); vector<int>Y = X[0].second;
	for (int i = 0; i < n; i++) {
		cout << Y[0][i] + 1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:29: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   49 |                 cout << Y[0][i] + 1 << endl;
      |                             ^
Language: C++

#include <iostream>
using namespace std;

typedef pair<int,int> P;

#define INF P(999999, 999999)

int N, D;
int p[100][100];
int rev[100][100];
P dp[100][100];

void solve(){
  memset(rev, -1, sizeof(rev));
  for(int i = 0; i <= D; i++){
    for(int j = 0; j <= N; j++){
      dp[i][j] = INF;
    }
  }

  dp[D][N] = P(0, 0);

  for(int i = D; i > 0; i--){
    for(int j = 0; j <= N; j++){
      if(dp[i][j] == INF) continue;

      for(int k = 0; k < N; k++){
        P np = dp[i][j];
        np.first += p[i - 1][k];
        np.second += (k != j);

        if(dp[i - 1][k] > np){
          dp[i - 1][k] = np;
          rev[i - 1][k] = j;
        }
      }
    }
  }

  int sj = 0;

  for(int j = 0; j < N; j++){
    if(dp[0][sj] > dp[0][j]){
      sj = j;
    }
  }

  cout << dp[0][sj].first << " " << dp[0][sj].second << endl;

  for(int i = 0; i < D; i++){
    cout << sj + 1 << endl;
    sj = rev[i][sj];
  }
}

int main(){
  while(cin >> N >> D){
    for(int i = 0; i < N; i++){
      for(int j = 0; j < D; j++){
        cin >> p[j][i];
      }
    }
    solve();
  }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(rev, -1, sizeof(rev));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: Java

import java.util.regex.Pattern;

class Main {
        public static void main(String args[]) {
                Scanner sc = new Scanner(System.in);
                String S = sc.next();
                String regex = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6})";
                Pattern p = Pattern.compile(regex);
                Matcher m = p.matcher(S);

                if (m.find()) {
                        System.out.println("VALID");
                } else {
                        System.out.println("INVALID");
                }
        }
}

Compiler output:
Main.java:5: error: cannot find symbol
                Scanner sc = new Scanner(System.in);
                ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
                Scanner sc = new Scanner(System.in);
                                 ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: cannot find symbol
                Matcher m = p.matcher(S);
                ^
  symbol:   class Matcher
  location: class Main
3 errors
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	string input;
	cin >> input;
	if (input.length < 6){
		cout << "INVALID" << endl;
		return 0;
	}
	int flag = 0;
	for (int i = 0; i < input.length; i++){
		if (input[i] >= '0'&&input[i] <= '9'){
			flag = 1;
			break;
		}
	}
	if (!flag){
		cout << "INVALID" << endl;
		return 0;
	}
	flag = 0;
	for (int i = 0; i < input.length; i++){
		if (input[i] >= 'A'&&input[i] <= 'Z'){
			flag = 1;
			break;
		}
	}
	if (!flag){
		cout << "INVALID" << endl;
		return 0;
	}
	flag = 0;
	for (int i = 0; i < input.length; i++){
		if (input[i] >= 'a'&&input[i] <= 'z'){
			flag = 1;
			break;
		}
	}
	if (!flag){
		cout << "INVALID" << endl;
		return 0;
	}
	cout << "VALID" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |         if (input.length < 6){
      |             ~~~~~~^~~~~~
      |                         ()
a.cc:14:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 |         for (int i = 0; i < input.length; i++){
      |                             ~~~~~~^~~~~~
      |                                         ()
a.cc:25:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   25 |         for (int i = 0; i < input.length; i++){
      |                             ~~~~~~^~~~~~
      |                                         ()
a.cc:36:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   36 |         for (int i = 0; i < input.length; i++){
      |                             ~~~~~~^~~~~~
      |                                         ()
Language: C++

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

int main(){
  string str;
  int a=0,b=0,c=0,d=0;
  cin>>str;

  if(str.size()>=6){
    d=1;
    for(int i=0;i<str.size();++i){
      if(str.at[i]>='A'||str.at(i)<='Z')
        a=1;
      if(str.at[i]>='a'||str.at(i)<='z')
        b=1;
      if(str.at[i]>='0'||str.at(i)<='9')
        c=1;
    }
  }

  if(a==1&&b==1&&c==1&&d==1)
    cout<<"VALID"<<endl;
  else
    cout<<"INVALID"<<endl;
  return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |       if(str.at[i]>='A'||str.at(i)<='Z')
      |                ^
a.cc:14:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |       if(str.at[i]>='a'||str.at(i)<='z')
      |                ^
a.cc:16:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |       if(str.at[i]>='0'||str.at(i)<='9')
      |                ^
Language: C++

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

bool c, d, e;
int main() {
	char a[20];
	scanf("%s", a);
	int b = strlen(a);
	for (int i = 0; i < b; i++) {
		if (a[i] >= '0'&&a[i] <= '9')c = true;
		else if (a[i] >= 'a'&&a[i] <= 'z')d = true;
		else if (a[i] >= 'A'&&a[i] <= 'Z')e = true;
	}
	if (b >= 6 && c&&d&&e)puts("VALID");
	else puts("INVALID");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'strlen' was not declared in this scope
   10 |         int b = strlen(a);
      |                 ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

int main(int argc, char *argv[]){
  int n, t;
  string s;
  cin >> n >> t >> s;
  vector<int> p;
  for (int i = 2; i < s.length(); i+=4) {
    char tmp = s[i];
    p.push_back(atoi(&tmp));
  }
  long long int ans = 1;

  for (int i = 0; i < p.size(); i++) {
    try{
      if(ans > 1e9)throw "error";
      ans += pow(n, p[i])*t;
    }catch(const char* s){
      std::cout << "TLE" << std::endl;
      return 0;
    }
  }
  std::cout << ans << std::endl;

  return 0;
}

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

import java.util.Scanner;

public class Main {
	static String fn;
	static int id;
	static int n;
	
	static int poly() {
		int res = mono();
		if(fn.charAt(id) == '+') {
			id++;
			res += poly();
		}
		return res;
	}
	
	static int mono() {
		int res;
		int temp = 1;
		if(fn.charAt(id) == 'n' && fn.charAt(id+1) == '^') {
			id += 2;
			res = num();
			for(int i=0; i<res; i++) {
				temp *= n;
				if(temp > 1000000000)	return 100000000;
			}
			
		}
		return temp; 
	}
	
	static int num() {
		int res = 0;
		if('0' <= fn.charAt(id) && fn.charAt(id) <='9') {
			res *= 10;
			res += fn.charAt(id) - '0';
			if(id != fn.length()-1)	id++;
 		}
		return res;
		
	}
	
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			n = sc.nextInt();
			int T = sc.nextInt();
			fn = sc.next();
			id = 0;
			int total = poly() * T;
			if(total < 1000000000) {
				System.out.println(total);	
			}else {
				System.out.println("TLE");	
			}
			
		}
	}
}




Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C

#include<stdio.h>
int strint(char* a){
  int n,i;
  for(i=n=0;a[i];i++)n=n*10+a[i]-'0';
  return n;
}
int main(){
  char s[15];
  int i,n,c,m;
  scanf("%s",s);
  for(i=n=c=0;s[i];i++){
    if(s[i]-'0'){
      m=strint(s+i);
      if(m>n)c+=1-(m-n)%2;
    }//printf("%d %d\n",n,m);
    n=n*10+s[i]-'0';
  }
  printf("%d\n",c);
  return 0;#include<stdio.h>
int strint(char* a){
  int n,i;
  for(i=n=0;a[i];i++)n=n*10+a[i]-'0';
  return n;
}
int main(){
  char s[15];
  int i,n,c,m;
  scanf("%s",s);
  for(i=n=c=0;s[i];i++){
    if(s[i]-'0'){
      m=strint(s+i);
      if(m>n)c+=1-(m-n)%2;
    }//printf("%d %d\n",n,m);
    n=n*10+s[i]-'0';
  }
  printf("%d\n",c);
  return 0;
}

}

Compiler output:
main.c: In function 'main':
main.c:19:12: error: stray '#' in program
   19 |   return 0;#include<stdio.h>
      |            ^
main.c:19:13: error: 'include' undeclared (first use in this function)
   19 |   return 0;#include<stdio.h>
      |             ^~~~~~~
main.c:19:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:21: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   19 |   return 0;#include<stdio.h>
      |                     ^~~~~
      |                     stdin
main.c:20:1: error: expected expression before 'int'
   20 | int strint(char* a){
      | ^~~
Language: C++

int main(){
  int co=0;
  string a;
  cin >> a;
  string b="";
  while(a!=""){
    //cout << 1 << endl;;
    stringstream ssa(a);
    long long  ai;
    ssa>>ai;
    if(a=="")ai=0;
    stringstream ssb(b);
    long long bi;
    ssb>>bi;
    if(b=="")bi=0;
    if((ai+bi)%2==0){
      long long x=(ai+bi)/2;
      //cout << x <<" ";
      if(x-bi==ai-x&&x-bi>=0){
	
	co++;
	//cout << "o" << " ";
      }
    }
    while(1){
      //cout << 2 << endl;
      b+=a[0];
      if(a[1]=='0'||a[0]=='-'){
	a.erase(a.begin());
	continue;
      }
      a.erase(a.begin());
      //cout << bi << " "<< ai<< endl;
      break;
    }
  }
  cout << co << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string a;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> a;
      |   ^~~
a.cc:4:10: error: 'a' was not declared in this scope
    4 |   cin >> a;
      |          ^
a.cc:5:9: error: expected ';' before 'b'
    5 |   string b="";
      |         ^~
      |         ;
a.cc:8:5: error: 'stringstream' was not declared in this scope
    8 |     stringstream ssa(a);
      |     ^~~~~~~~~~~~
a.cc:10:5: error: 'ssa' was not declared in this scope
   10 |     ssa>>ai;
      |     ^~~
a.cc:12:17: error: expected ';' before 'ssb'
   12 |     stringstream ssb(b);
      |                 ^~~~
      |                 ;
a.cc:14:5: error: 'ssb' was not declared in this scope
   14 |     ssb>>bi;
      |     ^~~
a.cc:15:8: error: 'b' was not declared in this scope; did you mean 'bi'?
   15 |     if(b=="")bi=0;
      |        ^
      |        bi
a.cc:27:7: error: 'b' was not declared in this scope; did you mean 'bi'?
   27 |       b+=a[0];
      |       ^
      |       bi
a.cc:37:3: error: 'cout' was not declared in this scope; did you mean 'co'?
   37 |   cout << co << endl;
      |   ^~~~
      |   co
a.cc:37:17: error: 'endl' was not declared in this scope
   37 |   cout << co << endl;
      |                 ^~~~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  long double M, cD, cR, rD, rR, D, R;
  cin >> M >> rD >> rR >> cD >> cR;

  D = cD * 100 / rD;
  D = round(D);
  R = cR * 100 / rR;
  R = round(R);

  (long)M = M - D - R;
  if(M < 0)
    cout << -1 << endl;
  else
    cout << M << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: lvalue required as left operand of assignment
   14 |   (long)M = M - D - R;
      |   ^~~~~~~
Language: C++

#include<deque>
#include<stack>
#include<queue>
#include<sstream>
#include<cstdlib>
#define INF 16777216
typedef long long llong;
using namespace std;

llong EN2D(llong,llong);
llong EN2R(llong,llong);
llong D2EN(llong,llong);
llong R2EN(llong,llong);
int main(){
  llong M,Cd,Cr,MD,MR,RA,DA;
  int rD,rR;
  cin >> M >> rD >> rR >> Cd >> Cr;
  
  MD=D2EN(Cd,rD);
  MR=R2EN(Cr,rR);
  if(M<MD+MR){
    cout<<-1<<endl;
  }else{
    DA=D2EN( EN2D(10000,rD),rD);
    RA=R2EN( EN2R(10000,rR),rR);
    cout<<M-MD-MR<<endl;
  }

  return 0;
}

llong EN2D(llong x,llong rD){
  return (rD*x)/100 + ((rD*x)%100>0);
}
llong EN2R(llong x,llong rR){
  return (rR*x)/100 + ((rR*x)%100>0);
}
llong D2EN(llong x,llong rD){
  return (100*x)/rD + ((100*x)%rD>0);
}
llong R2EN(llong x,llong rR){
  return (100*x)/rR + ((100*x)%rR>0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'cin' was not declared in this scope
   17 |   cin >> M >> rD >> rR >> Cd >> Cr;
      |   ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<cstdlib>
  +++ |+#include <iostream>
    6 | #define INF 16777216
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout<<-1<<endl;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<M-MD-MR<<endl;
      |     ^~~~
a.cc:26:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

using namespace std;

namespace {

    typedef double real;
    typedef long long ll;

    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        if (vs.empty()) return os << "[]";
        os << vs[0];
        for (int i = 1; i < vs.size(); i++) os << " " << vs[i];
        return os;
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }

    struct Point {
        real x, y;
        Point(real x, real y) : x(x), y(y) {}
    };
    real dist(const Point& p, const Point& q) {
        real dx = p.x - q.x;
        real dy = p.y - q.y;
        return sqrt(dx*dx + dy*dy);
    }
    ostream& operator<<(ostream& os, const Point& p) {
        return os << "(" << p.x << "," << p.y << ")";
    }

    real heron(real a, real b, real c) {
        real s = (a + b + c) / 2.0;
        return sqrt(s * (s - a) * (s - b) * (s - c));
    }

    const real M_PI = acos(-1);

    real R, X, Y;
    int  N;
    vector<real> P;
    void input() {
        cin >> R >> X >> Y >> N;
        P.clear(); P.resize(N);
        cin >> P;
    }

    void solve() {
        real theta = 0;
        const Point O(0, 0);
        const Point Z(X, Y);
        vector<int> ans;
        for (int i = 0; i < N; i++) {
            real diff_area = 0;
            for (int j = 1; j <= P[i]; j++) {
                Point s(R * sin(theta), R * cos(theta));
                theta += 1.0 / 100 * 2 * M_PI;
                Point t(R * sin(theta), R * cos(theta));
                diff_area += - heron(dist(O, s), dist(s, t), dist(t, O)) + heron(dist(Z, s), dist(s, t), dist(t, Z));
            }
            real org_area = R * R * M_PI * (P[i] / 100);
            real mod_area = org_area + diff_area;
            ans.push_back(int(100 * mod_area / org_area));
        }
        cout << ans << endl;
    }
}

int main() {
    input(); solve();
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
a.cc:40:16: error: expected unqualified-id before numeric constant
   40 |     const real M_PI = acos(-1);
      |                ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
long double r, x, y, p[100], PI = 3.14159265358979l; int n;
struct Point { long double px, py; };
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double area(vector<Point> v) {
	long double ret = 0.0L;
	for (int i = 0; i < v.size(); i++) ret += crs(v[i], v[(i + 1) % v.size()]);
	return ret / 2;
}
int main() {
	cin >> r >> x >> y >> n; long double s = 450.0l;
	for (int i = 0; i < n; i++) { cin >> p[i]; p[i] *= 3.6l; }
	for (int i = 0; i < n; i++) {
		if (i)cout << ' ';
		long double W1 = r*r*(p[i] / 360.0l)*PI;
		long double W3 = -p[i];
		Point p1 = { 0,0 };
		Point p2 = { r*sin(s*PI / 180.0l),r*cos(s*PI / 180.0l) };
		Point p3 = { x,y }; s += W3;
		Point p4 = { r*sin(s*PI / 180.0l),r*cos(s*PI / 180.0l) };
		long double W2 = area(vector<Point>{p1, p2, p3, p4});
		cout << (int)(100.0l*(W1 + W2) / W1);
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: 'sin' was not declared in this scope
   20 |                 Point p2 = { r*sin(s*PI / 180.0l),r*cos(s*PI / 180.0l) };
      |                                ^~~
a.cc:20:53: error: 'cos' was not declared in this scope; did you mean 'crs'?
   20 |                 Point p2 = { r*sin(s*PI / 180.0l),r*cos(s*PI / 180.0l) };
      |                                                     ^~~
      |                                                     crs
Language: C++

#include <iostream>
using namespace std;
const double pi = acos(-1);
int r, x, y, n, p[109]; double sum[109], cx[109], cy[109];
int main() {
	cin >> r >> x >> y >> n;
	for (int i = 0; i < n; i++) {
		cin >> p[i];
		sum[i + 1] = sum[i] + p[i] * 0.02 * pi;
	}
	for (int i = 0; i <= n; i++) {
		cx[i] = cos(sum[i]) * r;
		cy[i] = sin(sum[i]) * r;
	}
	for (int i = 0; i < n; i++) {
		double pre = r * r * pi * p[i] * 0.01;
		double a1 = (y * cx[i] - x * cy[i]) * 0.5;
		double a2 = (x * cy[i + 1] - y * cx[i + 1]) * 0.5;
		cout << (int)((pre + a1 + a2) / pre * 100) << endl;
	}
	return 0;
}

Compiler output:
a.cc:3:19: error: 'acos' was not declared in this scope
    3 | const double pi = acos(-1);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:12:25: error: 'cos' was not declared in this scope
   12 |                 cx[i] = cos(sum[i]) * r;
      |                         ^~~
a.cc:13:25: error: 'sin' was not declared in this scope
   13 |                 cy[i] = sin(sum[i]) * r;
      |                         ^~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
const int SP = 8192;
int main() {
	long long int N, K;long long int  X0; cin >> N >> K >> X0;
	unsigned long long int x = X0;
	if (N < 1e6) {

		vector<long long int>nums(N);
		for (int i = 0; i < N; ++i) {
			nums[i] = long long int(x);
			x ^= x << 13;
			x ^= x >> 7;
			x ^= x << 17;
		}
		sort(nums.begin(), nums.end());
		cout << nums[K - 1] << endl;
	}
	else {
		int num = K * SP / N;
		int minnum = max(0, num - 5);
		int maxnum = min(SP, num + 5);
		vector<long long int>nums;
		int lower = 0;
		for (int i = 0; i < N; ++i) {
			long long int u =  -(LLONG_MAX)+ (ULLONG_MAX / SP * minnum) -1;
			long long int d =  - (LLONG_MAX)+(ULLONG_MAX / SP * maxnum) - 1;
			if (long long int(x) <= u) {
				lower++;
			}
			else if (long long int(x) <= d) {
				nums.push_back(static_cast<long long int>(x));
			}

			x ^= x << 13;
			x ^= x >> 7;
			x ^= x << 17;
		}

		sort(nums.begin(), nums.end());
		cout << nums[K - 1-lower] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:35: error: expected primary-expression before 'long'
   11 |                         nums[i] = long long int(x);
      |                                   ^~~~
a.cc:28:29: error: expected primary-expression before 'long'
   28 |                         if (long long int(x) <= u) {
      |                             ^~~~
a.cc:28:29: error: expected ')' before 'long'
   28 |                         if (long long int(x) <= u) {
      |                            ~^~~~
      |                             )
a.cc:31:34: error: expected primary-expression before 'long'
   31 |                         else if (long long int(x) <= d) {
      |                                  ^~~~
a.cc:31:34: error: expected ')' before 'long'
   31 |                         else if (long long int(x) <= d) {
      |                                 ~^~~~
      |                                  )