# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
937877 | anton | Ancient Machine 2 (JOI23_ancient2) | C++17 | 182 ms | 1580 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;
int mQuery(int m, vector<int>&a, vector<int>&b){
cout<<m<<endl;
for(auto e: a){
cout<<e<<" ";
}
cout<<endl;
for(auto e: b){
cout<<e<<" ";
}
cout<<endl;
int r= Query(m, a, b);
cout<<"res "<<r<<endl;
return r;
}
std::string Solve(int N) {
int n= N;
string s;
for(int i = 0; i<n; i++){
vector<int> a, b;
for(int j =0; j<i; j++){
a.push_back(j+1);
b.push_back(j+1);
}
a.push_back(i+2);
a.push_back(i+1);
b.push_back(i+1);
b.push_back(i+2);
for(int j =i+2; j<n+2; j++){
a.push_back((j+1)%(n+2));
b.push_back((j+1)%(n+2));
}
int r= Query(a.size(), a, b);
if(r==n+1){
s.push_back('0');
}
else{
s.push_back('1');
}
//cout<<s<<endl;
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |