# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
963668 | Trisanu_Das | Ancient Machine 2 (JOI23_ancient2) | C++17 | 81 ms | 1992 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ancient2.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define FOR(i, x, y) for(ll i=x; i<y; i++)
#define FORNEG(i, x, y) for(ll i=x; i>y; i--)
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
std::string Solve(int N) {
vector<int> a(502), b(502);
a[500] = 500;
b[500] = 500;
a[501] = 501;
b[501] = 501;
string sus = "";
FOR(i,0,500){
FOR(j,0,500){
if (j==i) a[j] = 500, b[j] = 501;
else a[j] =j+1, b[j] = j+1;
}
ll ans = Query(502, a, b);
if (ans==500) sus = sus + "0";
else sus = sus + "1";
}
FOR(i,0,500){
FOR(j,0,500){
a[j] =j+1, b[j] = j+1;
if (j==499) a[j] = 0, b[j] = 0;
if (i==j){
if (sus[j] == '0') b[j] = 501;
else a[j] = 501;
}
}
ll ans = Query(502, a, b);
if (ans<500){
if (sus[i] == '0') sus = sus + "0";
else sus = sus + "1";
}else{
if (sus[i] == '0') sus = sus + "1";
else sus = sus + "0";
}
}
return sus;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |