# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
814841 | tranxuanbach | Ancient Machine 2 (JOI23_ancient2) | C++17 | 202 ms | 424 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;
namespace {
int n;
string ans;
}
string Solve(int _n){
n = _n;
ans = string(n, '?');
array <int, 2> cnt;
for (int i = 0; i < n; i++){
vector <int> a(n + 2), b(n + 2);
for (int j = 0; j < i; j++){
a[j] = b[j] = j + 1;
}
a[i] = n;
b[i] = n + 1;
a[n] = b[n] = n;
a[n + 1] = b[n + 1] = n + 1;
if (Query(n + 2, a, b) == n){
ans[i] = '0';
}
else{
ans[i] = '1';
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |