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 "interactive.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> guess(int n) {
// vector<int> questions[7], answers[7];
// for (int i = 2; i <= n; i++) {
// for (int j = 0; j < 7; j++) if ((1 << j) & i) {
// questions[j].push_back(i);
// }
// }
// for (int j = 0; j < 7; j++) {
// answers[j] = contains(questions[j]);
// }
vector <int> ans;
map<int, int> cnt;
for (int i = 1; i <= n; i++) {
int num = ask(i);
cnt[num]++;
ans.push_back(num);
assert(cnt[num] <= 1);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |