# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
937877 | anton | Ancient Machine 2 (JOI23_ancient2) | C++17 | 182 ms | 1580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |