| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1361157 | uranhishig | Dark Ride (EGOI25_darkride) | C++20 | 1 ms | 480 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
int ask(string s) {
int ans;
cout << "? " << s << endl;
cin >> ans;
return ans;
}
void answer(int a, int b) {
cout << "! " << min(a, b) << " " << max(a, b) << endl;
}
void solve() {
int n;
cin >> n;
// if (ask("110") == 2) {
// answer(0, 1);
// return;
// }
// if (ask("101") == 2) {
// answer(0, 2);
// return;
// }
// if (ask("011") == 2) {
// answer(1, 2);
// return;
// }
int ans1 = -1, ans2 = -1;
for (int i = 0; i < n; i++) {
string s(n, '1');
s[i] = '0';
int x = ask(s);
if(x == 1 and ans1 == -1) ans1 = i;
if(x == 1 and ans1 != -1) ans2 = i;
}
answer(min(ans1, ans2), max(ans1, ans2));
}
signed main() {
solve();
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... | ||||
