QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#811846#9783. Duloc NetworkI_Love_Sonechka#WA 19ms4708kbC++202.8kb2024-12-13 03:29:072024-12-13 03:29:10

Judging History

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

  • [2024-12-13 03:29:10]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:4708kb
  • [2024-12-13 03:29:07]
  • 提交

answer

#include <complex.h>
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pi pair<int, int>
#define pb push_back

using namespace std;
using ll = long long;

template<typename T_container, typename T = typename enable_if
    <!is_same<T_container, string>::value, typename
    T_container::value_type>::type>

ostream& operator<<(ostream &os, const T_container &v) {
    os << '{';
    string sep;
    for(const T &x : v) {
        os << sep << x;
        sep = ", ";
    }
    return os << '}';
}


void dbg_out(){cerr<<endl;}
template <typename Head, typename... Tail>void dbg_out(Head H
    , Tail... T){cerr << ' ' << H; dbg_out(T...); }

#define dbg(...) dbg_out(__VA_ARGS__)

// #define TEST_CASES
#define vt vector

const int amax = 12;

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

void get() {
    int n = 200;
    double res = 0;
    for(int i = 1; i < n; ++i) {
        double P = 1;
        for(int j = 1; j <= i; ++j) {
            P /= i;
            res += P * j;
            P *= (i-1);
        }
    }
    cout << 2 * res << '\n';
}

const int MAX_QUERIES = 3500;

void solve() {
    int n; cin >> n;
    map<string, int> queries;
    auto Ask = [&](string s) -> int {
        if(queries.count(s)) {
            return queries[s];
        }
        if(queries.size() == MAX_QUERIES) {
            cout << "! " << rng() % 2 << endl;
            exit(0);
        }
        assert(queries.size() < MAX_QUERIES);
        cout << "? " << s << endl;
        fflush(stdout);
        int ret; cin >> ret;
        return queries[s] = ret;
    };
    string S;
    for(int i = 0; i < n; ++i) {
        S.push_back('0');
    }
    string T = S;
    S[rng()%n] = '1';
    for(int i = 1; i < n; ++i) {
        vt<int> other;
        for(int j = 0; j < n; ++j) if(S[j] == '0') {
            other.push_back(j);
        }
        int value = Ask(S);
        if(value == n - i) {
            break;
        }
        if(value == 0) {
            cout << "! 0" << endl;
            fflush(stdout);
            return ;
        }
        shuffle(other.begin(), other.end(), rng);
        for(auto u: other) {
            T[u] = '1';
            int u_value = Ask(T);
            T[u] = '0';
            S[u] = '1';
            int u_and_s = Ask(S);
            S[u] = '0';
            int s_value = Ask(S);
            int inter = s_value + u_value - u_and_s;
            if(inter != 0) {
                S[u] = '1';
                break;
            }
        }
    }
    cout << "! 1" << endl;
    fflush(stdout);
}

int main() {
    // cin.tie(0)->sync_with_stdio(0);
int tt = 1;
#ifdef TEST_CASES
    cin >> tt;
#endif
    while(tt--)
        solve();
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3536kb

input:

4
3

output:

? 0100
! 1

result:

ok Correct answer with 1 queries.

Test #2:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

2
0

output:

? 01
! 0

result:

ok Correct answer with 1 queries.

Test #3:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

4
2
1
2

output:

? 0010
? 1000
? 1010
! 1

result:

ok Correct answer with 3 queries.

Test #4:

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

input:

2
0

output:

? 01
! 0

result:

ok Correct answer with 1 queries.

Test #5:

score: 0
Accepted
time: 2ms
memory: 3580kb

input:

50
1
1
2
1
2
1
2
4
5
1
2
1
2
1
2
3
4
2
3
2
3
2
3
1
2
1
2
1
2
1
2
3
4
1
2
3
4
4
5
1
2
3
4
2
2
2
4
3
5
4
6
4
2
4
3
5
3
1
3
4
5
2
4
3
5
3
3
3
3
5
7
4
9
5
9
1
6
6
3
8
8
5
7
1
6
6
3
5
2
5
4
9
3
6
1
5
6
6
6
5
6
7
6
6
6
1
4
5
6
9
2
7
6
4
7
6
9
2
8
10
2
12
10
11
12
11
13
12
11
11
3
10
12
11
14
12
13
11
10
1...

output:

? 00000000000001000000000000000000000000000000000000
? 00000000000000000000000000000000010000000000000000
? 00000000000001000000000000000000010000000000000000
? 00000000000000000000000000000000000010000000000000
? 00000000000001000000000000000000000010000000000000
? 000100000000000000000000000000000...

result:

ok Correct answer with 186 queries.

Test #6:

score: 0
Accepted
time: 1ms
memory: 3596kb

input:

50
10
8
16
6
21
5
23
13
27
13
31
10
32
9
33
8
34
10
35
11
38
15
38

output:

? 00000000000000000000010000000000000000000000000000
? 00100000000000000000000000000000000000000000000000
? 00100000000000000000010000000000000000000000000000
? 00000000000000000100000000000000000000000000000000
? 00100000000000000100010000000000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 23 queries.

Test #7:

score: 0
Accepted
time: 2ms
memory: 3568kb

input:

50
3
4
7
1
4
1
4
1
4
2
5
2
5
4
6
2
7
4
11
2
8
1
9
1
8
4
12
3
11
9
1
9
1
10
2
8
3
7
3
9
10
2
11
3
8
2
7
1
8
4
7
1
8
1
8
5
10
1
11
3
10
10
1
9
10
1
10
5
9
8
1
9
9
1
7
1
8
3
8
3
10
11
11
11
2
9
9
9
10
8
9
9
3
12
10
1
8
1
7
8
7
8
6
7
7
1
7
2
8
7
5
6
7
6
1
4
3
4
1
4
3
2
3
2
3
3
3
3
3
3
1
2
2
2
4
2
2
3
2
...

output:

? 00000000010000000000000000000000000000000000000000
? 00010000000000000000000000000000000000000000000000
? 00010000010000000000000000000000000000000000000000
? 00000000000000000000000000000000000001000000000000
? 00000000010000000000000000000000000001000000000000
? 000001000000000000000000000000000...

result:

ok Correct answer with 143 queries.

Test #8:

score: 0
Accepted
time: 1ms
memory: 3656kb

input:

50
7
7
14
8
14
9
20
10
25
9
30
8
33
9
33
13
36
10
37
7
37
8
36
8
36
8
35
12
34
4
34
5
33
4
32
7
31
12
30
11
30

output:

? 00000000000000000000000000100000000000000000000000
? 00000000000000000000000100000000000000000000000000
? 00000000000000000000000100100000000000000000000000
? 00000000000000000000001000000000000000000000000000
? 00000000000000000000001000100000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 41 queries.

Test #9:

score: 0
Accepted
time: 2ms
memory: 3624kb

input:

50
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2
2
3
5
7
3
1
3
1
3
3
2
4
3
5
2
4
1
3
1
3
1
3
3
3
5
2
4
1
3
1
3
1
3
1
3
3
5
2
4
3
3
5
3
1
3
3
5
1
3
1
3
3
2
1
3
5
2
4
3
5
5
3
2
4
3
2
4
7
3
1
3
1
3
2
4
3
2
4
1
3
2
4
4
3
1
3
3
3
1
3
3
1
1
2
1
2
4
1
2
2
2
3
2
2
2
2
2
3
6
2
4
3
2
2
4
2
3
2
4
2
3
3
3
2
2
2
2
2
4
2
2
2
3...

output:

? 00010000000000000000000000000000000000000000000000
? 00000000000000000000000000001000000000000000000000
? 00010000000000000000000000001000000000000000000000
? 00000000000000000000100000000000000000000000000000
? 00010000000000000000100000000000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 155 queries.

Test #10:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

100
2
1
3
2
4
2
4
1
3
1
3
1
3
4
6
1
3
3
5
1
3
2
4
1
3
1
3
4
6
3
5
1
3
5
7
5
7
3
5
3
5
1
3
3
5
1
3
2
4
1
3
3
5
1
3
1
3
1
3
2
4
3
2
2
4
4
3
5
3
2
4
2
4
1
3
1
3
2
4
3
3
5
2
4
2
4
1
3
3
4
6
1
3
1
3
4
1
3
2
4
5
1
3
1
3
1
3
3
1
3
2
4
1
3
7
1
3
5
3
7
1
3
2
4
4
4
3
5
4
6
1
3
1
3
2
4
1
3
1
3
2
4
4
6
2
4
2
4
...

output:

? 0000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000100000000100000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 487 queries.

Test #11:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

100
7
11
17
10
25
7
31
11
38
5
41
5
42
11
48
8
51
12
57
13
64
10
64
11
64
6
64
8
65
8
67
16
67
10
69
8
70
9
70
13
70
7
69
12
68
6
67
8
66
6
65
11
65
12
66
9
65
5
65
6
67
6
67
15
67

output:

? 0000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000
? 0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00010000000000000000000000000000000000000000000000000000000000000010000000000000000000000000...

result:

ok Correct answer with 65 queries.

Test #12:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

100
4
6
10
1
5
5
9
4
8
3
7
1
5
3
6
4
10
5
11
3
9
3
9
4
10
2
8
5
10
14
3
13
3
13
6
14
2
16
4
18
3
17
3
16
2
17
1
18
6
23
19
7
22
1
21
2
22
4
24
2
26
2
26
2
25
4
24
4
28
4
24
2
26
1
25
3
26
3
27
30
2
27
3
29
5
30
32
33
5
34
2
33
35
39
4
34
3
34
1
33
36
37
6
38
4
38
3
39
40
2
40
1
40
2
39
39
4
39
3
38
...

output:

? 0000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000
? 00000000000000000000000000000000000000000100000000000000000000000000000000010000000000000000...

result:

ok Correct answer with 180 queries.

Test #13:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

100
1
1
2
3
4
2
3
2
3
2
3
1
2
1
2
2
3
1
2
1
2
2
3
1
2
1
2
2
3
4
5
1
2
2
3
4
5
1
2
1
2
1
2
3
4
2
3
1
2
3
4
1
2
4
5
3
4
2
3
3
4
1
2
1
2
1
2
1
2
2
3
1
2
3
4
1
2
1
2
1
2
1
2
2
3
1
2
2
3
1
2
2
3
3
4
1
2
1
2
1
2
1
2
3
4
3
4
1
2
2
3
1
2
4
5
4
5
2
3
1
2
1
2
1
2
2
3
2
3
2
3
1
2
1
2
1
2
1
2
3
4
1
2
5
6
3
4
4
...

output:

? 0000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000
? 00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000...

result:

ok Correct answer with 502 queries.

Test #14:

score: 0
Accepted
time: 5ms
memory: 3852kb

input:

100
3
2
5
1
4
1
4
1
4
2
5
4
7
2
5
3
6
1
4
4
7
1
4
1
4
2
5
1
4
1
4
2
5
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
1
4
2
5
1
4
1
3
2
5
1
3
6
4
1
4
1
4
1
4
4
2
5
5
4
2
5
3
6
3
6
4
1
4
1
4
5
8
1
4
1
4
1
2
4
1
3
1
3
3
7
3
2
3
8
1
4
1
4
2
5
4
1
4
1
4
5
2
5
4
1
4
2
5
4
4
4
4
1
4
1
4
4
5
3
6
1
4
3
2
2
4
4
3
3
6
4
...

output:

? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 586 queries.

Test #15:

score: 0
Accepted
time: 3ms
memory: 3728kb

input:

150
7
3
10
2
9
2
9
4
10
2
12
1
11
12
2
12
4
14
5
15
2
12
2
12
3
13
1
11
1
11
2
12
4
14
3
13
2
12
3
13
2
12
3
13
2
10
2
12
2
12
1
11
3
13
4
13
15
3
14
6
19
6
22
1
23
24
3
23
3
26
4
24
5
29
3
27
4
27
2
29
2
28
2
30
1
29
4
32
1
29
1
29
28
1
29
33
4
29
30
2
29
3
31
3
33
35
36
2
37
3
36
4
39
4
41
3
42
3
...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000
? 0000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 328 queries.

Test #16:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

150
3
1
4
3
6
3
6
3
6
2
5
1
4
4
6
1
7
2
7
3
10
3
10
2
9
1
8
2
9
3
10
1
8
4
11
3
10
3
10
4
10
1
11
2
12
2
12
1
11
1
11
1
11
3
13
2
9
10
3
12
1
10
2
9
10
11
12
3
12
4
13
4
13
12
2
11
2
11
2
11
2
10
2
12
4
14
4
14
11
11
3
13
3
12
5
15
4
19
5
20
1
14
1
15
4
18
3
16
2
18
4
19
20
3
22
7
26
2
21
4
22
3
25
...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 358 queries.

Test #17:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

150
1
3
4
2
3
1
2
1
2
4
5
3
4
4
5
2
3
5
6
1
2
3
4
2
3
5
6
4
5
2
3
1
2
1
2
3
4
3
4
2
3
4
5
1
2
4
5
2
3
1
2
3
4
2
3
1
2
1
2
1
2
4
5
1
2
4
5
3
4
1
2
2
3
2
3
1
2
5
6
3
4
3
4
1
2
5
6
5
6
2
3
2
3
3
4
5
6
2
3
2
3
2
3
2
3
4
5
1
2
2
3
2
3
4
5
1
2
5
6
2
3
1
2
2
3
3
4
2
3
3
4
4
5
1
2
2
3
3
4
1
2
1
2
3
4
1
2
6
...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 571 queries.

Test #18:

score: 0
Accepted
time: 3ms
memory: 3752kb

input:

150
7
5
11
3
14
1
12
3
11
5
16
2
13
4
14
16
2
16
3
17
15
2
15
3
18
3
18
3
17
2
18
1
19
6
23
3
26
2
23
5
24
2
26
4
28
3
24
2
24
3
26
2
28
2
28
28
1
28
31
3
30
4
34
1
29
33
30
3
29
2
30
5
31
2
33
4
35
3
33
4
36
4
40
6
38
1
39
1
39
39
4
43
5
40
4
44
2
39
2
39
2
38
1
38
3
37
1
38
1
38
3
38
6
41
42
1
41
...

output:

? 000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 366 queries.

Test #19:

score: 0
Accepted
time: 5ms
memory: 3788kb

input:

150
2
1
3
1
3
4
6
1
3
1
3
1
3
2
4
1
3
3
5
2
4
1
3
1
3
1
3
1
3
1
3
1
3
3
5
2
4
2
4
3
5
2
4
1
3
1
3
1
3
2
4
3
5
2
4
2
4
2
4
1
3
3
5
5
7
1
3
3
5
1
3
1
3
1
3
5
7
2
4
1
3
2
4
1
3
1
3
4
6
1
3
2
4
4
6
1
3
3
5
1
3
1
3
1
3
2
4
2
4
3
5
2
4
3
5
2
4
2
4
1
3
3
5
1
3
2
4
2
4
1
3
2
4
2
4
5
7
2
4
2
4
3
5
2
4
1
3
1
...

output:

? 000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1068 queries.

Test #20:

score: 0
Accepted
time: 5ms
memory: 3940kb

input:

200
1
1
2
2
3
2
2
4
6
2
4
1
3
4
6
2
4
4
6
1
2
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
2
4
1
3
1
3
1
3
3
5
2
4
1
3
2
4
1
3
3
2
3
1
4
1
4
4
4
6
1
7
1
7
1
7
7
1
7
1
7
2
6
1
7
1
7
1
7
7
1
7
7
1
7
1
7
4
10
1
7
2
8
1
7
7
1
7
7
1
7
7
5
11
1
5
3
5
1
6
2
7
2
7
3
8
1
6
3
8
2
7
6
1
6
1
6
1
6
1
6
1
6
1
6
1
6
2
7
1
6
1
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000...

result:

ok Correct answer with 888 queries.

Test #21:

score: 0
Accepted
time: 0ms
memory: 3932kb

input:

200
1
3
4
1
2
1
2
1
2
3
4
1
2
1
2
3
4
2
3
1
2
2
3
4
5
1
2
1
2
1
2
1
2
2
3
2
3
2
3
2
3
2
3
3
4
3
4
2
3
4
5
2
3
2
3
3
4
1
2
2
3
3
4
1
2
3
4
3
4
1
2
1
2
3
4
1
2
2
3
3
4
1
2
2
3
2
3
5
6
2
3
2
3
2
3
1
2
2
3
1
2
2
3
1
2
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
1
2
3
4
1
2
2
3
2
3
1
2
1
1
4
4
5
2
6
2
6
6
1
5
1
5
6
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1157 queries.

Test #22:

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

input:

200
1
2
3
3
4
2
3
2
3
3
4
2
3
1
2
2
3
2
3
5
6
4
5
1
2
2
3
1
2
1
2
1
2
1
2
3
4
3
4
3
4
2
3
1
2
5
6
3
4
2
3
3
4
1
2
1
2
1
2
3
4
4
5
2
3
1
2
3
4
1
2
3
4
2
3
1
2
6
7
1
2
2
3
1
2
1
2
2
3
1
2
2
3
1
2
3
4
2
3
3
4
1
2
1
2
2
3
3
4
2
3
3
4
3
4
2
3
3
4
1
2
1
2
1
2
2
3
3
4
2
3
1
2
2
3
1
2
2
3
3
4
1
2
1
2
2
3
1
...

output:

? 00000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1494 queries.

Test #23:

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

input:

200
2
3
5
2
4
2
4
2
4
1
3
1
3
3
5
4
6
2
4
3
5
1
3
1
3
2
4
2
4
2
4
1
3
1
3
1
3
1
3
1
3
1
3
4
4
2
6
1
3
2
5
3
6
4
7
3
6
2
5
3
6
5
1
4
2
5
3
5
6
2
7
3
8
1
6
1
6
2
7
2
7
2
7
1
4
1
5
7
1
5
3
7
2
6
2
6
3
7
3
7
1
5
4
7
3
10
1
8
2
9
2
9
2
9
1
8
9
8
3
8
2
10
1
9
9
11
2
10
1
7
8
9
4
11
2
9
3
10
10
1
8
2
9
2
9...

output:

? 00000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000...

result:

ok Correct answer with 953 queries.

Test #24:

score: 0
Accepted
time: 2ms
memory: 3912kb

input:

200
2
5
7
3
5
3
5
2
4
5
7
1
3
4
6
3
5
2
4
3
5
1
3
3
5
1
3
3
5
4
6
4
6
2
4
2
4
4
6
1
3
1
3
2
4
2
4
1
3
3
5
2
4
4
6
1
3
2
4
1
3
3
5
1
3
1
3
2
4
2
4
5
7
2
4
3
5
2
4
4
6
4
6
6
8
3
5
7
9
2
4
3
5
3
5
3
5
1
3
3
5
2
4
4
6
2
4
4
6
2
4
3
5
3
5
4
6
2
4
3
5
3
5
2
4
1
3
2
4
4
6
4
4
1
5
5
6
1
5
8
3
7
3
7
6
8
11
5...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100...

result:

ok Correct answer with 558 queries.

Test #25:

score: 0
Accepted
time: 3ms
memory: 3664kb

input:

200
5
1
6
6
11
6
11
3
8
6
11
7
12
4
9
6
11
4
9
10
15
3
8
4
9
8
12
1
13
2
14
5
17
5
17
4
16
3
15
1
13
6
17
3
20
3
20
4
21
4
19
1
20
5
24
23
2
20
4
24
1
21
3
23
2
22
3
23
3
22
1
23
6
27
5
32
3
30
7
30
6
35
36
5
38
2
39
4
43
6
43
7
48
6
51
6
55
3
57
9
63
3
65
5
66
68
5
72
6
73
3
74
2
73
7
79
79
80
3
80...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 402 queries.

Test #26:

score: 0
Accepted
time: 3ms
memory: 3940kb

input:

200
4
5
9
5
9
1
5
5
9
6
10
2
6
2
6
4
8
4
8
6
10
4
8
1
5
5
9
2
6
4
8
6
10
8
11
6
17
5
16
3
13
3
16
5
17
3
20
23
19
7
21
5
26
11
30
5
34
8
40
6
43
3
46
5
46
3
48
8
54
5
55
1
56
57
9
62
4
66
3
63
4
65
4
65
1
66
4
68
4
71
8
75
2
77
9
80
4
82
3
83
3
83
3
84
2
86
4
84
5
85
5
87
89
5
89
5
90
2
91
5
93
97
2...

output:

? 00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000...

result:

ok Correct answer with 441 queries.

Test #27:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

200
1
4
5
4
5
5
5
1
6
4
9
3
8
2
7
4
9
5
10
3
8
8
13
2
7
1
6
2
7
3
8
1
6
3
8
2
6
1
7
4
10
5
10
1
11
2
12
11
5
14
4
18
3
17
3
17
17
18
4
18
16
3
19
4
20
17
1
17
3
19
5
19
3
21
25
3
24
22
1
21
6
25
2
27
4
27
5
32
4
30
33
6
34
5
39
4
35
2
37
6
39
5
42
4
46
4
44
2
45
49
8
50
53
2
52
2
49
3
49
9
54
2
54
1...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000...

result:

ok Correct answer with 469 queries.

Test #28:

score: 0
Accepted
time: 3ms
memory: 3796kb

input:

200
6
4
10
8
14
4
10
5
11
6
12
9
15
8
14
8
14
5
11
4
9
4
13
5
13
3
16
8
21
7
19
4
22
5
25
6
30
9
39
3
32
9
38
3
39
5
44
6
42
5
46
4
48
52
5
50
2
52
4
54
7
53
4
54
3
55
3
58
4
58
3
59
4
63
5
60
4
59
5
59
5
63
3
66
3
63
2
64
10
68
72
6
69
3
70
4
72
3
73
10
75
80
6
76
6
79
2
79
5
80
2
80
6
80
3
83
2
81...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 433 queries.

Test #29:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

200
5
5
10
3
8
3
8
3
8
3
8
2
7
8
12
4
16
3
15
5
17
6
18
4
16
8
19
6
25
4
21
6
26
7
31
5
34
3
37
6
38
5
42
2
44
4
43
1
44
6
49
7
48
5
51
4
54
8
60
65
4
67
6
68
3
68
4
71
5
71
8
74
2
73
8
78
2
77
3
80
10
83
7
87
3
88
5
87
1
88
5
89
3
91
6
94
4
93
4
94
4
94
2
94
7
96
9
98
1
98
5
101
3
103
5
103
104
6
1...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000...

result:

ok Correct answer with 294 queries.

Test #30:

score: 0
Accepted
time: 7ms
memory: 4172kb

input:

200
3
2
5
3
6
1
4
2
5
3
6
2
5
1
3
1
4
1
4
2
5
1
4
1
4
3
6
4
1
4
1
4
2
5
1
4
1
4
3
6
1
4
1
4
1
4
1
4
3
6
2
5
1
4
3
6
2
5
2
5
3
3
2
5
4
2
5
5
8
2
5
1
4
4
3
6
2
5
3
6
3
6
2
5
2
5
3
6
4
7
1
4
4
1
4
3
6
1
4
1
4
1
4
1
4
1
4
2
5
2
5
2
3
2
5
4
7
2
5
1
4
1
4
1
4
5
1
4
1
4
6
2
5
1
4
2
5
2
5
2
5
3
6
2
5
1
4
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1307 queries.

Test #31:

score: 0
Accepted
time: 3ms
memory: 4072kb

input:

200
1
2
3
2
3
1
2
3
4
3
4
1
2
3
4
3
4
3
4
2
3
1
2
1
2
1
2
1
2
2
3
2
3
2
3
4
5
2
3
2
3
3
4
2
3
2
3
1
2
1
2
1
2
1
2
2
3
4
5
2
3
1
2
3
4
1
2
3
4
3
4
2
3
1
2
1
2
3
4
3
4
3
4
1
2
2
3
1
2
3
4
1
2
1
2
1
2
2
3
2
3
3
4
2
3
2
3
2
3
1
2
2
3
4
5
3
4
1
2
1
2
2
3
3
4
2
3
3
4
1
2
3
4
3
4
1
2
1
2
2
3
3
4
3
4
2
3
3
...

output:

? 00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 901 queries.

Test #32:

score: 0
Accepted
time: 3ms
memory: 4008kb

input:

200
4
2
6
3
7
1
5
1
5
1
5
2
6
4
8
1
5
1
5
1
5
4
8
2
5
1
6
2
7
3
8
1
5
1
6
4
9
4
9
1
6
2
7
3
8
1
6
1
6
4
9
4
9
2
7
2
7
3
8
6
3
8
8
1
6
1
6
2
7
1
6
2
7
1
6
1
6
2
7
1
6
3
8
3
8
2
5
1
6
6
3
8
1
6
1
6
7
1
6
1
6
5
8
2
10
2
10
1
9
2
10
11
2
10
1
9
3
11
1
9
1
9
1
9
2
10
1
9
2
10
2
8
1
9
10
3
11
2
10
3
11
3
...

output:

? 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1148 queries.

Test #33:

score: 0
Accepted
time: 0ms
memory: 3964kb

input:

200
1
3
4
6
7
1
2
2
3
2
3
2
3
3
4
2
3
1
2
3
4
1
2
1
2
2
3
1
2
3
4
2
3
1
2
1
2
1
2
5
6
3
4
2
3
2
3
2
3
1
2
5
6
1
2
2
3
3
4
1
2
2
3
3
4
2
1
2
3
3
2
3
2
3
4
3
2
5
1
4
4
7
2
5
4
2
5
3
6
2
5
2
5
1
4
1
4
3
6
5
2
3
1
4
1
4
1
4
1
4
1
4
6
1
4
2
5
2
5
6
2
5
1
4
4
6
2
5
3
6
3
6
4
7
1
4
1
4
3
6
1
4
2
5
3
6
2
5
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1432 queries.

Test #34:

score: 0
Accepted
time: 11ms
memory: 4228kb

input:

200
2
1
3
2
4
2
4
3
5
2
4
2
4
2
4
3
5
1
3
2
4
1
3
2
4
3
5
3
5
3
5
2
4
2
4
2
4
2
4
2
4
2
4
1
3
3
5
2
4
1
3
3
5
2
4
3
5
1
3
2
4
2
2
2
4
4
1
3
2
4
1
3
1
3
1
3
1
3
2
4
3
2
4
2
4
4
6
5
3
5
2
4
2
4
4
6
5
1
3
1
3
2
4
4
6
1
3
2
4
2
4
2
4
3
1
3
2
4
2
4
1
3
1
3
1
3
2
4
2
4
3
5
2
4
1
3
3
5
2
4
2
4
1
3
1
3
3
5
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1391 queries.

Test #35:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

200
2
2
4
1
3
3
5
2
4
1
3
3
5
3
5
2
4
2
4
2
4
2
4
2
4
2
4
3
5
3
5
2
4
3
5
1
3
2
4
2
4
1
3
3
5
3
5
2
4
3
5
2
4
2
4
2
4
2
2
4
2
4
3
5
2
4
2
4
4
2
4
3
5
2
4
1
3
3
3
2
5
2
5
3
6
3
6
3
6
3
6
3
6
1
4
5
3
6
3
6
2
5
3
6
2
5
2
5
2
5
2
5
2
5
6
6
2
3
3
6
4
3
6
4
6
4
5
3
6
2
5
5
2
5
2
5
5
4
3
6
5
3
4
2
6
7
2
6
...

output:

? 00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 963 queries.

Test #36:

score: 0
Accepted
time: 2ms
memory: 3860kb

input:

200
2
3
5
2
4
2
4
3
5
3
5
2
4
2
4
3
5
2
4
2
4
3
5
3
5
2
4
2
4
3
5
2
4
2
4
3
5
3
4
3
7
2
6
3
7
7
7
3
7
3
7
1
5
2
6
3
7
2
6
2
6
3
7
3
7
3
4
3
7
2
6
2
6
2
6
2
6
6
3
7
2
6
2
6
2
6
3
7
2
6
2
6
2
6
2
6
2
6
2
6
2
6
6
3
7
2
6
3
7
2
6
2
6
3
7
2
6
2
6
7
3
7
3
6
3
9
2
8
3
9
2
8
8
3
9
9
2
8
3
9
9
2
8
3
9
3
9
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1045 queries.

Test #37:

score: -100
Wrong Answer
time: 19ms
memory: 4708kb

input:

200
1
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
1
2
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
3
2
...

output:

? 00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

wrong answer Wrong answer.