# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
314573 | 2020-10-20T10:33:56 Z | Jarif_Rahman | Combo (IOI18_combo) | C++17 | 1 ms | 200 KB |
#include "combo.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; str guess_sequence(int n){ str s = ""; int r = 0; if(press("AB") > r){ if(press("A") > r) s+="A"; else s+="B"; } else{ if(press("X") > r) s+="X"; else s+="Y"; } r++; if(n == 1) return s; vector<str> ss; for(char c: "ABXY") if(c != s[0]) ss.pb(str(1, c)); r++; while(s.size() < n - 1){ int x = press(s+ss[0] + s+ss[1]+ss[0] + s+ss[1]+ss[1] + s+ss[1]+ss[2]); x-=s.size(); if(x == 0) s+=ss[2]; else if(x == 1) s+=ss[0]; else s+=ss[1]; r++; } if(press(s+"AB") > r){ if(press(s+"A") > r) s+="A"; else s+="B"; } else{ if(press(s+"X") > r) s+="X"; else s+="Y"; } r++; return s; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Wrong Answer: wrong guess. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 200 KB | Output is correct |
2 | Correct | 1 ms | 200 KB | Output is correct |
3 | Correct | 0 ms | 200 KB | Output is correct |
4 | Correct | 1 ms | 200 KB | Output is correct |
5 | Incorrect | 0 ms | 200 KB | Wrong Answer: wrong guess. |
6 | Halted | 0 ms | 0 KB | - |