# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
965119 | owoovo | Ancient Machine 2 (JOI23_ancient2) | C++17 | 86 ms | 1788 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 variable_example = 1;
} // namespace
string Solve(int n) {
string s(n, '0');
vector<int> a, b;
for(int i=0;i<n;i++){
a.resize(i+3),b.resize(i+3);
for(int j=0;j<i;j++){
a[j]=j+1;
b[j]=j+1;
}
a[i]=i+1;
b[i]=i+2;
for(int j=i+1;j<=i+2;j++)a[j]=j,b[j]=j;
int u=Query(i+3,a,b);
cerr<<u<<"\n";
if(u==i+1){
s[i]='0';
}else{
s[i]='1';
}
}
cerr<<s<<"\n";
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |