This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifndef ntmin
#include "combo.h";
#endif // ntmin
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
#define fi first
#define sc second
vector<string> p = {"A", "B", "X", "Y"};
// int press(string s){
// cout << s << '\n';
// int t; cin >> t;
// return t;
// }
string guess_sequence(int N){
string ans = "";
for(string& t : p){
if(press(t)){
ans += t;
swap(t, p[3]);
p.pop_back();
break;
}
}
for(int i = 1; i < N; ++i){
bool ok = 0;
for(int j = 0; j < 2; ++j){
if(press(ans + p[j])){
ok = 1;
ans.append(p[j]);
break;
}
}
if(!ok) ans.append(p[2]);
}
return ans;
}
// int main(){
// guess_sequence(5);
// }
Compilation message (stderr)
combo.cpp:2:23: warning: extra tokens at end of #include directive
2 | #include "combo.h";
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |