# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
821382 | khshg | Ancient Machine 2 (JOI23_ancient2) | C++17 | 186 ms | 508 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"
#include<bits/stdc++.h>
using namespace std;
string Solve(int N) {
string ans(N, '0');
for(int i = 0; i < N; ++i) {
vector<int> a(1002), b = a;
for(int j = 0; j < i; ++j) a[j] = b[j] = j + 1;
a[i] = i + 1;
b[i] = i + 2;
a[i + 1] = b[i + 1] = i + 1;
a[i + 2] = b[i + 2] = i + 2;
int x = Query(1002, a, b);
ans[i] = '0' + (x == i + 2);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |