| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357386 | neptunns | Dark Ride (EGOI25_darkride) | C++20 | 0 ms | 500 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define maxn 500005
#define mi LLONG_MIN
#define ma LLONG_MAX
#define mod 1000000007
#define pb push_back
#define S second
#define F first
int ask(string s) {
int ans;
cout << "? " << s << endl;
cin >> ans;
return ans;
}
void answer(int a, int b) {
if (a > b) swap(a, b);
cout << "! " << a << " " << b << endl;
exit(0);
}
void solve() {
int n;
cin >> n;
string s(n, '0');
int a = -1, b = -1;
for (int i = 0; i < n; i++) {
s[i] = '1';
int ans = ask(s);
if (ans == 1) {
swap(a, b);
a = i;
if (b != -1) {
answer(a, b);
}
}
s[i] = '0';
}
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin >> t;
while (t--) solve();
}
| # | 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... | ||||
