// #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <set>
#include <deque>
using namespace std;
#define int long long
const int N=3e5+5;
const int M=998244353;
const int LOG = 18;
int n , m , c , t=1 , q=1 , x , y;
vector<int>a(N);
void solve()
{
cin >> n;
if (n!=3){
cout << -1 << endl;
}
else{
for (int i=1;i<512;i++){
string a="000000000";
int c=0;
for (int j=0;j<9;j++){
if ((int)pow(2,j)&i){
a[j]='1';
c++;
}
}
cout << "?" << endl;
cout << a[0]<<a[1]<<a[2]<<endl;
cout << a[3]<<a[4]<<a[5]<<endl;
cout << a[6]<<a[7]<<a[8]<<endl;
cin >> x;
if (x==9 and c==3){
cout << "!" << endl;
cout << a[0]<<a[1]<<a[2]<<endl;
cout << a[3]<<a[4]<<a[5]<<endl;
cout << a[6]<<a[7]<<a[8]<<endl;
return;
}
}
}
}
signed main()
{
// int t=1;
// cin >> t;
for (int _=1;_<=t;_++){
solve();
q++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |