QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#106282#5156. Going in CirclesjoesmittyWA 45ms3540kbC++143.6kb2023-05-17 08:54:062023-05-17 08:54:07

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-17 08:54:07]
  • 评测
  • 测评结果:WA
  • 用时:45ms
  • 内存:3540kb
  • [2023-05-17 08:54:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef vector<int> vi;
typedef vector< vector <int> > vvi;
typedef pair<int, int> pii;
typedef pair < pair < int, int >, int > piii;
typedef pair < pair <int, int > , pair <int, int> > piiii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
 
#define FOR(i,a,b) for(int i = a; i < b; i ++)
#define RFOR(i,a,b) for(int i = a-1; i >= b; i --)
#define all(a) a.begin(), a.end()
//#define endl '\n';
#define sz(x) (int)(x).size()
 
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
 
template <typename T>
void pr(vector<T> &v) {
    FOR(i, 0, sz(v)) cout << v[i] << " ";
    cout << endl;
}
template <typename T>
void pr(vector<vector<T> > &v) {
    FOR(i, 0, sz(v)) { pr(v[i]); }
}
template <typename T>
void re(T &x) {
    cin >> x;
}
template <typename T>
void re(vector<T> &a) {
    FOR(i, 0, sz(a)) re(a[i]);
}
template <class Arg, class... Args>
void re(Arg &first, Args &... rest) {
    re(first);
    re(rest...);
}
template <typename T>
void pr(T x) {
    cout << x << endl;
}
template <class Arg, class... Args>
void pr(const Arg &first, const Args &... rest) {
    cout << first << " ";
    pr(rest...);
    cout << endl;
}
void ps() { cout << endl; }
template<class T, class... Ts>
void ps(const T& t, const Ts&... ts) {
    cout << t; if (sizeof...(ts)) cout << " "; ps(ts...);
}
 
const ll MOD  =  998244353;
#define inf 1e18;
#define INF INT_MAX;
 
long double PI = 4*atan(1);
long double eps = 1e-12;


int init;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

bool test(int n) {
    int check = 0;
    int t = 0;
    FOR(i,0,n) {
        cout << "? right" << endl;
        cin >> t;
    }
    cout << "? flip" << endl;
    cin >> check;
    FOR(i,0,n) {
        cout << "? left" << endl;
        cin >> t;
    }
    if(t != init) {
        init = t;
        return true;
    }
    init = t;
    return false;
} 

int main() {
    //auto start = chrono::high_resolution_clock::now();
    ios_base::sync_with_stdio(0);cin.tie(0);
    // freopen("promote.in", "r", stdin);
	// freopen("promote.out", "w", stdout);
    #ifdef DEBUG
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #endif 

    cin >> init;

    // FOR(i,3,21) {
    //     if(test(i)) {
    //         cout << "! " << i << endl;
    //         return 0;
    //     }
    // }

    vector<int> pat;

    int t = init;
    FOR(i,0,20) {
        int tog = uniform_int_distribution<ll>(0, 1)(rng);
      //  cout << "T: " << tog << endl;
        if(tog) {
            cout << "? flip" << endl;
            cin >> t;
            pat.pb(t);
        } else {
            pat.pb(t);
        }
        cout << "? right" << endl;
        cin >> t;
    }

    vector<int> x;
    x.pb(t);
    
    FOR(i,0,5010) {
        int N = x.size();
        if(N >= 20) {
            bool good = true;
            FOR(j,0, 20) {
                if(x[N - 20 + j] != pat[j]) good = false;
            }   
            if(good) {
                cout << "! " << N << endl;
                return 0;
            }
        }
        cout << "? right" << endl;
        cin >> t;
        x.pb(t);
    }


    // auto stop = chrono::high_resolution_clock::now();
    // auto duration = chrono::duration_cast<chrono::microseconds>(stop - start);
    // cout << duration.count() << endl;
    //cin.close();
    //cout.close();
}

詳細信息

Test #1:

score: 100
Accepted
time: 15ms
memory: 3472kb

input:

0
1
0
0
0
1
1
0
0
1
1
0
1
1
1
1
1
0
1
0
1
1
0
0
1
0
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
...

output:

? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ri...

result:

ok Queries used; 5027.

Test #2:

score: 0
Accepted
time: 16ms
memory: 3480kb

input:

1
0
0
1
0
1
1
0
1
1
0
1
0
0
0
0
1
0
1
1
0
0
1
0
1
1
0
0
0
1
0
0
1
1
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
0
1
0
1
1
0
1
0
1
1
0
1
1
0
1
1
1
0
0
1
1
0
0
1
0
0
0
0
1
1
0
0
1
1
0
1
0
1
1
1
1
0
0
0
1
0
0
1
0
1
0
1
0
1
1
0
0
1
0
0
1
1
1
0
1
1
1
0
1
1
0
0
0
0
1
0
0
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
0
1
...

output:

? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
...

result:

ok Queries used; 4882.

Test #3:

score: 0
Accepted
time: 24ms
memory: 3464kb

input:

0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
0
1
0
0
1
1
1
0
0
0
0
1
1
0
1
0
0
1
0
1
1
0
1
0
0
0
0
1
0
1
1
0
0
1
1
1
0
1
1
0
0
1
0
1
1
0
0
1
1
0
0
1
0
1
1
0
1
0
1
1
0
0
0
0
1
1
1
1
1
0
0
0
1
0
0
1
0
1
1
0
0
1
1
0
0
0
0
0
1
1
0
0
0
1
0
0
0
0
1
0
0
1
0
0
0
1
1
0
0
0
0
1
1
0
1
0
0
1
0
1
1
0
1
0
0
0
0
1
0
1
1
0
0
1
1
...

output:

? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ...

result:

ok Queries used; 5025.

Test #4:

score: 0
Accepted
time: 15ms
memory: 3388kb

input:

0
1
0
1
1
0
1
1
0
1
0
1
1
1
0
1
1
1
0
1
1
0
0
1
1
0
1
0
1
1
0
0
1
0
1
1
1
1
1
0
0
0
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0
0
0
0
1
1
0
1
1
0
0
1
1
0
1
0
0
0
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
1
0
1
0
1
0
0
1
0
0
1
1
1
1
0
0
1
0
0
0
1
0
1
0
0
1
1
0
1
...

output:

? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right...

result:

ok Queries used; 4125.

Test #5:

score: 0
Accepted
time: 4ms
memory: 3464kb

input:

0
1
0
1
0
1
1
0
0
1
0
1
1
1
0
1
1
1
0
1
1
0
0
1
0
1
1
0
0
1
1
0
0
1
0
1
1
1
1
1
0
0
0
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0
0
0
0
1
1
0
1
1
0
0
1
1
0
1
0
0
0
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
1
0
1
0
1
0
0
1
0
0
1
1
1
1
0
0
1
0
0
0
1
0
1
0
0
1
1
0
...

output:

? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
...

result:

ok Queries used; 4127.

Test #6:

score: 0
Accepted
time: 21ms
memory: 3436kb

input:

0
1
0
1
1
0
1
0
0
1
0
1
0
1
0
1
1
1
1
1
0
0
1
0
0
1
1
0
1
1
0
1
0
1
1
1
1
1
0
0
0
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0
0
0
0
1
1
0
1
1
0
0
1
1
0
1
0
0
0
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
1
0
1
0
1
0
0
1
0
0
1
1
1
1
0
0
1
0
0
0
1
0
1
0
0
1
1
0
1
1
...

output:

? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? righ...

result:

ok Queries used; 4126.

Test #7:

score: 0
Accepted
time: 34ms
memory: 3452kb

input:

0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? right
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? r...

result:

ok Queries used; 5026.

Test #8:

score: 0
Accepted
time: 15ms
memory: 3476kb

input:

0
0
1
0
1
0
0
1
0
0
0
1
0
0
0
0
1
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? rig...

result:

ok Queries used; 4879.

Test #9:

score: 0
Accepted
time: 24ms
memory: 3480kb

input:

0
0
1
0
1
0
0
1
0
0
0
1
0
0
1
0
0
0
1
0
0
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? righ...

result:

ok Queries used; 5029.

Test #10:

score: 0
Accepted
time: 10ms
memory: 3444kb

input:

0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ri...

result:

ok Queries used; 4122.

Test #11:

score: 0
Accepted
time: 27ms
memory: 3404kb

input:

0
1
0
1
0
1
0
0
0
1
0
1
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
...

output:

? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right...

result:

ok Queries used; 4126.

Test #12:

score: 0
Accepted
time: 18ms
memory: 3456kb

input:

0
0
0
0
0
0
1
0
0
1
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? right
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ...

result:

ok Queries used; 4122.

Test #13:

score: 0
Accepted
time: 4ms
memory: 3408kb

input:

0
1
0
1
0
1
0
1
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
1
1
1
1
0
0
0
0
0
1
0
0
0
1
1
0
0
1
0
1
0
1
1
1
1
1
1
1
1
0
0
0
1
0
1
0
1
1
0
0
0

output:

? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
?...

result:

ok Queries used; 81.

Test #14:

score: 0
Accepted
time: 42ms
memory: 3444kb

input:

0
0
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
0
1
1
1
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
1
1
0
1
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
1
0
1
1
1
0
0
0
0
0
1
1
0
0
1
0
0
0
0
0
1
1
0
1
1
0
0
...

output:

? right
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? r...

result:

ok Queries used; 1719.

Test #15:

score: 0
Accepted
time: 23ms
memory: 3416kb

input:

0
1
0
1
0
1
0
0
0
1
0
1
0
1
0
1
0
0
1
1
0
0
0
1
0
0
0
1
0
1
0
1
0
0
1
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
1
1
0
1
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
1
0
1
1
1
0
0
0
0
...

output:

? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
?...

result:

ok Queries used; 3240.

Test #16:

score: 0
Accepted
time: 20ms
memory: 3468kb

input:

0
0
1
0
0
0
1
0
0
1
0
0
1
0
0
0
1
1
0
0
0
0
1
0
0
1
0
1
0
0
0
1
1
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
...

output:

? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ri...

result:

ok Queries used; 4926.

Test #17:

score: 0
Accepted
time: 40ms
memory: 3536kb

input:

0
0
0
1
0
1
0
0
1
0
0
0
1
0
0
1
0
1
0
1
0
1
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
...

output:

? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? righ...

result:

ok Queries used; 4852.

Test #18:

score: 0
Accepted
time: 28ms
memory: 3540kb

input:

0
0
1
0
0
1
1
0
0
1
0
1
1
0
1
0
0
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
1
0
0
1
1
0
1
0
0
1
0
0
0
0
0
1
0
0
1
1
0
1
0
1
1
0
0
0
0
0
1
0
0
1
1
0
1
1
0
1
0
0
0
0
0
1
0
0
1
1
0
1
1
1
1
0
0
0
0
0
1
0
0
1
1
1
0
0
0
1
0
0
0
0
0
1
0
0
1
1
1
0
0
1
1
0
0
0
0
0
1
0
0
1
1
1
0
1
0
1
0
0
0
0
0
1
0
0
1
1
1
0
1
1
1
0
0
0
...

output:

? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
?...

result:

ok Queries used; 4845.

Test #19:

score: 0
Accepted
time: 42ms
memory: 3464kb

input:

1
0
0
1
0
0
0
1
0
1
0
0
1
0
0
0
1
1
0
1
0
0
1
0
0
1
0
1
0
0
1
1
0
1
0
0
0
0
1
1
1
1
0
0
0
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
0
1
0
1
0
0
0
1
0
0
1
1
0
0
0
0
1
0
1
0
0
0
1
0
1
0
1
0
0
0
0
1
0
1
0
0
0
1
0
1
1
1
0
0
0
0
1
0
1
0
0
0
1
1
0
0
1
0
0
0
0
1
0
1
0
0
0
1
1
0
1
1
0
0
0
0
1
0
1
0
0
0
1
1
1
0
1
0
0
0
...

output:

? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right...

result:

ok Queries used; 4854.

Test #20:

score: 0
Accepted
time: 25ms
memory: 3440kb

input:

0
1
0
1
1
1
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
1
0
0
0
0
1
0
1
1
0
1
1
1
1
0
0
1
0
0
1
0
0
0
0
1
1
1
1
1
0
0
1
0
1
1
0
0
0
0
1
1
1
1
1
0
0
1
1
0
1
0
0
0
0
1
1
1
1
1
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
0
1
0
0
0
1
0
0
0
0
1
1
1
1
1
0
1
0
0
1
1
0
0
0
0
1
1
1
1
1
0
1
0
1
0
1
0
0
0
0
1
1
1
1
1
0
1
0
1
1
1
0
0
0
0
...

output:

? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
?...

result:

ok Queries used; 4955.

Test #21:

score: 0
Accepted
time: 12ms
memory: 3464kb

input:

1
0
0
0
1
1
0
1
1
1
0
0
1
1
0
1
1
0
1
1
0
1
0
0
1
0
1
1
0
1
1
0
1
1
1
1
1
1
1
0
0
0
1
0
1
1
1
0
0
0
1
1
0
1
0
0
0
1
0
1
1
1
0
0
0
1
1
1
1
0
0
0
1
0
1
1
1
0
0
1
0
0
1
1
0
0
0
1
0
1
1
1
0
0
1
0
1
0
1
0
0
0
1
0
1
1
1
0
0
1
0
1
1
1
0
0
0
1
0
1
1
1
0
0
1
1
0
0
1
0
0
0
1
0
1
1
1
0
0
1
1
0
1
1
0
0
0
1
0
1
...

output:

? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ri...

result:

ok Queries used; 5018.

Test #22:

score: 0
Accepted
time: 13ms
memory: 3532kb

input:

1
0
1
1
0
1
0
0
0
0
1
1
0
1
0
1
0
1
0
0
1
0
1
0
0
0
1
1
0
1
1
0
0
0
1
1
1
1
0
1
1
0
0
1
1
1
0
0
0
1
1
1
1
0
1
1
0
1
0
0
1
0
0
0
1
1
1
1
0
1
1
0
1
0
1
1
0
0
0
1
1
1
1
0
1
1
0
1
1
0
1
0
0
0
1
1
1
1
0
1
1
0
1
1
1
1
0
0
0
1
1
1
1
0
1
1
1
0
0
1
1
0
0
0
1
1
1
1
0
1
1
1
0
1
0
1
0
0
0
1
1
1
1
0
1
1
1
0
1
1
...

output:

? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
...

result:

ok Queries used; 4555.

Test #23:

score: 0
Accepted
time: 45ms
memory: 3468kb

input:

1
0
1
0
0
1
1
0
1
0
1
0
0
1
0
1
1
0
0
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
1
0
1
1
0
1
0
1
0
1
0
0
1
0
1
1
0
1
1
0
1
0
1
1
1
0
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
0
1
0
1
1
0
1
1
0
1
1
1
0
1
0
0
1
0
1
1
0
1
1
0
1
1
1
1
1
0
0
1
0
1
1
0
1
1
1
0
0
1
1
1
0
0
1
0
1
1
0
1
1
1
0
1
0
1
1
0
0
1
0
1
1
0
1
1
1
0
1
1
0
1
0
...

output:

? flip
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ...

result:

ok Queries used; 4750.

Test #24:

score: 0
Accepted
time: 20ms
memory: 3432kb

input:

0
1
1
0
0
1
1
0
0
1
1
0
1
1
0
0
1
1
0
1
0
0
1
0
1
0
0
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
1
0
1
0
1
1
0
1
0
1
0
1
0
1
1
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
1
1
0
1
1
1
0
1
0
1
0
1
0
1
1
1
1
1
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
0
1
0
1
0
1
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
1
0
1
0
1
1
0
1
1
0
1
0
1
0
1
1
0
1
0
1
1
...

output:

? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? rig...

result:

ok Queries used; 4906.

Test #25:

score: 0
Accepted
time: 27ms
memory: 3480kb

input:

0
1
0
1
0
1
0
1
0
0
0
1
0
0
1
0
0
1
0
1
0
1
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
1
1
1
0
1
1
1
0
0
0
1
0
1
0
1
0
0
0
1
1
0
0
...

output:

? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right...

result:

ok Queries used; 4470.

Test #26:

score: 0
Accepted
time: 40ms
memory: 3428kb

input:

0
1
0
0
1
0
1
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
0
1
0
0
0
0
0
0
1
0
0
1
0
1
1
1
0
1
1
1
1
0
1
1
1
1
...

output:

? flip
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? ...

result:

ok Queries used; 4915.

Test #27:

score: 0
Accepted
time: 29ms
memory: 3368kb

input:

0
0
0
1
0
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
1
1
0
1
1
1
0
0
1
0
1
0
0
0
1
1
0
1
1
1
0
1
0
1
...

output:

? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? rig...

result:

ok Queries used; 4944.

Test #28:

score: 0
Accepted
time: 27ms
memory: 3444kb

input:

0
1
0
0
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
1
0
1
1
0
0
1
0
1
0
0
0
1
1
1
0
0
0
1
1
...

output:

? flip
? right
? right
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? righ...

result:

ok Queries used; 4018.

Test #29:

score: -100
Wrong Answer
time: 12ms
memory: 3424kb

input:

1
1
1
1
1
1
0
1
0
1
0
0
1
0
0
1
1
0
0
1
1
0
1
1
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
0
...

output:

? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? flip
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? right
? rig...

result:

wrong answer Wrong answer: used too many queries. Queries used: 1016 (507 too many, terminated)