Submission #233056

#TimeUsernameProblemLanguageResultExecution timeMemory
233056priyansh5525Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
	#include ""
	using namespace std;
	#define ll long long int
	#define pii pair<long long int,long long int>
	#define vi vector<long long int >
	#define vvi vector<vector< long long int>>
	#define MP make_pair
	#define PB push_back 
	#define pb pop_back
	#define PF push_front
	#define pf pop_front
	#define MOD 1000000007
	string guess_sequence(ll n)
	{
		string ans="";
		ll co=1;
		string a="B" , b="X" , c="Y";
		if(press("A")==1)
		{
			ans="A";
		}
		else if(press("B")==1)
		{
			ans = "B";
			a="A";
		}
		else if(press("X")==1)
		{
			ans= "X";
			b="A";
		}
		else
		{
			ans="Y";
			c="A";
		}
		if(n==1)
			return ans;
		while(co<n)
		{
			if(press(ans+a)==co+1)
			{
				ans = ans+a;
			}
			else if(press(ans+b)==co+1)
			{
				ans = ans+b;
			}
			else
				ans =ans + c;
			co++;
		}
		return ans;
	}
	int main()
	{
		ios_base::sync_with_stdio(false);
		cin.tie(NULL);
		ll n;
		cin>>n;
		string ans = guess_sequence(n);
		cout<<ans;
		cout<<"\n";
		return 0;
	}
	

Compilation message (stderr)

combo.cpp:2:11: error: empty filename in #include
    2 |  #include ""
      |           ^~
combo.cpp: In function 'std::string guess_sequence(long long int)':
combo.cpp:19:6: error: 'press' was not declared in this scope
   19 |   if(press("A")==1)
      |      ^~~~~
combo.cpp:42:7: error: 'press' was not declared in this scope
   42 |    if(press(ans+a)==co+1)
      |       ^~~~~