# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
818422 | tengiz05 | Ancient Machine 2 (JOI23_ancient2) | C++17 | 196 ms | 620 KiB |
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 "ancient2.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <string>
#include <vector>
using namespace std;
namespace {
} // namespace
std::string Solve(int n) {
int m = n + 2;
std::vector<int> a(m), b(m);
for (int i = 0; i < n - 1; i++) {
a[i] = b[i] = i + 1;
}
string s(n, '?');
for (int i = n - 1; i >= 0; i--) {
a[i] = n;
b[i] = n + 1;
a[n] = b[n] = n;
a[n + 1] = b[n + 1] = n + 1;
int val = Query(m, a, b);
if (val == n) {
s[i] = '0';
} else {
s[i] = '1';
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |