#include <bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define ll long long int
using namespace std;
int main() {
int n; cin >> n; int a[9], mn = 10, m[9];
for (int i = 0LL; i < (1LL << 9); i++) {
for (int j = 0; j < 9; j++) {
if ((i & (1 << j)) > 0) a[j] = 1;
else a[j] = 0;
}
ll sum = 0;
for (int i = 0; i < 9; i++) sum += a[i];
if (sum >= mn) continue;
cout << "?";
for (int i = 0; i < 9; i++) {
if (i % 3 == 0) cout << "\n";
cout << a[i] << " ";
}
cout << "\n";
ll L; cin >> L;
if (L == 9) {
mn = sum;
for (int i = 0; i < 9; i++) m[i] = a[i];
}
}
cout << "!";
for (int i = 0; i < 9; i++) {
if (i % 3 == 0) cout << "\n";
cout << m[i] << " ";
}
cout << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |