# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931937 | infrapolar | Ancient Machine 2 (JOI23_ancient2) | C++17 | 75 ms | 1768 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;
std::string Solve(int N){
vector<int> a(3), b(3);
string result;
result.resize(N);
a[1] = b[1] = 1;
a[2] = b[2] = 2;
a[0] = 1;
b[0] = 2;
result[0] = Query(a.size(), a, b) - 1 + '0';
for (int i = 1; i < N; i++)
{
a.push_back(i+2);
b.push_back(i+2);
a[i] = a.size()-2;
b[i] = a.size()-1;
a[i-1] = i;
b[i-1] = i;
result[i] = Query(a.size(), a, b) - 1 - i + '0';
}
return result;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |