Submission #1007233

#TimeUsernameProblemLanguageResultExecution timeMemory
1007233devariaotaCombo (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include<bits/stdc++.h> #include"combo.h" using namespace std; string ans,coba; int n; string guess_sequence(int N) { n = N; for (int i=1; i<=n; i++) { if (i == 1) { coba = "AB"; int x = press(coba); if (x == 0) { coba = "X"; int y = press(coba); if (y == 1) { ans+="X"; } else { ans+="Y"; } } else { coba = "A"; int y = press(coba); if (y == 1) { ans+="A"; } else { ans+="B"; } } } else { coba = ans + "B" + ans + "XB" + ans + "XX" + ans + "XY"; int x = press(coba); if (x == i) { ans += "B"; } else if (x == i + 1) { ans += "X"; } else { ans += "Y"; } } } int x = press(ans); return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:43:7: warning: unused variable 'x' [-Wunused-variable]
   43 |   int x = press(ans);
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...