Submission #493050

#TimeUsernameProblemLanguageResultExecution timeMemory
493050_adisCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
/*input

*/
/*inhuman strength
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx,avx2")
*/
#include<bits/stdc++.h>
#define foR(i,a,b) for(int i=a;i<=b;i++)
#define roF(i,a,b) for(int i=a;i>=b;i--)
#define _ff exit(0);
#define Sort(i,a,b) sort(i+a,i+a+b)
#define SORT(i,a,b) sort(i+a,i+a+b,greater<int>())
#define code_chef for(int i=1,x=0;i<=100000;i++){x++;cerr<<x;}
#define TLE cerr<<"\n" <<  1.0*clock()/CLOCKS_PER_SEC << "\n";
#define F first
#define S second
#define sperm(a) next_permutation(a.begin(),a.end());
#define all(a) a.begin(),a.end()
#define nxhieu_speed cin.tie(0)->sync_with_stdio(false);
#define i2 pair<int,int>
#define getbit(x,i) ((x>>(i))&1)
#define batbit(x,i) (x|(1ll<<(i)))
#define tatbit(x,i) (x&~(1<<(i)))
#define RTE cout<<-1;_ff
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {return l + rng() % (r - l + 1);}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
struct Triple
{
	int Fi;
	int Se;
	int Th;
};
bool operator >(Triple A, Triple B)
{
	if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th > B.Th);
	if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se > B.Se);
	return (A.Fi > B.Fi);
}
bool operator <(Triple A, Triple B)
{
	if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th < B.Th);
	if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se < B.Se);
	return (A.Fi < B.Fi);
}
bool operator ==(Triple A, Triple B)
{
	return (A.Fi == B.Fi && A.Se == B.Se && A.Th == B.Th);
}
void solve()
int Money;
{
	int n;
	cin >> n;
	string s;
	cout << "AB" << '\n';
	cout.flush();
	vector<char> S;
	cin >> Money;
	if (Money == 1)
	{
		cout << "A";
		cout.flush();
		cin >> Money;
		if (Money == 1)
		{
			S.push_back('B');
			S.push_back('X');
			S.push_back('Y');
			s = s + 'A';
		}
		else
		{
			S.push_back('A');
			S.push_back('X');
			S.push_back('Y');
			s = s + 'B';
		}
	}
	else {
		cin >> 'X';
		cin >> Money;
		if (Money == 1)
		{
			s = s + 'X';
			S.push_back('B');
			S.push_back('A');
			S.push_back('Y');
		}
		else
		{
			s = s + 'Y';
			S.push_back('B');
			S.push_back('X');
			S.push_back('A');
		}
	}
	for (int i = 1; i < n; ++i)
	{
		cout << s << S[0] << s << S[1] << S[0] << s << S[1] << S[1] << s << S[1] << S[2] << '\n';
		cout.flush();
		cin >> Money;
		if(Money==s.size()+1) s=s+S[0];
		else if(Money==s.size()+2) s=s+S[1];
		else s=s+S[2]; 
	}
	cout << s;
}
int main()
{
	nxhieu_speed
	int t = 1;
	//cin >> t;
	while (t-- > 0) solve();
	return 0;
}

Compilation message (stderr)

combo.cpp:54:1: error: expected initializer before 'int'
   54 | int Money;
      | ^~~
combo.cpp:55:1: error: expected unqualified-id before '{' token
   55 | {
      | ^
combo.cpp: In function 'int main()':
combo.cpp:117:18: error: 'solve' was not declared in this scope
  117 |  while (t-- > 0) solve();
      |                  ^~~~~