Submission #501524

#TimeUsernameProblemLanguageResultExecution timeMemory
501524dnauxCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define endline "\n" #define pb push_back #define mp make_pair #define st first #define nd second #define lsb(i) i&(-i) #define sz(i) (int)i.size() typedef long long ll; using namespace std; const ll INF = 1e18L; constexpr int mod = int(1e9) + 7; ll t=1, n, m, k, q, s, cases = 0, timee = 0; string guess_sequence(int N){ string s = ""; char c1 = 'X',c2 = 'Y',c3 = 'A'; if(press("XY") != 0){ if(press("X") != 0){s += 'X';c1 = 'B';} else {s += 'Y';c2 = 'B';} } else{ if(press('A') != 0)(s += 'A';c3 = 'B';) else s += 'B'; } for(int i = 0;i < n - 1; i++){ if(press(s + c1 + s + c2) > i + 1){ if(press(s + c1) > i + 1){ s += c1; } else{ s += c2; } } else s += c3; } return s; } /*void solve(){ }*/ int main(){ /*#ifdef ONLINE_JUDGE freopen("feast.in","r",stdin); freopen("feast.out","w",stdout); #endif*/ ios_base::sync_with_stdio(false);cin.tie(NULL); /*cin>>t; for(; cases < t; cases++)solve();*/ //exit(0); return 0; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:8: error: 'press' was not declared in this scope
   20 |     if(press("XY") != 0){
      |        ^~~~~
combo.cpp:25:37: error: expected ')' before ';' token
   25 |         if(press('A') != 0)(s += 'A';c3 = 'B';)
      |                            ~        ^
      |                                     )
combo.cpp:25:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   25 |         if(press('A') != 0)(s += 'A';c3 = 'B';)
      |         ^~
combo.cpp:25:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   25 |         if(press('A') != 0)(s += 'A';c3 = 'B';)
      |                                      ^~
combo.cpp:25:47: error: expected primary-expression before ')' token
   25 |         if(press('A') != 0)(s += 'A';c3 = 'B';)
      |                                               ^
combo.cpp:29:12: error: 'press' was not declared in this scope
   29 |         if(press(s + c1 + s + c2) > i + 1){
      |            ^~~~~