# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
950563 | arbuzick | Ancient Machine 2 (JOI23_ancient2) | C++17 | 70 ms | 1412 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 <bits/stdc++.h>
#include "ancient2.h"
using namespace std;
string Solve(int n) {
string ans(n, '0');
for (int i = 0; i < n; ++i) {
int m = i + 2;
vector<int> a(m), b(m);
for (int j = 0; j < i; ++j) {
a[j] = b[j] = j + 1;
}
a[i] = i;
a[i + 1] = i + 1;
b[i] = i + 1;
b[i + 1] = i + 1;
int val = Query(m, a, b);
if (val == i) {
ans[i] = '0';
} else {
ans[i] = '1';
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |