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