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

#include<bits/stdc++.h>
using namespace std;
string s;
int d=0,f=0;
dfs(){
  if(s[d]=='m')d++,dfs();
  if(s[d]=='e')d++,dfs();
  if(d!=s.size()&&s[d]!='w')f=1;
  else if(d!=s.size())d++;
}
main(){
  cin>>s;
  dfs();
  if(d==s.size()&&!f)cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;
}

Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
    5 | dfs(){
      | ^~~
a.cc: In function 'int dfs()':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
a.cc: At global scope:
a.cc:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
Language: C++

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

#define CK(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)
#define F first
#define S second
#define ll long long

const int INF = 1e9;
const long long  LLINF = 1e15;

using namespace std;

string S;
/*  solution_1
int ind;
int state = 0;
bool parse(){
  if(ind == S.size()) return false;
  bool ret = true;
  if(S[ind] == 'm'){
    ind++;
    while(S[ind]!='w'){
      state = 1;
      bool tmp = parse();
      if(!tmp) return false;
    }
    ind++;
  }else if(state == 1 && S[ind] == 'e'){
    state = 2;
    ind++;
    ret = true;
  }else if(state == 2 && S[ind] == 'w'){
    state = 0;
    ind++;
    ret = true;
  }else{
    ret = false;
  }
  return ret;
}
*/

//solution_2
int parse(int p){
  if(S[p] != 'm'){
    return parse(p+1);
  }
  p++;
  if(S[p] != 'e'){
    return parse(p+1);
  }
  p++;
  if(S[p] != 'w'){
    return true;
  }else
    return false
  }
}

int main(){
  cin>>S;

  /*  solution_1
  ind = 0;
  if(parse() && ind == S.size()) cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;
  */

  //solution_1
  if(parse(0) == S.size()-1) cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int parse(int)':
a.cc:70:17: error: expected ';' before '}' token
   70 |     return false
      |                 ^
      |                 ;
   71 |   }
      |   ~              
a.cc: At global scope:
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
Language: C++

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

bool Search(string &s,vector<vector<int>>&dp, int l, int r) {
	if (dp[l][r] == 1)return true;
	if (dp[l][r] == -1)return false;
	if ((r - l + 1) % 3) {
		dp[l][r] = -1;
		return false;
	}
	if (r < l) {
		dp[l][r] = 1;
		return true;
	}
	if (r - l + 1 == 3) {
		if (s[l] == 'm'&&s[l + 1] == 'e'&&s[r] == 'w') {
			dp[l][r] = 1;
			return true;
		}
		dp[l][r] = -1;
		return false;
	}
	if (s[l] != 'm' || s[r] != 'w') {
		dp[l][r] = -1;
		return false;
	}
	bool ret = false;
	for (int i = l + 1; i < r; i++) {
		if (s[i] == 'e') {
			bool bag = true;
			bag &= Search(s, l + 1, i - 1);
			bag &= Search(s, i + 1, r - 1);
			ret |= bag;
		}
	}
	if (ret)dp[l][r] = 1;
	else dp[l][r] = -1;
	return ret;
}

long long int N, M, K, H, W, L, R, V, E;

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

	string s;
	cin >> s;
	vector<vector<int>>dp(s.size(), vector<int>(s.size()));
	if (Search(s, dp,0, s.size() - 1))cout << "Cat\n";
	else cout << "Rabbit\n";
	return 0;
}



Compiler output:
a.cc: In function 'bool Search(std::string&, std::vector<std::vector<int> >&, int, int)':
a.cc:50:44: error: invalid initialization of non-const reference of type 'std::vector<std::vector<int> >&' from an rvalue of type 'int'
   50 |                         bag &= Search(s, l + 1, i - 1);
      |                                          ~~^~~
a.cc:23:43: note: in passing argument 2 of 'bool Search(std::string&, std::vector<std::vector<int> >&, int, int)'
   23 | bool Search(string &s,vector<vector<int>>&dp, int l, int r) {
      |                       ~~~~~~~~~~~~~~~~~~~~^~
a.cc:51:44: error: invalid initialization of non-const reference of type 'std::vector<std::vector<int> >&' from an rvalue of type 'int'
   51 |                         bag &= Search(s, i + 1, r - 1);
      |                                          ~~^~~
a.cc:23:43: note: in passing argument 2 of 'bool Search(std::string&, std::vector<std::vector<int> >&, int, int)'
   23 | bool Search(string &s,vector<vector<int>>&dp, int l, int r) {
      |                       ~~~~~~~~~~~~~~~~~~~~^~
Language: C++

#!/usr/bin/env python

S = raw_input()

def func(lst):
    if type(lst) == type(0):
        return True
    if len(lst) > 2:
        return False
    ret = True
    for l in lst:
        ret = (ret or func(l))
    return ret

S = S.replace('mew', '[1]')
S = S.replace('me', 'm[1]e')
S = S.replace('m', '[')
S = S.replace('e', ',')
S = S.replace('w', ']')

try:
    exec('piyo = ' + S)
except:
    print 'Rabbit'
    exit()
if func(piyo):
    print 'Cat'
else:
    print 'Rabbit'



Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:15:15: warning: multi-character character constant [-Wmultichar]
   15 | S = S.replace('mew', '[1]')
      |               ^~~~~
a.cc:15:22: warning: multi-character character constant [-Wmultichar]
   15 | S = S.replace('mew', '[1]')
      |                      ^~~~~
a.cc:16:15: warning: multi-character character constant [-Wmultichar]
   16 | S = S.replace('me', 'm[1]e')
      |               ^~~~
a.cc:16:21: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   16 | S = S.replace('me', 'm[1]e')
      |                     ^~~~~~~
a.cc:22:10: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   22 |     exec('piyo = ' + S)
      |          ^~~~~~~~~
a.cc:24:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   24 |     print 'Rabbit'
      |           ^~~~~~~~
a.cc:27:11: warning: multi-character character constant [-Wmultichar]
   27 |     print 'Cat'
      |           ^~~~~
a.cc:29:11: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   29 |     print 'Rabbit'
      |           ^~~~~~~~
a.cc:3:1: error: 'S' does not name a type
    3 | S = raw_input()
      | ^
Language: C++

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

string s;
int memo[501][501];

bool is_cat(int l, int r) {
	if(memo[l][r] != -1)
		return memo[l][r];

	if(l == r)
		return memo[l][r] = true;

	if(s[l] != 'm' || s[r - 1] != 'w')
		return memo[l][r] = false;

	int pos = l;
	while((pos = s.find('e', pos + 1)) != s.npos && pos < r - 1) {
		if(is_cat(l + 1, pos) && is_cat(pos + 1, r - 1))
			return memo[l][r] = true;
	}

	return memo[l][r] = false;
}

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

	memset(memo, -1, sizeof(memo));

	cin >> s;
	cout << (is_cat(0, s.size()) ? "Cat" : "Rabbit") << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   28 |         cin.tie(false);
      |         ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:31:9: error: 'memset' was not declared in this scope
   31 |         memset(memo, -1, sizeof(memo));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <stack>

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

using namespace std;


void catChecker(string str){

	stack<int> cnt;
	rep(i,0,str.size()){
		char c=str.at(i);
		if(c=='m'){
			cnt.push(0);
		}else if(c=='e'){
			int t=cnt.top();
			t++;
			cnt.pop();
			cnt.push(t);
		}else if(c=='w' && cnt.top()==1){
			cnt.pop();
		}else{
			cout << "Rabbit" << endl;
			return 0;
		}
		
		if(i<str.size()-1 && cnt.empty()){
			cout << "Rabbit" << endl;
			return 0;
		}
	}
	if(cnt.empty())
		cout << "Cat" << endl;
	else
		cout << "Rabbit" << endl;
}

int main(void){

	string str;

	while(cin>>str)
		catChecker(str);

	return 0;
}

Compiler output:
a.cc: In function 'void catChecker(std::string)':
a.cc:25:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   25 |                         return 0;
      |                                ^
a.cc:30:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   30 |                         return 0;
      |                                ^
Language: C++

#include <iostream>
#include <stack>

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

using namespace std;

void catChecker(string str){
	cout << Cat << endl;
	return ;
	stack<int> cnt;
	rep(i,0,str.size()){
		char c=str.at(i);
		if(c=='m'){
			cnt.push(0);
		}else if(c=='e'){
			int t=cnt.top();
			t++;
			cnt.pop();
			cnt.push(t);
		}else if(c=='w' && cnt.top()==1){
			cnt.pop();
		}else{
			cout << "Rabbit" << endl;
			return ;
		}
		
		if(i<str.size()-1 && cnt.empty()){
			cout << "Rabbit" << endl;
			return ;
		}
	}
	if(cnt.empty())
		cout << "Cat" << endl;
	else
		cout << "Rabbit" << endl;
	return ;
}

int main(void){

	string str;

	while(cin>>str)
		catChecker(str);

	return 0;
}

Compiler output:
a.cc: In function 'void catChecker(std::string)':
a.cc:9:17: error: 'Cat' was not declared in this scope
    9 |         cout << Cat << endl;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>  
using namespace std;
 
map<string, bool> memo;
 
bool parse(string s) {
  if(memo.find(s) != memo.end()) return memo[s];
  if(s == "") return 1;
  int const size = s.size();
    
  bool ok = 0;
  for(int i=1; i<size; i++) {
    if(s[i] == 'e') {
      if(parse(temp = s.substr(1, i-1))
	 && parse(temp = s.substr(i+1, size-i-2))
      ) return 1;
    }
  }
  return memo[s] = 0;
}
  
string checker(string s) {
  return parse(s) ? "Cat" : "Rabbit"; 
}
  
int main() {
  string s; cin >> s;
    
  cout << checker(s) << endl;
    
  return 0;
}
/*
以下は無駄なことしてて2秒くらいかかるコード
bool parse(string s) {
  if(memo.find(s) != memo.end()) return memo[s];
  if(s == "") return true;
  int const size = s.size();
    
  bool ok = 0;
  for(int i=1; i<size; i++) {
    if(s[i] == 'e') {
      string temp;
      string t = "m";
      if(i-1>=0) {
        if(parse(temp = s.substr(1, i-1))) t+=temp;
        else continue;
      }
      t += "e";
      if(size-i-2>=0) {
        if(parse(temp = s.substr(i+1, size-i-2))) t+=temp;
        else continue;
      }
      t +="w";
      ok |= s == t;
    }
  }
  return memo[s] = ok;
}
*/ 

Compiler output:
a.cc: In function 'bool parse(std::string)':
a.cc:14:16: error: 'temp' was not declared in this scope; did you mean 'tm'?
   14 |       if(parse(temp = s.substr(1, i-1))
      |                ^~~~
      |                tm
Language: C++

#include <queue>
#include <vector>
#include <utility>
#include <iostream>
#include <algorithm>

#define INF (1 << 29)

using namespace std;

int V, E, A, B;

vector<vector<int> > City;
vector<vector<int> > CitySet;

vector<int> CityType;
vector<int> Bipartite;

int main()
{
	// ------ Graph Construction ------ //

	cin >> V >> E;

	City = vector<vector<int> >(V);

	for (int i = 0; i < E; i++)
	{
		cin >> A >> B;

		City[A - 1].push_back(B - 1);
		City[B - 1].push_back(A - 1);
	}


	// ------ Shortest Path ------ //

	vector<int> Bipartite(V, 2); // 0 --> 0, 1 --> 1, 2 --> Unknown

	for (int i = 0; i < V; i++)
	{
		if (Bipartite[i] == 2)
		{
			CitySet.push_back(vector<int>());

			vector<int> D(V, INF); D[i] = 0;

			priority_queue<pair<int, int> > que; que.push(make_pair(0, i));

			while (!que.empty())
			{
				pair<int, int> p1 = que.top(); que.pop();

				int u = p1.second;

				CitySet.back().push_back(u);

				Bipartite[u] = (p1.first * (-1)) % 2;

				if (D[u] < p1.first * (-1)) { continue; }

				for (int j = 0; j < City[u].size(); j++)
				{
					int v = City[u][j];

					if (D[v] > D[u] + 1)
					{
						D[v] = D[u] + 1;

						que.push(make_pair(D[v] * (-1), v));
					}
				}
			}
		}
	}


	// ------ Minus One ------ //

	for (int i = 0; i < V; i++)
	{
		for (int j = 0; j < City[i].size(); j++)
		{
			if (Bipartite[i] == Bipartite[City[i][j]])
			{
				cout << -1 << endl; goto Exit;
			}
		}
	}

	
	// ------ Search ------ //

	long long count = 0;

	for (int i = 0; i < CitySet.size(); i++)
	{
		vector<long long> F(2, 0);

		for (int j = 0; j < CitySet[i].size(); j++)
		{
			F[Bipartite[CitySet[i][j]]]++;
		}

		count += F[0] * F[1];
	}

	count -= E;

	CityType = vector<int>(2, 0);

	for (int i = 0; i < City[0].size(); i++)
	{
		CityType[Bipartite[City[0][i]]]++;
	}

	for (int i = 1; i < CitySet.size(); i++)
	{
		vector<int> CityType2(CityType.begin(), CityType.end());

		if (CityType2[CitySet[i][0]] < CityType2[(CitySet[i][0] + 1) % 2])
		{
			for (int j = 0; j < CitySet[i].size(); j++)
			{
				Bipartite[CitySet[i][j]] = (Bipartite[CitySet[i][j]] + 1) % 2; // Graph Reverse
			}
		}

		count += CityType2[Bipartite[CitySet[i][0]]]; CityType[Bipartite[CitySet[i][0]]]++;

		for (int j = 1; j < CitySet[i].size(); j++)
		{
			count += max(CityType[0], CityType[1]);
		}
	}

	cout << count << endl;

Exit:;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:139:1: error: jump to label 'Exit'
  139 | Exit:;
      | ^~~~
a.cc:86:58: note:   from here
   86 |                                 cout << -1 << endl; goto Exit;
      |                                                          ^~~~
a.cc:94:19: note:   crosses initialization of 'long long int count'
   94 |         long long count = 0;
      |                   ^~~~~
Language: C++

#include <queue>
#include <vector>
#include <utility>
#include <iostream>
#include <algorithm>

#define INF (1 << 29)

using namespace std;

int V, E, A, B;

vector<vector<int> > City;
vector<vector<int> > CitySet;

vector<int> CityType;
vector<int> Bipartite;

long long count_;

int main()
{
	// ------ Graph Construction ------ //

	cin >> V >> E;

	City = vector<vector<int> >(V);

	for (int i = 0; i < E; i++)
	{
		cin >> A >> B;

		City[A - 1].push_back(B - 1);
		City[B - 1].push_back(A - 1);
	}


	// ------ Shortest Path ------ //

	vector<int> Bipartite(V, 2); // 0 --> 0, 1 --> 1, 2 --> Unknown

	for (int i = 0; i < V; i++)
	{
		if (Bipartite[i] == 2)
		{
			CitySet.push_back(vector<int>());

			vector<int> D(V, INF); D[i] = 0;

			priority_queue<pair<int, int> > que; que.push(make_pair(0, i));

			while (!que.empty())
			{
				pair<int, int> p1 = que.top(); que.pop();

				int u = p1.second;

				CitySet.back().push_back(u);

				Bipartite[u] = (p1.first * (-1)) % 2;

				if (D[u] < p1.first * (-1)) { continue; }

				for (int j = 0; j < City[u].size(); j++)
				{
					int v = City[u][j];

					if (D[v] > D[u] + 1)
					{
						D[v] = D[u] + 1;

						que.push(make_pair(D[v] * (-1), v));
					}
				}
			}
		}
	}


	// ------ Minus One ------ //

	for (int i = 0; i < CitySet[0].size(); i++)
	{
		for (int j = 0; j < City[CitySet[0][i]].size(); j++)
		{
			if (Bipartite[CitySet[0][i]] == Bipartite[City[CitySet[0][i]][j]])
			{
				cout << -1 << endl; goto Exit;
			}
		}
	}

	
	// ------ Search ------ //

	count_ = 0;

	for (int i = 0; i < CitySet.size(); i++)
	{
		vector<long long> F(2, 0);

		for (int j = 0; j < CitySet[i].size(); j++)
		{
			F[Bipartite[CitySet[i][j]]]++;
		}

		count_ += F[0] * F[1];
	}

	count_ -= E;

	CityType = vector<int>(2, 0);

	for (int i = 0; i < CitySet[0].size(); i++)
	{
		CityType[Bipartite[CitySet[0][i]]]++;
	}

	long long ret = 0;

	for (int bits = 0; bits < (1 << (CitySet.size() - 1)); bits++)
	{
		long long crt = 0;

		for (int i = 1; i < CitySet.size(); i++)
		{
			vector<int> CityType2(CityType.begin(), CityType.end());

			vector<int> Bipartite2(Bipartite.begin(), Bipartite.end());

			if (bits & (1 << (i - 1)))
			{
				for (int j = 0; j < CitySet[i].size(); j++)
				{
					Bipartite2[CitySet[i][j]] = (Bipartite2[CitySet[i][j]] + 1) % 2; // Graph Reverse
				}
			}

			crt += CityType2[(Bipartite2[CitySet[i][0]] + 1) % 2]; CityType[Bipartite2[CitySet[i][0]]]++;

			for (int j = 1; j < CitySet[i].size(); j++)
			{
				crt += CityType2[(Bipartite2[CitySet[i][j]] + 1) % 2];

				CityType[Bipartite2[CitySet[i][j]]]++;
			}
		}

		ret = max(ret, crt);
	}

	cout << count_ + ret << endl;

Exit:;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:154:1: error: jump to label 'Exit'
  154 | Exit:;
      | ^~~~
a.cc:88:58: note:   from here
   88 |                                 cout << -1 << endl; goto Exit;
      |                                                          ^~~~
a.cc:119:19: note:   crosses initialization of 'long long int ret'
  119 |         long long ret = 0;
      |                   ^~~
Language: C++

#include <queue>
#include <vector>
#include <utility>
#include <iostream>
#include <algorithm>

#define INF (1 << 29)

using namespace std;

int V, E, A, B;

vector<vector<int> > City;
vector<vector<int> > CitySet;

vector<int> CityType;
vector<int> Bipartite;

long long count_;

int main()
{
	// ------ Graph Construction ------ //

	cin >> V >> E;

	City = vector<vector<int> >(V);

	for (int i = 0; i < E; i++)
	{
		cin >> A >> B;

		City[A - 1].push_back(B - 1);
		City[B - 1].push_back(A - 1);
	}


	// ------ Shortest Path ------ //

	vector<int> Bipartite(V, 2); // 0 --> 0, 1 --> 1, 2 --> Unknown

	for (int i = 0; i < V; i++)
	{
		if (Bipartite[i] == 2)
		{
			CitySet.push_back(vector<int>());

			vector<int> D(V, INF); D[i] = 0;

			priority_queue<pair<int, int> > que; que.push(make_pair(0, i));

			while (!que.empty())
			{
				pair<int, int> p1 = que.top(); que.pop();

				int u = p1.second;

				CitySet.back().push_back(u);

				Bipartite[u] = (p1.first * (-1)) % 2;

				if (D[u] < p1.first * (-1)) { continue; }

				for (int j = 0; j < City[u].size(); j++)
				{
					int v = City[u][j];

					if (D[v] > D[u] + 1)
					{
						D[v] = D[u] + 1;

						que.push(make_pair(D[v] * (-1), v));
					}
				}
			}
		}
	}


	// ------ Minus One ------ //

	for (int i = 0; i < CitySet[0].size(); i++)
	{
		for (int j = 0; j < City[CitySet[0][i]].size(); j++)
		{
			if (Bipartite[CitySet[0][i]] == Bipartite[City[CitySet[0][i]][j]])
			{
				cout << -1 << endl; goto Exit;
			}
		}
	}

	
	// ------ Search ------ //

	long long ret = 0;

	count_ = 0;

	for (int i = 0; i < CitySet.size(); i++)
	{
		vector<long long> F(2, 0);

		for (int j = 0; j < CitySet[i].size(); j++)
		{
			F[Bipartite[CitySet[i][j]]]++;
		}

		count_ += F[0] * F[1];
	}

	count_ -= E;

	CityType = vector<int>(2, 0);

	for (int i = 0; i < CitySet[0].size(); i++)
	{
		CityType[Bipartite[CitySet[0][i]]]++;
	}

	for (int bits = 0; bits < (1 << (CitySet.size() - 1)); bits++)
	{
		long long crt = 0;

		for (int i = 1; i < CitySet.size(); i++)
		{
			vector<int> CityType2(CityType.begin(), CityType.end());

			vector<int> Bipartite2(Bipartite.begin(), Bipartite.end());

			if (bits & (1 << (i - 1)))
			{
				for (int j = 0; j < CitySet[i].size(); j++)
				{
					Bipartite2[CitySet[i][j]] = (Bipartite2[CitySet[i][j]] + 1) % 2; // Graph Reverse
				}
			}

			crt += CityType2[(Bipartite2[CitySet[i][0]] + 1) % 2]; CityType[Bipartite2[CitySet[i][0]]]++;

			for (int j = 1; j < CitySet[i].size(); j++)
			{
				crt += CityType2[(Bipartite2[CitySet[i][j]] + 1) % 2];

				CityType[Bipartite2[CitySet[i][j]]]++;
			}
		}

		ret = max(ret, crt);
	}

	cout << count_ + ret << endl;

Exit:;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:154:1: error: jump to label 'Exit'
  154 | Exit:;
      | ^~~~
a.cc:88:58: note:   from here
   88 |                                 cout << -1 << endl; goto Exit;
      |                                                          ^~~~
a.cc:96:19: note:   crosses initialization of 'long long int ret'
   96 |         long long ret = 0;
      |                   ^~~
Language: C++

#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<28;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};



int main(){
	cin>>n;
	cout<<n+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   51 |         cin>>n;
      |              ^
      |              yn
Language: C++

#include <climits>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

constexpr int MAX_V = 100000;
constexpr int MAX_N = 10000;

typedef pair<int, int> D; // dist, change
typedef tuple<D, int, int> P; // D, rail, pos
typedef pair<int, int> edge; // to, cost
#define to first
#define cost second

vector<int> p[MAX_N];
vector<int> t[MAX_N];
vector<D> dist[MAX_N];

bool visited[MAX_V];
set<pair<int, int>> S[MAX_V];
unordered_map<string, int> converter;

inline int input_station() {
	string station_name;
	cin >> station_name;

	if(!converter.count(station_name)) {
		converter.insert({station_name, converter.size()});
	}

	return converter[station_name];
}

string dijkstra(int s, int g, int T) {
	memset(visited, false, sizeof(visited));
	priority_queue<P, vector<P>, greater<P>> que;

	for(const auto &e : S[s]) {
		dist[e.first][e.second] = {0, 0};
		que.push(make_tuple(D(0, 0), e.first, e.second));
	}

	while(!que.empty()) {
		D d;
		int r, q;
		tie(d, r, q) = que.top();
		que.pop();

		if(dist[r][q] < d) continue;

		const int v = p[r][q];

		if(v == g) return to_string(d.first) + " " + to_string(d.second);

		if(!visited[v]) {
			for(const auto &e : S[v]) {
				const D next_dist(d.first + T, d.second + 1);

				if(dist[e.first][e.second] > next_dist) {
					dist[e.first][e.second] = next_dist;
					que.push(make_tuple(next_dist, e.first, e.second));
				}
			}
		}

		visited[v] = true;

		if(0 < q) {
			const D next_dist(d.first + t[r][q - 1], d.second);

			if(dist[r][q - 1] > next_dist) {
				dist[r][q - 1] = next_dist;
				que.push(make_tuple(next_dist, r, q - 1));
			}
		}

		if(q < static_cast<int>(p[r].size() - 1)) {
			const D next_dist(d.first + t[r][q], d.second);

			if(dist[r][q + 1] > next_dist) {
				dist[r][q + 1] = next_dist;
				que.push(make_tuple(next_dist, r, q + 1));
			}
		}
	}

	return "-1";
}

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

	int N, T;
	cin >> N >> T;

	const int A = input_station();
	const int B = input_station();

	for(int i = 0; i < N; ++i) {
		int a;
		cin >> a;

		p[i].resize(a);
		t[i].resize(a - 1);
		dist[i].resize(a, D(INT_MAX, INT_MAX));

		for(int j = 0; j < a; ++j) {
			p[i][j] = input_station();
			S[p[i][j]].insert({i, j});
		}

		for(auto &e : t[i]) cin >> e;
	}

	cout << dijkstra(A, B, T) << endl;
}

Compiler output:
a.cc: In function 'std::string dijkstra(int, int, int)':
a.cc:40:9: error: 'memset' was not declared in this scope
   40 |         memset(visited, false, sizeof(visited));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <unordered_map>
  +++ |+#include <cstring>
    8 | #include <vector>
Language: C++

#include<iostream>
#include<string>
#include<functional>
#include<vector>
#include<queue>
using namespace std;
vector<string>vec[500000], W; vector<int>vec2[500000];
int n, t, num; string a, b; pair<int, int>dist[500000];
vector<pair<int, int>>X[500000];

pair<int, int> dijkstra(string S, string T) {
	priority_queue<tuple<int, int, int>, vector<tuple<int, int, int>>, greater<tuple<int, int, int>>>Q;
	int cnt4 = 0; for (int i = 0; i < 500000; i++)dist[i] = make_pair(1069999999, 1069999999);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < vec[i].size(); j++) {
			if (S == vec[i][j]) { Q.push(make_tuple(0, cnt4, 0)); dist[cnt4] = make_pair(0, 0); }
			cnt4++;
		}
	}
	while (!Q.empty()) {
		int a1 = get<0>(Q.top()), a2 = get<1>(Q.top()), a3 = get<2>(Q.top()); Q.pop();
		for (int i = 0; i < X[a2].size(); i++) {
			int to = X[a2][i].first;
			int U = 0; if (a2 >= num)U = 1;
			if (dist[to] > make_pair(a1 + X[a2][i].second, a3 + U)) {
				dist[to] = make_pair(a1 + X[a2][i].second, a3 + U);
				Q.push(make_tuple(dist[to].first, to, dist[to].second));
			}
		}
	}
	cnt4 = 0; pair<int, int> minx = make_pair(2139999999, 2139999999);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < vec[i].size(); j++) {
			if (T == vec[i][j]) { minx = min(minx, dist[cnt4]); }
			cnt4++;
		}
	}
	return minx;
}
int main() {
	cin >> n >> t >> a >> b; int cnt1 = 0;
	for (int i = 0; i < n; i++) {
		int E; cin >> E;
		for (int j = 0; j < E; j++) {
			string W2; cin >> W2; W.push_back(W2);
			vec[i].push_back(W2); cnt1++;
		}
		for (int j = 0; j < E - 1; j++) { int W3; cin >> W3; vec2[i].push_back(W3); }
	}
	int cnt2 = 0; sort(W.begin(), W.end());
	vector<string>V; V.push_back(W[0]); for (int i = 1; i < W.size(); i++) { if (W[i - 1] != W[i])V.push_back(W[i]); }
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < vec2[i].size(); j++) {
			X[cnt2].push_back(make_pair(cnt2 + 1, vec2[i][j]));
			X[cnt2 + 1].push_back(make_pair(cnt2, vec2[i][j]));
			cnt2++;
		}
		cnt2++;
	}
	num = cnt2;
	int cnt3 = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < vec[i].size(); j++) {
			int pos1 = lower_bound(W.begin(), W.end(), vec[i][j]) - W.begin();
			X[cnt2 + pos1].push_back(make_pair(cnt3, 0));
			X[cnt3].push_back(make_pair(cnt2 + pos1, t));
			cnt3++;
		}
	}
	pair<int, int>ans = dijkstra(a, b);
	if (ans.first > 1000000000)cout << "-1" << endl;
	else cout << ans.first << ' ' << ans.second << endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
long long k,I,A,x_y,x[2],fib[2],a,i;double mid;
#define MOD 1000000007
int dp[3];
int main(){
	cin>>k;
	a=sqrt(k)/16;
	x_y=(long long)(2*sqrtl(k-a-0.01))-1;
	A=(x_y+2)*(x_y+2)/4;
	I=(x_y+1)*(x_y+1)/4+1;
	mid=1.0*(A-I)/2;
	if(k<=mid){x[1]=(k-I)*2;}
	else{x[1]=(A-k)*2+1;}
	x[0]=x_y-x[1];
	
	for(j=0;j<2;j++){
	if(x[j]<3){
		fib[j]=x[j]+1;
	}
    else{
		dp[0]=1;
		dp[1]=2;
		dp[2]=3;

		for(i=3;i<=x[j];i+=3)
		{
			dp[0]=(dp[1]+dp[2])%MOD;
			dp[1]=(dp[2]+dp[0])%MOD;
			dp[2]=(dp[0]+dp[1])%MOD;
		}

		fib[j]=dp[x%3];
    }
	}
	
	cout<<(fib[0] * fib[1])%MOD<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'j' was not declared in this scope
   17 |         for(j=0;j<2;j++){
      |             ^
a.cc:33:28: error: invalid operands of types 'long long int [2]' and 'int' to binary 'operator%'
   33 |                 fib[j]=dp[x%3];
      |                           ~^~
      |                           | |
      |                           | int
      |                           long long int [2]
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long k,I,A,x_y,x[2],fib[2],a,i,j;double mid;
#define MOD 1000000007
int dp[3];
int main(){
	cin>>k;
	a=sqrt(k)/16;
	x_y=(long long)(2*sqrtl(k-a-0.01))-1;
	A=(x_y+2)*(x_y+2)/4;
	I=(x_y+1)*(x_y+1)/4+1;
	mid=1.0*(A-I)/2;
	if(k<=mid){x[1]=(k-I)*2;}
	else{x[1]=(A-k)*2+1;}
	x[0]=x_y-x[1];
	
	for(j=0;j<2;j++){
	if(x[j]<3){
		fib[j]=x[j]+1;
	}
    else{
		dp[0]=1;
		dp[1]=2;
		dp[2]=3;

		for(i=3;i<=x[j];i+=3)
		{
			dp[0]=(dp[1]+dp[2])%MOD;
			dp[1]=(dp[2]+dp[0])%MOD;
			dp[2]=(dp[0]+dp[1])%MOD;
		}

		fib[j]=dp[x%3];
    }
	}
	
	cout<<(fib[0] * fib[1])%MOD<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: invalid operands of types 'long long int [2]' and 'int' to binary 'operator%'
   33 |                 fib[j]=dp[x%3];
      |                           ~^~
      |                           | |
      |                           | int
      |                           long long int [2]
Language: C++

double p[8]={},cop[8]={},sum=0;
	p[0]=mid;
	cop[0]=cos(p[0]);
	sum=p[0];
	rep1(i,m-1){
		cop[i]=cop[i-1]/r[(i+1)%m]*r[i-1];
		if(abs(cop[i])>1) return false;
		p[i]=acos(cop[i]);
		sum+=p[i];
	}
	if(sum>2*pi) return false;
	return true;

Compiler output:
a.cc:2:9: error: 'p' does not name a type
    2 |         p[0]=mid;
      |         ^
a.cc:3:9: error: 'cop' does not name a type
    3 |         cop[0]=cos(p[0]);
      |         ^~~
a.cc:4:9: error: 'sum' does not name a type
    4 |         sum=p[0];
      |         ^~~
a.cc:5:13: error: expected constructor, destructor, or type conversion before '(' token
    5 |         rep1(i,m-1){
      |             ^
a.cc:11:9: error: expected unqualified-id before 'if'
   11 |         if(sum>2*pi) return false;
      |         ^~
a.cc:12:9: error: expected unqualified-id before 'return'
   12 |         return true;
      |         ^~~~~~
Language: C++

template<int V>
struct MaxFlow {
    using T = int;
    const T INF = 1<<28;
    struct Edge {
        int to, rev;
        T cap;
    };
    vector<Edge> g[V];
    int level[V];
    int iter[V];

    void add(int from, int to, T cap) {
        g[from].push_back(Edge{to, (int)g[to].size(), cap});
        g[to].push_back(Edge{from, (int)g[from].size()-1, 0});
    }

    void add_multi(int from, int to, T cap) {
        g[from].push_back(Edge{to, (int)g[to].size(), cap});
        g[to].push_back(Edge{from, (int)g[from].size()-1, cap});
    }

    void bfs(int s) {
        fill_n(level, V, -1);
        queue<int> que;
        level[s] = 0;
        que.push(s);
        while (!que.empty()) {
            int v = que.front(); que.pop();
            for (Edge e: g[v]) {
                if (e.cap <= 0) continue;
                if (level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    que.push(e.to);
                }
            }
        }
    }

    T dfs(int v, int t, T f) {
        if (v == t) return f;
        for (int &i = iter[v]; i < g[v].size(); i++) {
            Edge &e = g[v][i];
            if (e.cap <= 0) continue;
            if (level[v] < level[e.to]) {
                T d = dfs(e.to, t, min(f, e.cap));
                if (d <= 0) continue;
                e.cap -= d;
                g[e.to][e.rev].cap += d;
                return d;
            }
        }
        return 0;
    }

    T exec(int s, int t) {
        T flow = 0;
        while (true) {
            bfs(s);
            if (level[t] < 0) return flow;
            fill_n(iter, V, 0);
            T f;
            while ((f = dfs(s, t, INF)) > 0) {
                flow += f;
            }
        }
    }
};

Compiler output:
a.cc:9:5: error: 'vector' does not name a type
    9 |     vector<Edge> g[V];
      |     ^~~~~~
a.cc: In member function 'void MaxFlow<V>::add(int, int, T)':
a.cc:14:9: error: 'g' was not declared in this scope
   14 |         g[from].push_back(Edge{to, (int)g[to].size(), cap});
      |         ^
a.cc: In member function 'void MaxFlow<V>::add_multi(int, int, T)':
a.cc:19:9: error: 'g' was not declared in this scope
   19 |         g[from].push_back(Edge{to, (int)g[to].size(), cap});
      |         ^
a.cc: In member function 'void MaxFlow<V>::bfs(int)':
a.cc:25:9: error: 'queue' was not declared in this scope
   25 |         queue<int> que;
      |         ^~~~~
a.cc:25:15: error: expected primary-expression before 'int'
   25 |         queue<int> que;
      |               ^~~
a.cc:27:9: error: 'que' was not declared in this scope
   27 |         que.push(s);
      |         ^~~
a.cc:30:26: error: 'g' was not declared in this scope
   30 |             for (Edge e: g[v]) {
      |                          ^
a.cc: In member function 'MaxFlow<V>::T MaxFlow<V>::dfs(int, int, T)':
a.cc:42:36: error: 'g' was not declared in this scope
   42 |         for (int &i = iter[v]; i < g[v].size(); i++) {
      |                                    ^
Language: C++


#include<array>
#include<algorithm>

using namespace std;

int rec(const array<int,16> &a,int d){
  if(count(begin(a),end(a),0)==16)return 0;
  if(d==0)return 9;
  int m=9;
  for(int i=0;i<16;i++){
    auto n=a;
    n[i]++;
    if(n[i]>=5){
      n[i]=0;
      int u,r,d,l;
      u=r=d=l=1<<i;
      for(;;){
	u=u>>4&0xFFFF;
	r=r<<1&0xEEEE;
	d=d<<4&0xFFFF;
	l=l>>1&0x7777;
	int b=u|r|d|l;
	if(!b)break;
	for(int i=0;i<16;i++){
	  if(b>>i&1&&n[i]){
	    n[i]+=(u>>i&1)+(r>>i&1)+(d>>i&1)+(l>>i&1);
	    if(n[i]>=5){
	      n[i]=0;
	      u|=1<<i;
	      r|=1<<i;
	      d|=1<<i;
	      l|=1<<i;
	    }else{
	      u&=~(1<<i);
	      r&=~(1<<i);
	      d&=~(1<<i);
	      l&=~(1<<i);
	    }	      
	  }
	}
      }
    }
    m=min(m,rec(n,d-1));
  }
  return m+1;
}

int main(){
  array<int,16> a;
  for(int i=0;i<16;i++){
    cin>>a[i];
  }
  auto r=rec(a,5);
  cout<<((r>=0)?r:-1)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'cin' was not declared in this scope
   52 |     cin>>a[i];
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<algorithm>
  +++ |+#include <iostream>
    4 | 
a.cc:55:3: error: 'cout' was not declared in this scope
   55 |   cout<<((r>=0)?r:-1)<<endl;
      |   ^~~~
a.cc:55:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:55:24: error: 'endl' was not declared in this scope
   55 |   cout<<((r>=0)?r:-1)<<endl;
      |                        ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<algorithm>
  +++ |+#include <ostream>
    4 |
Language: C++

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

struct UnionFind{
  vector<int> data;
  UnionFind(int n) : data(n, -1) {}
  bool unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x != y){
      if(data[y] < data[x]) swap(x,y);
      data[x] += data[y];//高さを更新
      data[y] = x;//親を更新
    }
    return x != y;
  }
  bool same(int x, int y){ return find(x) == find(y); }
  int find(int x){
    if(data[x] < 0) return x;
    return data[x] = find(data[x]);
  }
};


int main(){
  int n, h, w;
  cin >> n >> h >> w;
  int x, y;
  vector<int> X(n), Y(n);
  map<int,int> M_x, M_y;
  UnionFind uf(n);
  for(int i = 0; i < n; ++i){
    cin >> x >> y;
    X[i] = x;
    Y[i] = y;
    if(M_x[x] > 0){
      uf.unite(i,M_x[x]-1);
    }else{
      M_x[x] = i + 1;
    }
    if(M_y[y] > 0){
      uf.unite(i,M_y[y]-1);
    }else{
      M_y[y] = i + 1;
    }
  }
  set<int> p, l, r, t, b;
  for(int i = 0; i < n; ++i){
    p.insert(uf.find(i));
    if(X[i] == 1) l.insert(uf.find(i));
    if(X[i] == w) r.insert(uf.find(i));
    if(Y[i] == 1) b.insert(uf.find(i));
    if(Y[i] == h) t.insert(uf.find(i));
  }
  int k = p.size(), s = max({l.size(),r.size(),t.size(),b.size()});
  if(k == 1) cout << n - 1 << endl;
  else cout << n + k - 1 - s << endl; 
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:58:28: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   58 |   int k = p.size(), s = max({l.size(),r.size(),t.size(),b.size()});
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/map:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

struct UnionFind{
  vector<int> data;
  UnionFind(int n) : data(n, -1) {}
  bool unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x != y){
      if(data[y] < data[x]) swap(x,y);
      data[x] += data[y];//高さを更新
      data[y] = x;//親を更新
    }
    return x != y;
  }
  bool same(int x, int y){ return find(x) == find(y); }
  int find(int x){
    if(data[x] < 0) return x;
    return data[x] = find(data[x]);
  }
};


int main(){
  int n, h, w;
  cin >> n >> h >> w;
  int x, y;
  vector<int> X(n), Y(n);
  map<int,int> M_x, M_y;
  UnionFind uf(n);
  for(int i = 0; i < n; ++i){
    cin >> x >> y;
    X[i] = x;
    Y[i] = y;
    if(M_x[x] > 0){
      uf.unite(i,M_x[x]-1);
    }else{
      M_x[x] = i + 1;
    }
    if(M_y[y] > 0){
      uf.unite(i,M_y[y]-1);
    }else{
      M_y[y] = i + 1;
    }
  }
  set<int> p, l, r, t, b;
  for(int i = 0; i < n; ++i){
    p.insert(uf.find(i));
    if(X[i] == 1) l.insert(uf.find(i));
    if(X[i] == w) r.insert(uf.find(i));
    if(Y[i] == 1) b.insert(uf.find(i));
    if(Y[i] == h) t.insert(uf.find(i));
  }
  int k = p.size(), s = max({l.size(),r.size(),t.size(),b.size()});
  if(k == 1) cout << n - 1 << endl;
  else cout << n + k - 1 - s << endl; 
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:59:28: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   59 |   int k = p.size(), s = max({l.size(),r.size(),t.size(),b.size()});
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_tree.h:63,
                 from /usr/include/c++/14/map:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

aasvfsadgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdg


Compiler output:
a.cc:1:1: error: 'aasvfsadgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdg' does not name a type
    1 | aasvfsadgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdgasdg
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int ans;
map<int, vector<int>> x,y;
set<PII> visit;
int n,w,h;

void DFS(int fx, int fy){
	if(EXIST(visit, MP(fx,fy)))return;
	visit.insert(MP(fx,fy));
	REP(i,x[fx].size()){
		if(x[fx][i]!=fy)DFS(fx, x[fx][i]);
	}
	REP(i,y[fy].size()){
		if(y[fy][i]!=fx)DFS(y[fy][i], fy);
	}
}

void main(){
	cin>>n>>w>>h;
	ans = n-1;
	int flag = 0,cnt=0;
	REP(i,n){
		int tx, ty;
		scanf("%d%d", &tx,&ty);
		x[tx].PB(ty);
		y[ty].PB(tx);
		if(tx==1||ty==1||tx==w||ty==h)flag=1;
	}
	for(auto it=x.begin(); it!=x.end(); it++){
		if(!EXIST(visit, MP(it->first, it->second[0]))){
			DFS(it->first, it->second[0]);
			cnt++;
		}
	}
	if(cnt!=1){
		if(flag==0){
			ans+=cnt;
		}else{
			ans+=cnt-1;
		}
	}
	cout << ans << endl;
}

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

//??????????????????????????????????????????????????????????????????????????§???????????±????????????????????£??????
/*
?§£???
?????????????????£???????????????????????????????????????
???????????????????????????????????¨??§??????????????\????????°??????????????§?????????????????§????????\????????????????????°?????¨??????????????????????????°???????????????
????????????????????°??????????????????????????°???????????????????¢????????????°???????????????????????????????????°????????????????°???????????????????????????????
?????£?????????????????°????????\?????????????????\????????°????????????????????´????????\??????????±????????????????????????????????????°????????¨?????????
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for (int i=(n)-1;i>=0;i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define REPS(i,f,n) for (int i=(f)-1;i>=(n);i--)

const ll mod = 1000000007;

int main(void){
	ll n; ll t;
	cin >> n >> t;
	vector<ll> d(n);
	rep(i, n) scanf("%lld", &d[i]);

	sort(all(d));
	ll ans = 1;
	//????????\????????´????????¢?????????????????????????¢??????????????????¨??????????????????????????§???????????¢?´¢??¨???lower_bound??¢??°(???????????????"??\???"???????´?????????????????????????????????????)
	//i + 1????????§?????\??£???????????°???????????¨??????????°??????°????????\?????????
	//lower_bound????????£???????????¶????????????????????°???????????????????????¶????????????????????°??????????¨?????¨???????????????¨???(i + 1)??????????????°??????????????°???????????????????????????
	rep(i, n) 
        ans *= (i + 1 - (ll)(lower_bound(d.begin(), d.begin() + i + 1, d[i] - t) - d.begin()) % mod);

    printf("%lld\n", ans % mod;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:31: error: expected ')' before ';' token
   53 |     printf("%lld\n", ans % mod;
      |           ~                   ^
      |                               )
Language: C++

#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const ll MOD = 10e9+7;
  
int binsearch_lower_bound(vector<int>& vec, int val) {
  int low = 0;            // ???????????????
  int high = vec.size();  // ????????????????????§?£????????????° [low, high] ???????????????¨??????
  while (low < high) {
    int mid = (low + high) / 2;  // ???????????????????????£????§????????????????????????????????????
                                 // ??????????????? mid=low+(high-low)/2 ???¨????????????
    int midval = vec[mid];       // ?????????§??????
  
    // ??§?£?????????????????????
    if (midval < val) low = mid + 1;
    else high = mid;
  }
  return low;
}
  
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n,t;
  cin >> n >> t;
  std::vector<ll> v;
  for(int i=0;i<n;i++){
    int d;
    cin >> d;
    v.push_back(d);
  }
  sort(v.begin(),v.end());
  ll res[n+1];
  res[0]=1;
  for(int i=1;i<n;i++){
    if(v[i-1]>=v[i]-t){
      int idx=binsearch_lower_bound(v,v[i]-t);
      res[i] = (res[i-1]*(i-idx+1))%MOD;
    }
    else res[i]=res[i-1];
  }
  cout << res[n-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:37: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<long long int>'
   47 |       int idx=binsearch_lower_bound(v,v[i]-t);
      |                                     ^
a.cc:15:40: note: in passing argument 1 of 'int binsearch_lower_bound(std::vector<int>&, int)'
   15 | int binsearch_lower_bound(vector<int>& vec, int val) {
      |                           ~~~~~~~~~~~~~^~~