Submission #1104038

#TimeUsernameProblemLanguageResultExecution timeMemory
1104038asdfghjkCombo (IOI18_combo)C++14
0 / 100
3 ms592 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define all(x) x.begin(), x.end() #define F first #define ld long double #define S second using namespace std; const ll N = 5e3 + 5; const ll NN = 4e5 + 5; const ll INF = 1e18; const ll inf = 1e9; const ll MOD = 1e9 + 7; int press(std::string p); string find_second(){ string d = "ABX"; int res = press(d); if(res == 3)return d; if(res == 2){ res = press("AB"); if(res == 2)return "AB"; res = press("AX"); if(res == 2)return "AX"; res = press("BX"); if(res == 2)return "BX"; } if(res == 1){ res = press("AY"); if(res == 2)return "AY"; res = press("BY"); if(res == 2)return "BY"; res = press("XY"); if(res == 2)return "XY"; } res = press("YA"); if(res == 2)return "YA"; res = press("YB"); if(res == 2)return "YB"; res = press("YX"); if(res == 2)return "YX"; } string guess_sequence(int n){ string a = "qwertythjyh"; string s = find_second(); for(int i = 2;i <= n;i++){ if(int(s.size()) > i)continue; string d = s; d += a[1]; d += a[2]; int z = press(d); d = s; d += a[2]; d += a[3]; int x= press(d); if(z == int(s.size())){ s += a[3]; } else if(x == int(s.size())){ s += a[1]; } else s += a[2]; } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string find_second()':
combo.cpp:16:16: warning: control reaches end of non-void function [-Wreturn-type]
   16 |     string d = "ABX";
      |                ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...