Submission #367797

#TimeUsernameProblemLanguageResultExecution timeMemory
367797mashrur_hossainCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define PI 2*acos(0.0) #define mem(a,b) memset(a, b, sizeof(a)) #define pb(a) push_back(a) #define MP make_pair #define EPS 10E-10 #define ff first #define ss second #define mod 1000000007 #define fast_cin ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define sz(a) (int)a.size() #define UNIQUE(v) (v).erase(unique((v).begin(),(v).end()),(v).end()) #define all(a) a.begin(),a.end() #define infinity (1<<28) #define gcd(a, b) __gcd(a, b) #define lcm(a, b) ((a)*((b)/gcd(a,b))) #define D(x) cerr << __LINE__ << ": " << #x << " = " << (x) << '\n' #define DD(x,y) cerr << __LINE__ << ": " << #x << " = " << x << " " << #y << " = " << y << '\n' #define DDD(x,y,z) cerr << __LINE__ << ": " << #x << " = " << x << " " << #y << " = " << y << " " << #z << " = " << z << '\n' #define DBG cerr << __LINE__ << ": Hi" << '\n' #define endl "\n" typedef long long ll; typedef double db; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii>vii; typedef vector<pll>vll; ////----------------------Graph Moves---------------- //const int fx[]={+1,-1,+0,+0}; //const int fy[]={+0,+0,+1,-1}; //const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; // Kings Move //const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1}; // Kings Move //const int fx[]={-2, -2, -1, -1, 1, 1, 2, 2}; // Knights Move //const int fy[]={-1, 1, -2, 2, -2, 2, -1, 1}; // Knights Move /*------------------------------------------------*/ /*-----------------------Bitmask------------------*/ int Set(int &N, int pos) {return N = N | (1 << pos);} int reset(int &N, int pos) {return N = N & ~(1 << pos);} bool check(int N, int pos) {return (bool)(N & (1 << pos));} /*------------------------------------------------*/ bool cmp(const pair<int, int> &a, const pair<int, int> &b) { return (a.second > b.second); } long long binpow(long long a, long long b) { long long res = 1; while (b > 0) { if (b & 1) res = res * a; a = a * a; b >>= 1; } return res; } bool isPrime ( ll n ) { if ( n <= 1 ) return false; ll sqrtn = sqrt(n); for ( ll i = 2; i <= sqrtn; i++ ) { if ( n % i == 0 ) return false; } return true; } // void solve() { // } string guess_sequence(int n){ string s = ""; string a = "ABXY"; if(press("AB")){ if(press("A")){ a.erase(a.begin()); s+="A"; } else{ a.erase(a.begin()+1); s+="B"; } } else{ if(press("X")){ a.erase(a.begin()+2); s+='X'; } else{ s+="Y"; a.erase(a.begin()+3); } } // D(s); for(int i = 1;i<n-1;i++){ string guess = ""; for(int j = 0;j<4;j++){ guess+= s + a[0] + a[j]; } guess+=s+a[1]; int x = press(guess); if(x == i)s+=a[2]; else if(x==i+1)s+=a[1]; else if(x==i+2)s+=a[0]; } if(press(s+a[0]+s+a[1]) == n){ if(press(s+a[0]) == n){ s+= a[0]; }else{ s+=a[1]; } } else{ s+=a[2]; } return s; } void init() { fast_cin; // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); // #endif } int main() { init(); // int tc = 1; // cout << "Case " << tc++ << ": "; // Sieve(); // int t; cin >> t; // while (t--) { // solve(); // } // solve(); return 0; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:78:5: error: 'press' was not declared in this scope
   78 |  if(press("AB")){
      |     ^~~~~
combo.cpp:105:11: error: 'press' was not declared in this scope
  105 |   int x = press(guess);
      |           ^~~~~
combo.cpp:111:5: error: 'press' was not declared in this scope
  111 |  if(press(s+a[0]+s+a[1]) == n){
      |     ^~~~~