# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963668 | Trisanu_Das | Ancient Machine 2 (JOI23_ancient2) | C++17 | 81 ms | 1992 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>
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... |