QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#811842#9783. Duloc NetworkI_Love_Sonechka#RE 7ms4316kbC++202.7kb2024-12-13 03:27:112024-12-13 03:27:13

Judging History

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

  • [2024-12-13 03:27:13]
  • 评测
  • 测评结果:RE
  • 用时:7ms
  • 内存:4316kb
  • [2024-12-13 03:27:11]
  • 提交

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];
        }
        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[0] = '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: 3844kb

input:

4
1
2
2

output:

? 1000
? 0010
? 1010
! 1

result:

ok Correct answer with 3 queries.

Test #2:

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

input:

2
0

output:

? 10
! 0

result:

ok Correct answer with 1 queries.

Test #3:

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

input:

4
1
2
2

output:

? 1000
? 0010
? 1010
! 1

result:

ok Correct answer with 3 queries.

Test #4:

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

input:

2
0

output:

? 10
! 0

result:

ok Correct answer with 1 queries.

Test #5:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000
? 01000000000000000000000000000000000000000000000000
? 11000000000000000000000000000000000000000000000000
? 00000000000000000000000000000100000000000000000000
? 10000000000000000000000000000100000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 165 queries.

Test #6:

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

input:

50
10
8
17
8
24
9
28
9
32
8
32
13
34
10
34
10
35
5
34
10
36
14
38

output:

? 10000000000000000000000000000000000000000000000000
? 00000000000000000000000100000000000000000000000000
? 10000000000000000000000100000000000000000000000000
? 00000001000000000000000000000000000000000000000000
? 10000001000000000000000100000000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 23 queries.

Test #7:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000
? 00000000000000000000000000000001000000000000000000
? 10000000000000000000000000000001000000000000000000
? 00000000000000000000000001000000000000000000000000
? 10000000000000000000000001000000000000000000000000
? 000000000000000000000100000000000...

result:

ok Correct answer with 144 queries.

Test #8:

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

input:

50
2
6
7
14
20
4
23
9
27
12
32
8
33
10
35
10
35
5
35
8
34
5
33
10
35
7
34
7
35

output:

? 10000000000000000000000000000000000000000000000000
? 00000000000000000000000000001000000000000000000000
? 10000000000000000000000000001000000000000000000000
? 01000000000000000000000000000000000000000000000000
? 11000000000000000000000000001000000000000000000000
? 000000000000001000000000000000000...

result:

ok Correct answer with 29 queries.

Test #9:

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

input:

50
3
1
4
2
5
1
4
2
5
1
4
1
2
3
5
3
1
3
1
3
5
7
2
4
1
3
3
5
1
3
3
2
2
1
3
3
3
5
1
1
1
2
2
3
1
0

output:

? 10000000000000000000000000000000000000000000000000
? 00000000000000000000001000000000000000000000000000
? 10000000000000000000001000000000000000000000000000
? 00000000000000000000000100000000000000000000000000
? 10000000000000000000000100000000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 46 queries.

Test #10:

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

input:

100
1
1
2
1
2
1
2
3
4
1
2
1
2
2
3
1
2
2
3
1
2
3
4
1
2
4
5
2
3
2
3
1
2
1
2
1
2
2
3
3
4
4
5
1
2
3
4
1
2
3
4
1
2
1
2
2
3
1
2
1
2
2
3
1
2
2
3
2
3
3
4
1
2
2
3
1
2
2
3
3
4
1
2
3
4
1
2
4
5
2
3
1
2
2
3
4
5
1
2
1
2
1
2
1
2
5
6
2
3
2
3
3
4
1
2
3
4
1
2
4
5
2
3
3
4
1
2
1
2
1
2
2
3
1
2
1
0

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
? 10000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 137 queries.

Test #11:

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

input:

100
11
8
18
6
21
9
27
8
34
10
41
15
49
8
53
10
58
5
58
5
59
5
62
6
61
12
62
9
65
5
64
9
65
7
65
10
67
8
68
10
67
8
68
13
68
11
68
11
68
12
68
12
67
15
66
6
65
10
66
13
66
10
66
11
65
13
64
7
64
8
63
7
62
11
61
16
60
12
59
9
58
14
57
8
57

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000
? 10000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 85 queries.

Test #12:

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

input:

100
5
4
9
3
8
4
9
4
9
6
10
4
14
3
13
5
15
3
13
5
13
1
14
5
14
18
3
16
2
17
4
21
3
20
1
18
5
20
4
22
3
22
5
26
5
28
2
30
3
28
4
29
4
32
34
4
36
3
39
38
4
37
2
37
3
37
2
38
3
41
2
38
6
40
2
41
4
41
3
42
2
42
2
41
2
40
4
42
3
43
8
42
2
44
44
6
48
4
48
1
48
2
48
5
48
6
47
1
47
47
3
46
5
47
3
46
45
1
44
...

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000
? 10000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 180 queries.

Test #13:

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

input:

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

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000
? 10000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000...

result:

ok Correct answer with 466 queries.

Test #14:

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

input:

100
1
1
2
1
2
2
3
3
4
3
4
1
2
4
5
1
2
1
2
3
4
4
5
2
3
1
2
1
2
3
4
3
4
1
0

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 10000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 35 queries.

Test #15:

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

input:

150
4
1
5
2
4
4
5
6
11
2
7
2
6
7
12
3
13
1
14
2
15
3
15
3
17
2
19
4
21
1
18
5
21
3
24
1
22
2
22
1
23
3
22
3
25
2
24
2
24
2
24
6
26
5
30
4
34
2
32
4
34
2
32
1
31
1
31
3
30
4
32
3
33
3
36
2
34
36
5
39
5
38
3
39
3
39
4
41
4
43
5
43
2
44
44
2
43
2
45
6
43
2
43
43
1
43
4
47
4
42
2
42
44
4
47
5
52
1
46
4
...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 316 queries.

Test #16:

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

input:

150
4
1
5
2
6
3
7
2
4
3
7
4
8
2
6
5
9
3
7
7
11
4
8
2
6
5
8
1
8
10
2
10
4
12
10
11
4
14
16
2
17
2
18
2
19
2
20
2
22
3
22
1
23
2
24
2
24
3
24
26
2
27
32
2
34
1
33
2
34
4
34
4
35
2
37
3
37
4
37
2
38
5
41
1
40
41
4
44
4
46
3
46
47
4
49
4
50
4
51
3
52
2
52
2
51
2
52
54
1
52
55
4
54
55
4
55
3
54
2
55
1
55...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000...

result:

ok Correct answer with 312 queries.

Test #17:

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

input:

150
3
5
7
4
11
2
9
2
7
3
10
2
9
3
8
1
9
2
10
2
10
2
9
2
11
1
10
2
11
4
13
3
11
2
13
1
12
3
13
3
16
2
15
2
15
2
15
3
16
2
13
1
14
1
14
15
3
14
2
16
5
17
1
17
5
20
22
26
3
24
2
26
1
25
3
27
3
25
1
26
27
7
31
32
6
33
4
37
2
32
3
34
1
35
3
35
4
36
1
37
1
35
2
37
2
37
2
37
3
38
5
36
37
2
37
3
40
1
37
5
4...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 392 queries.

Test #18:

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

input:

150
4
2
6
2
6
4
8
1
5
2
6
2
6
1
5
3
7
1
5
3
7
3
7
2
6
1
5
1
5
3
7
4
8
6
10
2
6
4
8
3
7
2
6
3
7
2
6
2
6
2
6
1
5
4
8
2
6
3
7
1
5
1
5
1
5
2
6
3
7
1
5
3
7
5
9
5
9
5
9
4
8
3
7
8
11
2
13
3
13
1
14
3
15
18
1
16
1
16
4
19
5
19
24
19
2
21
22
3
22
22
1
23
2
24
5
25
5
28
4
32
3
30
7
34
3
36
35
39
40
41
42
43
4...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 394 queries.

Test #19:

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

input:

150
2
2
4
1
3
3
5
1
3
1
3
4
5
1
6
3
8
3
8
1
6
3
8
5
10
5
9
8
4
11
2
13
12
1
12
3
14
14
3
14
1
12
2
13
3
14
1
12
2
13
2
13
3
14
2
13
1
12
2
13
1
12
2
13
14
1
12
2
13
1
12
2
13
2
13
2
13
2
11
13
1
12
2
13
1
10
5
15
3
11
14
2
11
2
13
2
13
2
11
1
12
3
14
1
12
1
10
1
11
3
13
3
12
1
13
4
16
1
13
1
13
2
12...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 521 queries.

Test #20:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000...

result:

ok Correct answer with 1319 queries.

Test #21:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1811 queries.

Test #22:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 385 queries.

Test #23:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000...

result:

ok Correct answer with 957 queries.

Test #24:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 594 queries.

Test #25:

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

input:

200
6
7
13
5
11
3
9
5
11
7
13
12
18
4
10
4
10
2
8
3
9
3
9
5
11
4
8
2
10
2
10
5
12
1
13
16
3
15
4
16
3
15
6
18
5
17
3
15
2
14
2
14
7
19
3
15
3
15
3
15
2
14
1
13
1
13
6
17
5
21
6
27
3
23
25
6
28
31
2
30
30
6
31
2
33
5
35
3
35
7
39
4
42
7
48
3
50
4
53
4
54
10
60
3
60
8
63
4
63
8
71
3
65
3
65
7
64
65
4
...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 411 queries.

Test #26:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001...

result:

ok Correct answer with 526 queries.

Test #27:

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

input:

200
4
1
5
6
10
6
10
5
9
1
5
2
6
2
6
7
10
5
15
3
13
4
13
2
15
4
17
2
15
7
20
4
15
4
19
1
16
6
20
1
21
2
20
2
22
5
25
21
6
24
4
27
3
30
5
32
3
28
4
30
1
31
32
3
33
6
36
2
30
3
32
4
35
5
39
4
42
6
47
3
50
1
47
4
50
2
52
5
53
4
54
2
56
56
1
54
2
56
1
55
2
55
6
57
5
57
4
57
3
59
5
60
62
3
65
4
64
3
65
2
...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 456 queries.

Test #28:

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

input:

200
6
5
11
3
9
6
12
5
11
5
11
6
12
1
7
1
7
6
12
3
9
4
10
6
12
4
10
6
12
6
12
6
12
5
11
2
8
3
9
5
11
4
10
3
9
4
10
5
11
5
9
7
16
6
15
3
12
2
11
3
11
8
18
3
20
2
22
4
22
2
24
2
24
5
26
4
30
9
31
6
35
39
3
39
7
43
45
3
46
6
48
6
52
3
54
5
59
4
54
5
55
3
57
3
59
61
5
63
4
65
4
65
5
69
5
73
4
74
5
76
2
7...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 446 queries.

Test #29:

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

input:

200
7
2
9
2
9
4
10
2
12
4
14
4
14
7
17
3
13
2
12
8
17
19
7
22
7
29
3
25
3
25
5
26
4
30
28
3
29
5
29
7
35
5
37
4
41
3
39
4
43
4
41
6
47
6
47
2
41
3
44
2
43
7
45
5
47
5
50
8
57
8
62
2
63
6
65
5
68
9
73
5
74
4
76
5
75
4
77
80
5
79
5
84
80
7
82
6
84
6
84
3
85
4
86
4
87
2
87
5
87
4
88
5
89
4
90
3
93
6
91...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 390 queries.

Test #30:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 859 queries.

Test #31:

score: 0
Accepted
time: 6ms
memory: 3968kb

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1187 queries.

Test #32:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000...

result:

ok Correct answer with 1378 queries.

Test #33:

score: 0
Accepted
time: 6ms
memory: 3952kb

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 899 queries.

Test #34:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 996 queries.

Test #35:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000...

result:

ok Correct answer with 759 queries.

Test #36:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1264 queries.

Test #37:

score: -100
Runtime Error

input:

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

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000...

result: