This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define ROF(i,a,b) for (int i = (a); i > (b); --i)
#define TRAV(a,x) for (auto& a: x)
#define sz(x) int(x.size())
using ll = long long;
using vi = vector<int>;
using pii = pair<int,int>;
#define pb push_back
const int INF = int(1e9);
char a[4] = {'A', 'B', 'X', 'Y'};
std::string guess_sequence(int N) {
std::string s = "";
int coins = 0;
FOR(n,0,4){
FOR(p,0,4){
FOR(q,0,4){
FOR(r,0,4){
s=a[n]+a[p]+a[q]+a[r];
if (press(s)==N) return s;
}
}
}
}
return s;
}
Compilation message (stderr)
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:7: warning: unused variable 'coins' [-Wunused-variable]
20 | int coins = 0;
| ^~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |