#include <bits/stdc++.h>
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define ll long long int
using namespace std;
bool a[3][3]; int mn = 10;
int main() {
int n; cin >> n;
for (int i1 = 0; i1 < 2; i1++) {
for (int i2 = 0; i2 < 2; i2++) {
for (int i3 = 0; i3 < 2; i3++) {
for (int i4 = 0; i4 < 2; i4++) {
for (int i5 = 0; i5 < 2; i5++) {
for (int i6 = 0; i6 < 2; i6++) {
for (int i7 = 0; i7 < 2; i7++) {
for (int i8 = 0; i8 < 2; i8++) {
for (int i9 = 0; i9 < 2; i9++) {
if (i1+i2+i3+i4+i5+i6+i7+i8+i9 >= mn) continue;
cout << "?\n";
cout << i1 << " " << i2 << " " << i3 << "\n";
cout << i4 << " " << i5 << " " << i6 << "\n";
cout << i7 << " " << i8 << " " << i9 << "\n";
ll L; cin >> L;
if (L == 9) {
mn = i1+i2+i3+i4+i5+i6+i7+i8+i9;
a[0][0] = i1;
a[0][1] = i2;
a[0][2] = i3;
a[1][0] = i4;
a[1][1] = i5;
a[1][2] = i6;
a[2][0] = i7;
a[2][1] = i8;
a[2][2] = i9;
}
}
}
}
}
}
}
}
}
}
cout << "!\n";
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cout << a[i][j] << " ";
}
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... |