# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1092170 | onlk97 | Ancient Machine 2 (JOI23_ancient2) | C++17 | 65 ms | 848 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 <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
string Solve(int N){
string ans="";
for (int i=0; i<500; i++){
vector <int> a(i+3,0),b(i+3,0);
for (int j=0; j<i+3; j++) a[j]=b[j]=j;
for (int j=0; j<i; j++){
a[j]=j+1; b[j]=j+1;
}
a[i]=i+1; b[i]=i+2;
int tp=Query(i+3,a,b);
if (tp==i+1) ans+='0';
else ans+='1';
}
for (int i=0; i<500; i++){
vector <int> a(501,0),b(501,0);
for (int j=0; j<500; j++) a[j]=b[j]=(j+1)%500;
a[500]=b[500]=500;
if (ans[i]=='0') b[i]=500;
else a[i]=500;
int tp=Query(501,a,b);
if (tp==500){
if (ans[i]=='0') ans+='1';
else ans+='0';
} else ans+=ans[i];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |