#include "ancient2.h"
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
using namespace std;
//using namespace __gnu_pbds;
#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 ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#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] = 1, b[j] = 1;
}
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
80 ms |
448 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |