QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#773866#9783. Duloc Networkucup-team6023#RE 13ms3828kbC++201.0kb2024-11-23 10:37:592024-11-23 10:38:00

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
1
2
1
1
3
2
2
2
1
1
2
0

output:

? 1000
? 0110
? 1110
? 1000
? 0100
? 1100
? 1100
? 0010
? 1110
? 1110
? 0001
? 1111
! 1

result:

ok Correct answer with 12 queries.

Test #2:

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

input:

2
0
0
0

output:

? 10
? 01
? 11
! 0

result:

ok Correct answer with 3 queries.

Test #3:

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

input:

4
1
2
1
1
3
2
2
2
1
1
2
0

output:

? 1000
? 0110
? 1110
? 1000
? 0100
? 1100
? 1100
? 0010
? 1110
? 1110
? 0001
? 1111
! 1

result:

ok Correct answer with 12 queries.

Test #4:

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

input:

2
0
0
0

output:

? 10
? 01
? 11
! 0

result:

ok Correct answer with 3 queries.

Test #5:

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

input:

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

output:

? 10000000000000000000000000000000000000000000000000
? 01111111111111111111111111000000000000000000000000
? 11111111111111111111111111000000000000000000000000
? 10000000000000000000000000000000000000000000000000
? 01111111111110000000000000000000000000000000000000
? 111111111111100000000000000000000...

result:

ok Correct answer with 612 queries.

Test #6:

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

input:

50
10
25
24
10
36
36
10
32
33
10
20
22
10
13
19
19
26
24
19
37
35
19
31
34
19
23
30
19
8
21
21
26
23
21
37
34
21
32
35
21
22
32
21
6
22
22
27
23
22
37
34
22
29
35
22
18
32
22
13
30
30
27
22
30
37
33
30
26
35
30
16
33
30
8
32
32
28
22
32
37
32
32
30
34
32
15
34
32
10
33
33
28
21
33
36
31
33
33
35
33
...

output:

? 10000000000000000000000000000000000000000000000000
? 01111111111111111111111111000000000000000000000000
? 11111111111111111111111111000000000000000000000000
? 10000000000000000000000000000000000000000000000000
? 01111111111110000000000000000000000000000000000000
? 111111111111100000000000000000000...

result:

ok Correct answer with 579 queries.

Test #7:

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

input:

50
1
16
16
1
16
17
1
15
15
1
16
16
1
15
16
1
15
16
5
16
16
5
16
18
5
13
17
5
8
12
5
3
7
7
17
17
7
13
17
7
9
16
7
12
16
7
8
15
7
11
16
8
17
17
8
10
17
8
10
18
8
9
16
8
9
17
8
8
16
8
17
16
8
11
16
8
10
18
8
9
17
8
10
18
8
9
17
8
16
16
8
8
15
8
10
17
8
5
13
8
8
15
10
16
16
10
9
16
10
8
16
10
5
15
10
6
...

output:

? 10000000000000000000000000000000000000000000000000
? 01111111111111111111111111000000000000000000000000
? 11111111111111111111111111000000000000000000000000
? 10000000000000000000000000000000000000000000000000
? 01111111111110000000000000000000000000000000000000
? 111111111111100000000000000000000...

result:

ok Correct answer with 564 queries.

Test #8:

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

input:

50
2
23
24
2
30
31
2
32
33
2
23
24
2
14
15
15
24
24
15
29
30
15
30
33
15
21
27
15
8
21
21
25
23
21
31
31
21
29
33
21
23
30
21
8
24
24
26
23
24
32
31
24
28
33
24
18
30
24
7
27
27
27
22
27
34
31
27
29
33
27
22
33
27
12
30
30
28
22
30
35
31
30
28
32
30
17
33
30
12
33
33
28
21
33
34
31
33
26
32
33
14
33...

output:

? 10000000000000000000000000000000000000000000000000
? 01111111111111111111111111000000000000000000000000
? 11111111111111111111111111000000000000000000000000
? 10000000000000000000000000000000000000000000000000
? 01111111111110000000000000000000000000000000000000
? 111111111111100000000000000000000...

result:

ok Correct answer with 579 queries.

Test #9:

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

input:

50
3
16
15
3
13
13
3
6
6
3
3
4
3
1
4
3
2
5
2
16
15
2
13
13
2
7
7
2
4
4
2
1
3
2
2
4
2
16
14
2
12
14
2
14
14
2
13
15
2
14
14
1
15
14
1
11
12
1
13
14
1
13
14
1
14
15
1
14
15
0
14
14
0
8
8
0
3
3
0
2
2
0
1
1
0
0
0

output:

? 10000000000000000000000000000000000000000000000000
? 01111111111111111111111111000000000000000000000000
? 11111111111111111111111111000000000000000000000000
? 10000000000000000000000000000000000000000000000000
? 01111111111110000000000000000000000000000000000000
? 111111111111100000000000000000000...

result:

ok Correct answer with 87 queries.

Test #10:

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

input:

100
1
28
29
1
22
21
1
28
27
1
27
28
1
26
27
1
27
26
0
29
29
0
21
21
0
10
10
0
6
6
0
3
3
0
1
1
0
0
0

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000
? 11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000...

result:

ok Correct answer with 39 queries.

Test #11:

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

input:

100
11
49
48
11
65
64
11
60
61
11
46
48
11
27
33
11
13
23
23
50
48
23
65
64
23
60
63
23
46
50
23
26
40
23
9
27
27
50
47
27
66
64
27
62
64
27
48
53
27
25
43
27
11
33
33
51
47
33
68
65
33
57
63
33
43
55
33
26
48
33
8
40
40
51
46
40
68
65
40
58
62
40
41
57
40
30
50
40
7
43
43
52
46
43
69
65
43
56
62
43...

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000
? 11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000...

result:

ok Correct answer with 1440 queries.

Test #12:

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

input:

100
5
36
36
5
46
46
5
29
32
5
16
19
5
10
14
5
3
8
5
6
11
8
37
36
8
44
46
8
27
32
8
18
24
8
8
16
8
10
18
8
12
19
9
37
37
9
42
46
9
27
34
9
20
28
9
8
17
9
10
19
9
16
24
16
38
37
16
41
46
16
25
36
16
15
29
16
8
22
16
3
19
16
6
22
16
37
36
16
40
46
16
25
37
16
16
30
16
8
24
16
12
28
16
13
29
18
38
36
18...

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000
? 11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000...

result:

ok Correct answer with 1464 queries.

Test #13:

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

input:

100
1
34
33
1
38
39
1
35
35
1
35
36
1
34
34
1
35
35
3
35
33
3
37
37
3
21
21
3
10
11
3
5
8
3
6
9
3
7
10
4
34
32
4
37
38
4
21
22
4
8
12
4
15
16
4
12
13
5
32
32
5
36
39
5
18
23
5
26
31
5
33
38
5
34
37
4
33
33
4
34
38
4
34
35
4
30
34
4
31
35
4
30
34
4
31
35
5
30
33
5
35
39
5
17
22
5
26
30
5
23
28
5
24
2...

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000
? 11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000...

result:

ok Correct answer with 840 queries.

Test #14:

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

input:

100
1
29
30
1
19
18
1
26
25
1
29
28
1
28
29
1
27
28
1
28
27
0
30
30
0
18
18
0
12
12
0
6
6
0
3
3
0
1
1
0
0
0

output:

? 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000
? 11111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000...

result:

ok Correct answer with 42 queries.

Test #15:

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

input:

150
4
58
58
4
57
58
4
39
41
4
22
26
4
29
32
4
26
30
4
26
29
5
59
58
5
57
57
5
44
46
5
22
25
5
9
14
5
14
19
5
18
21
7
58
58
7
56
58
7
42
47
7
21
27
7
9
16
7
14
21
7
16
23
7
18
25
10
58
58
10
56
58
10
42
48
10
20
29
10
9
18
10
5
15
10
7
17
11
59
58
11
55
57
11
45
51
11
21
32
11
31
42
11
39
46
11
34
41...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2526 queries.

Test #16:

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

input:

150
4
52
52
4
51
52
4
31
34
4
20
23
4
7
11
4
9
13
4
17
20
11
49
52
11
51
56
11
28
38
11
13
24
11
17
28
11
23
33
11
20
31
13
50
53
13
51
57
13
28
41
13
39
48
13
37
48
13
30
42
13
29
41
13
50
53
13
50
57
13
28
41
13
39
48
13
38
48
13
33
46
13
36
48
17
51
53
17
50
57
17
28
43
17
13
30
17
17
34
17
22
39...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2523 queries.

Test #17:

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

input:

150
3
62
61
3
54
56
3
33
36
3
46
48
3
40
42
3
37
39
3
36
38
5
63
61
5
56
58
5
33
38
5
47
49
5
42
45
5
37
41
5
35
39
8
62
60
8
57
59
8
33
39
8
18
25
8
10
17
8
5
12
8
1
9
11
63
60
11
56
59
11
33
41
11
15
26
11
27
35
11
20
31
11
22
33
15
62
60
15
54
59
15
32
42
15
15
28
15
8
21
15
2
17
15
6
20
18
62
60...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2553 queries.

Test #18:

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

input:

150
4
64
64
4
61
64
4
40
43
4
25
29
4
32
35
4
28
32
4
31
34
6
63
64
6
59
65
6
72
74
6
64
67
6
63
66
6
60
64
6
60
64
9
63
63
9
59
64
9
39
46
9
25
33
9
13
21
9
9
18
9
13
21
12
63
63
12
58
64
12
39
48
12
23
35
12
27
38
12
26
37
12
25
36
13
63
62
13
58
64
13
41
50
13
23
36
13
27
40
13
33
44
13
30
42
15
...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2544 queries.

Test #19:

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

input:

150
2
50
49
2
42
43
2
22
23
2
12
14
2
16
18
2
18
20
2
19
20
2
51
49
2
42
43
2
23
25
2
34
36
2
39
40
2
38
40
2
38
40
2
40
41
3
52
49
3
43
44
3
23
26
3
34
37
3
37
40
3
39
42
3
40
43
3
42
43
3
53
49
3
41
44
3
49
50
3
47
48
3
42
45
3
43
46
3
45
46
3
51
48
3
41
44
3
47
50
3
52
51
3
49
48
3
45
48
3
49
48
...

output:

? 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2505 queries.

Test #20:

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

input:

200
1
63
63
1
49
49
1
33
34
1
42
43
1
48
49
1
51
51
1
49
49
4
64
63
4
48
49
4
31
33
4
18
22
4
28
31
4
23
27
4
24
28
4
27
30
6
65
64
6
46
48
6
32
35
6
18
24
6
26
32
6
27
33
6
28
34
6
30
33
5
65
64
5
45
49
5
31
36
5
40
45
5
46
50
5
44
48
5
40
45
5
43
47
7
65
63
7
43
50
7
60
61
7
50
56
7
47
54
7
49
55
...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok Correct answer with 1164 queries.

Test #21:

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

input:

200
3
67
67
3
60
60
3
40
43
3
46
46
3
46
48
3
44
47
3
46
49
3
47
49
3
66
67
3
59
60
3
38
41
3
45
46
3
45
48
3
44
45
3
46
47
3
65
67
3
59
61
3
38
40
3
19
21
3
11
13
3
6
8
3
2
5
3
4
7
4
66
67
4
59
63
4
63
66
4
63
66
4
61
65
4
61
65
4
61
65
4
61
65
5
64
67
5
59
64
5
62
67
5
66
69
5
66
69
5
64
69
5
63
6...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok Correct answer with 2565 queries.

Test #22:

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

input:

200
1
71
72
1
45
44
1
62
61
1
68
69
1
67
66
1
66
67
1
67
66
0
71
71
0
44
44
0
21
21
0
10
10
0
6
6
0
3
3
0
1
1
0
0
0

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

ok Correct answer with 45 queries.

Test #23:

score: -100
Runtime Error

input:

200
1
68
67
1
64
63
1
38
37
1
20
21
1
27
26
1
25
24
1
21
22
1
23
22
2
66
67
2
62
63
2
36
37
2
20
21
2
9
11
2
13
14
2
11
12
3
66
67
3
61
63
3
37
40
3
50
53
3
56
59
3
58
61
3
61
63
3
60
62
4
66
67
4
59
63
4
68
69
4
66
67
4
63
67
4
66
67
4
64
68
4
64
68
3
63
66
3
44
41
3
54
55
3
60
63
3
57
58
3
58
61
3...

output:

? 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result: