Submission #487731

#TimeUsernameProblemLanguageResultExecution timeMemory
487731BY_KUTBILIMDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
/* @AUTHOR: BY_KUTBILIM FILE CREATED: 16.11.2021 17:32:18 (GMT+6) */ #include "molecules.h" #include <bits/stdc++.h> using namespace std; #define endl '\n' #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define fi first #define se second #define pb push_back using ll = long long; using pii = pair<int, int>; string guess_sequence(int n){ string res; int i = 2, q; char a = 'A', b = 'B', c = 'Y'; if(press("XY")){ if(press("X"))res = "X"; else res = "Y", c = 'X'; } else{ if(press("A"))res = "A", a = 'X'; else res = "B", b = 'X'; } for (; i < n; i++){ q = press(res+a+res+b+a+res+b+b+res+b+c); if(q==i)res+=a; else if(q == i+1)res+=b; else res+=c; } if(i==n){ if(press(res+a)==n)res+=a; else if(press(res+b)==n)res+=b; else res+=c; } return res; }

Compilation message (stderr)

molecules.cpp: In function 'std::string guess_sequence(int)':
molecules.cpp:23:5: error: 'press' was not declared in this scope; did you mean 'res'?
   23 |  if(press("XY")){
      |     ^~~~~
      |     res
molecules.cpp:31:7: error: 'press' was not declared in this scope; did you mean 'res'?
   31 |   q = press(res+a+res+b+a+res+b+b+res+b+c);
      |       ^~~~~
      |       res
molecules.cpp:37:6: error: 'press' was not declared in this scope; did you mean 'res'?
   37 |   if(press(res+a)==n)res+=a;
      |      ^~~~~
      |      res