# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1145034 | Noproblem29 | Ancient Machine 2 (JOI23_ancient2) | C++20 | 51 ms | 564 KiB |
#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
string Solve(int N) {
string res(N,'0');
for(int i=0;i<N;i++){
vector<int>a(i+3),b(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;
a[i+1]=i+1;
b[i+1]=i+1;
a[i+2]=i+2;
b[i+2]=i+2;
int mask=Query(a.size(),a,b);
if(mask==i+1){
res[i]='0';
}
else{
res[i]='1';
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |