| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364699 | hsuan._.0528 | Dark Ride (EGOI25_darkride) | C++20 | 1 ms | 560 KiB |
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pii pair<int, LL>
#define F first
#define S second
const int maxn = 3e5+10;
const int mod = 998244353;
const LL inf = 1e9;
int n, A=0, B=0;
int qq(string s){
cout<<"? "<<s<<endl;
int a;
cin>>a;
return a;
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n;
int x=0, b=0;
for(int i=0; i<15; i++){
string s(n, '0');
for(int j=0; j<n; j++)
if((1<<i)&j) s[j]='1';
if(qq(s)%2) x^=(1<<i), b=i;
}
vector<int> v;
for(int j=0; j<n; j++){
if((1<<b)&j)
v.push_back(j);
}
int l=0, r=v.size()-1, m;
while(l<=r){
m=(l+r)/2;
string s(n, '0');
for(int j=0; j<=m; j++) s[v[j]]='1';
if(qq(s) % 2) r=m-1;
else l=m+1;
}
A=v[l];
cout<<"! "<<A<<" "<<(A^x)<<endl;
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
