Submission #357690

# Submission time Handle Problem Language Result Execution time Memory
357690 2021-01-24T12:50:02 Z mjhmjh1104 Colors (BOI20_colors) C++17
9 / 100
1 ms 384 KB
#include <cstdio>

int n, t;

int main() {
    scanf("%d", &n);
    int curr = n / 2 + 1;
    printf("? %d\n", curr);
    fflush(stdout);
    scanf("%*d");
    for (int i = 1; i < n; i++) {
        curr += (i % 2 ? -1 : 1) * i;
        printf("? %d\n", curr);
        fflush(stdout);
        scanf("%d", &t);
        if (t) {
            printf("= %d\n", i);
            fflush(stdout);
            return 0;
        }
    }
    printf("= %d\n", n);
    fflush(stdout);
}

Compilation message

Colors.cpp: In function 'int main()':
Colors.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Colors.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |     scanf("%*d");
      |     ~~~~~^~~~~~~
Colors.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |         scanf("%d", &t);
      |         ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (5 queries)
2 Correct 1 ms 256 KB OK (46 queries)
3 Correct 0 ms 256 KB OK (3 queries)
4 Correct 1 ms 256 KB OK (2 queries)
5 Correct 1 ms 256 KB OK (13 queries)
6 Correct 1 ms 256 KB OK (33 queries)
7 Correct 1 ms 256 KB OK (38 queries)
8 Correct 1 ms 256 KB OK (39 queries)
9 Correct 1 ms 256 KB OK (40 queries)
10 Correct 0 ms 256 KB OK (2 queries)
11 Correct 1 ms 256 KB OK (13 queries)
12 Correct 1 ms 256 KB OK (21 queries)
13 Correct 1 ms 384 KB OK (39 queries)
14 Correct 1 ms 256 KB OK (31 queries)
15 Correct 1 ms 256 KB OK (46 queries)
16 Correct 1 ms 256 KB OK (22 queries)
17 Correct 1 ms 256 KB OK (35 queries)
18 Correct 1 ms 256 KB OK (24 queries)
19 Correct 1 ms 256 KB OK (26 queries)
20 Correct 1 ms 256 KB OK (36 queries)
21 Correct 1 ms 256 KB OK (51 queries)
22 Correct 0 ms 256 KB OK (2 queries)
23 Correct 0 ms 256 KB OK (2 queries)
24 Correct 1 ms 256 KB OK (3 queries)
25 Correct 0 ms 256 KB OK (3 queries)
26 Correct 0 ms 256 KB OK (2 queries)
27 Correct 0 ms 256 KB OK (4 queries)
28 Correct 0 ms 256 KB OK (4 queries)
29 Correct 1 ms 256 KB OK (3 queries)
30 Correct 1 ms 256 KB OK (2 queries)
31 Correct 0 ms 256 KB OK (5 queries)
32 Correct 0 ms 256 KB OK (5 queries)
33 Correct 1 ms 256 KB OK (4 queries)
34 Correct 1 ms 256 KB OK (3 queries)
35 Correct 1 ms 256 KB OK (2 queries)
36 Correct 1 ms 256 KB OK (6 queries)
37 Correct 0 ms 256 KB OK (6 queries)
38 Correct 0 ms 256 KB OK (5 queries)
39 Correct 1 ms 256 KB OK (4 queries)
40 Correct 0 ms 256 KB OK (3 queries)
41 Correct 0 ms 256 KB OK (2 queries)
42 Correct 0 ms 256 KB OK (7 queries)
43 Correct 0 ms 256 KB OK (7 queries)
44 Correct 0 ms 256 KB OK (6 queries)
45 Correct 0 ms 256 KB OK (5 queries)
46 Correct 0 ms 256 KB OK (4 queries)
47 Correct 0 ms 256 KB OK (3 queries)
48 Correct 0 ms 256 KB OK (2 queries)
49 Correct 0 ms 256 KB OK (8 queries)
50 Correct 1 ms 256 KB OK (8 queries)
51 Correct 0 ms 256 KB OK (7 queries)
52 Correct 0 ms 256 KB OK (6 queries)
53 Correct 1 ms 256 KB OK (5 queries)
54 Correct 1 ms 256 KB OK (4 queries)
55 Correct 0 ms 256 KB OK (3 queries)
56 Correct 0 ms 256 KB OK (2 queries)
57 Correct 0 ms 256 KB OK (18 queries)
58 Correct 1 ms 256 KB OK (18 queries)
59 Correct 1 ms 256 KB OK (37 queries)
60 Correct 1 ms 256 KB OK (37 queries)
61 Correct 0 ms 256 KB OK (2 queries)
62 Correct 1 ms 256 KB OK (63 queries)
63 Correct 0 ms 256 KB OK (3 queries)
64 Correct 1 ms 256 KB OK (63 queries)
65 Correct 0 ms 256 KB OK (4 queries)
66 Correct 1 ms 256 KB OK (62 queries)
67 Correct 0 ms 256 KB OK (5 queries)
68 Correct 1 ms 256 KB OK (61 queries)
69 Correct 0 ms 256 KB OK (6 queries)
70 Correct 1 ms 256 KB OK (60 queries)
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (5 queries)
2 Correct 1 ms 256 KB OK (46 queries)
3 Correct 0 ms 256 KB OK (3 queries)
4 Correct 1 ms 256 KB OK (2 queries)
5 Correct 1 ms 256 KB OK (13 queries)
6 Correct 1 ms 256 KB OK (33 queries)
7 Correct 1 ms 256 KB OK (38 queries)
8 Correct 1 ms 256 KB OK (39 queries)
9 Correct 1 ms 256 KB OK (40 queries)
10 Correct 0 ms 256 KB OK (2 queries)
11 Correct 1 ms 256 KB OK (13 queries)
12 Correct 1 ms 256 KB OK (21 queries)
13 Correct 1 ms 384 KB OK (39 queries)
14 Correct 1 ms 256 KB OK (31 queries)
15 Correct 1 ms 256 KB OK (46 queries)
16 Correct 1 ms 256 KB OK (22 queries)
17 Correct 1 ms 256 KB OK (35 queries)
18 Correct 1 ms 256 KB OK (24 queries)
19 Correct 1 ms 256 KB OK (26 queries)
20 Correct 1 ms 256 KB OK (36 queries)
21 Correct 1 ms 256 KB OK (51 queries)
22 Correct 0 ms 256 KB OK (2 queries)
23 Correct 0 ms 256 KB OK (2 queries)
24 Correct 1 ms 256 KB OK (3 queries)
25 Correct 0 ms 256 KB OK (3 queries)
26 Correct 0 ms 256 KB OK (2 queries)
27 Correct 0 ms 256 KB OK (4 queries)
28 Correct 0 ms 256 KB OK (4 queries)
29 Correct 1 ms 256 KB OK (3 queries)
30 Correct 1 ms 256 KB OK (2 queries)
31 Correct 0 ms 256 KB OK (5 queries)
32 Correct 0 ms 256 KB OK (5 queries)
33 Correct 1 ms 256 KB OK (4 queries)
34 Correct 1 ms 256 KB OK (3 queries)
35 Correct 1 ms 256 KB OK (2 queries)
36 Correct 1 ms 256 KB OK (6 queries)
37 Correct 0 ms 256 KB OK (6 queries)
38 Correct 0 ms 256 KB OK (5 queries)
39 Correct 1 ms 256 KB OK (4 queries)
40 Correct 0 ms 256 KB OK (3 queries)
41 Correct 0 ms 256 KB OK (2 queries)
42 Correct 0 ms 256 KB OK (7 queries)
43 Correct 0 ms 256 KB OK (7 queries)
44 Correct 0 ms 256 KB OK (6 queries)
45 Correct 0 ms 256 KB OK (5 queries)
46 Correct 0 ms 256 KB OK (4 queries)
47 Correct 0 ms 256 KB OK (3 queries)
48 Correct 0 ms 256 KB OK (2 queries)
49 Correct 0 ms 256 KB OK (8 queries)
50 Correct 1 ms 256 KB OK (8 queries)
51 Correct 0 ms 256 KB OK (7 queries)
52 Correct 0 ms 256 KB OK (6 queries)
53 Correct 1 ms 256 KB OK (5 queries)
54 Correct 1 ms 256 KB OK (4 queries)
55 Correct 0 ms 256 KB OK (3 queries)
56 Correct 0 ms 256 KB OK (2 queries)
57 Correct 0 ms 256 KB OK (18 queries)
58 Correct 1 ms 256 KB OK (18 queries)
59 Correct 1 ms 256 KB OK (37 queries)
60 Correct 1 ms 256 KB OK (37 queries)
61 Correct 0 ms 256 KB OK (2 queries)
62 Correct 1 ms 256 KB OK (63 queries)
63 Correct 0 ms 256 KB OK (3 queries)
64 Correct 1 ms 256 KB OK (63 queries)
65 Correct 0 ms 256 KB OK (4 queries)
66 Correct 1 ms 256 KB OK (62 queries)
67 Correct 0 ms 256 KB OK (5 queries)
68 Correct 1 ms 256 KB OK (61 queries)
69 Correct 0 ms 256 KB OK (6 queries)
70 Correct 1 ms 256 KB OK (60 queries)
71 Correct 0 ms 256 KB OK (2 queries)
72 Incorrect 1 ms 384 KB Query limit exceeded
73 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (5 queries)
2 Correct 1 ms 256 KB OK (46 queries)
3 Correct 0 ms 256 KB OK (3 queries)
4 Correct 1 ms 256 KB OK (2 queries)
5 Correct 1 ms 256 KB OK (13 queries)
6 Correct 1 ms 256 KB OK (33 queries)
7 Correct 1 ms 256 KB OK (38 queries)
8 Correct 1 ms 256 KB OK (39 queries)
9 Correct 1 ms 256 KB OK (40 queries)
10 Correct 0 ms 256 KB OK (2 queries)
11 Correct 1 ms 256 KB OK (13 queries)
12 Correct 1 ms 256 KB OK (21 queries)
13 Correct 1 ms 384 KB OK (39 queries)
14 Correct 1 ms 256 KB OK (31 queries)
15 Correct 1 ms 256 KB OK (46 queries)
16 Correct 1 ms 256 KB OK (22 queries)
17 Correct 1 ms 256 KB OK (35 queries)
18 Correct 1 ms 256 KB OK (24 queries)
19 Correct 1 ms 256 KB OK (26 queries)
20 Correct 1 ms 256 KB OK (36 queries)
21 Correct 1 ms 256 KB OK (51 queries)
22 Correct 0 ms 256 KB OK (2 queries)
23 Correct 0 ms 256 KB OK (2 queries)
24 Correct 1 ms 256 KB OK (3 queries)
25 Correct 0 ms 256 KB OK (3 queries)
26 Correct 0 ms 256 KB OK (2 queries)
27 Correct 0 ms 256 KB OK (4 queries)
28 Correct 0 ms 256 KB OK (4 queries)
29 Correct 1 ms 256 KB OK (3 queries)
30 Correct 1 ms 256 KB OK (2 queries)
31 Correct 0 ms 256 KB OK (5 queries)
32 Correct 0 ms 256 KB OK (5 queries)
33 Correct 1 ms 256 KB OK (4 queries)
34 Correct 1 ms 256 KB OK (3 queries)
35 Correct 1 ms 256 KB OK (2 queries)
36 Correct 1 ms 256 KB OK (6 queries)
37 Correct 0 ms 256 KB OK (6 queries)
38 Correct 0 ms 256 KB OK (5 queries)
39 Correct 1 ms 256 KB OK (4 queries)
40 Correct 0 ms 256 KB OK (3 queries)
41 Correct 0 ms 256 KB OK (2 queries)
42 Correct 0 ms 256 KB OK (7 queries)
43 Correct 0 ms 256 KB OK (7 queries)
44 Correct 0 ms 256 KB OK (6 queries)
45 Correct 0 ms 256 KB OK (5 queries)
46 Correct 0 ms 256 KB OK (4 queries)
47 Correct 0 ms 256 KB OK (3 queries)
48 Correct 0 ms 256 KB OK (2 queries)
49 Correct 0 ms 256 KB OK (8 queries)
50 Correct 1 ms 256 KB OK (8 queries)
51 Correct 0 ms 256 KB OK (7 queries)
52 Correct 0 ms 256 KB OK (6 queries)
53 Correct 1 ms 256 KB OK (5 queries)
54 Correct 1 ms 256 KB OK (4 queries)
55 Correct 0 ms 256 KB OK (3 queries)
56 Correct 0 ms 256 KB OK (2 queries)
57 Correct 0 ms 256 KB OK (18 queries)
58 Correct 1 ms 256 KB OK (18 queries)
59 Correct 1 ms 256 KB OK (37 queries)
60 Correct 1 ms 256 KB OK (37 queries)
61 Correct 0 ms 256 KB OK (2 queries)
62 Correct 1 ms 256 KB OK (63 queries)
63 Correct 0 ms 256 KB OK (3 queries)
64 Correct 1 ms 256 KB OK (63 queries)
65 Correct 0 ms 256 KB OK (4 queries)
66 Correct 1 ms 256 KB OK (62 queries)
67 Correct 0 ms 256 KB OK (5 queries)
68 Correct 1 ms 256 KB OK (61 queries)
69 Correct 0 ms 256 KB OK (6 queries)
70 Correct 1 ms 256 KB OK (60 queries)
71 Correct 0 ms 256 KB OK (2 queries)
72 Incorrect 1 ms 384 KB Query limit exceeded
73 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (5 queries)
2 Correct 1 ms 256 KB OK (46 queries)
3 Correct 0 ms 256 KB OK (3 queries)
4 Correct 1 ms 256 KB OK (2 queries)
5 Correct 1 ms 256 KB OK (13 queries)
6 Correct 1 ms 256 KB OK (33 queries)
7 Correct 1 ms 256 KB OK (38 queries)
8 Correct 1 ms 256 KB OK (39 queries)
9 Correct 1 ms 256 KB OK (40 queries)
10 Correct 0 ms 256 KB OK (2 queries)
11 Correct 1 ms 256 KB OK (13 queries)
12 Correct 1 ms 256 KB OK (21 queries)
13 Correct 1 ms 384 KB OK (39 queries)
14 Correct 1 ms 256 KB OK (31 queries)
15 Correct 1 ms 256 KB OK (46 queries)
16 Correct 1 ms 256 KB OK (22 queries)
17 Correct 1 ms 256 KB OK (35 queries)
18 Correct 1 ms 256 KB OK (24 queries)
19 Correct 1 ms 256 KB OK (26 queries)
20 Correct 1 ms 256 KB OK (36 queries)
21 Correct 1 ms 256 KB OK (51 queries)
22 Correct 0 ms 256 KB OK (2 queries)
23 Correct 0 ms 256 KB OK (2 queries)
24 Correct 1 ms 256 KB OK (3 queries)
25 Correct 0 ms 256 KB OK (3 queries)
26 Correct 0 ms 256 KB OK (2 queries)
27 Correct 0 ms 256 KB OK (4 queries)
28 Correct 0 ms 256 KB OK (4 queries)
29 Correct 1 ms 256 KB OK (3 queries)
30 Correct 1 ms 256 KB OK (2 queries)
31 Correct 0 ms 256 KB OK (5 queries)
32 Correct 0 ms 256 KB OK (5 queries)
33 Correct 1 ms 256 KB OK (4 queries)
34 Correct 1 ms 256 KB OK (3 queries)
35 Correct 1 ms 256 KB OK (2 queries)
36 Correct 1 ms 256 KB OK (6 queries)
37 Correct 0 ms 256 KB OK (6 queries)
38 Correct 0 ms 256 KB OK (5 queries)
39 Correct 1 ms 256 KB OK (4 queries)
40 Correct 0 ms 256 KB OK (3 queries)
41 Correct 0 ms 256 KB OK (2 queries)
42 Correct 0 ms 256 KB OK (7 queries)
43 Correct 0 ms 256 KB OK (7 queries)
44 Correct 0 ms 256 KB OK (6 queries)
45 Correct 0 ms 256 KB OK (5 queries)
46 Correct 0 ms 256 KB OK (4 queries)
47 Correct 0 ms 256 KB OK (3 queries)
48 Correct 0 ms 256 KB OK (2 queries)
49 Correct 0 ms 256 KB OK (8 queries)
50 Correct 1 ms 256 KB OK (8 queries)
51 Correct 0 ms 256 KB OK (7 queries)
52 Correct 0 ms 256 KB OK (6 queries)
53 Correct 1 ms 256 KB OK (5 queries)
54 Correct 1 ms 256 KB OK (4 queries)
55 Correct 0 ms 256 KB OK (3 queries)
56 Correct 0 ms 256 KB OK (2 queries)
57 Correct 0 ms 256 KB OK (18 queries)
58 Correct 1 ms 256 KB OK (18 queries)
59 Correct 1 ms 256 KB OK (37 queries)
60 Correct 1 ms 256 KB OK (37 queries)
61 Correct 0 ms 256 KB OK (2 queries)
62 Correct 1 ms 256 KB OK (63 queries)
63 Correct 0 ms 256 KB OK (3 queries)
64 Correct 1 ms 256 KB OK (63 queries)
65 Correct 0 ms 256 KB OK (4 queries)
66 Correct 1 ms 256 KB OK (62 queries)
67 Correct 0 ms 256 KB OK (5 queries)
68 Correct 1 ms 256 KB OK (61 queries)
69 Correct 0 ms 256 KB OK (6 queries)
70 Correct 1 ms 256 KB OK (60 queries)
71 Correct 0 ms 256 KB OK (2 queries)
72 Incorrect 1 ms 384 KB Query limit exceeded
73 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (5 queries)
2 Correct 1 ms 256 KB OK (46 queries)
3 Correct 0 ms 256 KB OK (3 queries)
4 Correct 1 ms 256 KB OK (2 queries)
5 Correct 1 ms 256 KB OK (13 queries)
6 Correct 1 ms 256 KB OK (33 queries)
7 Correct 1 ms 256 KB OK (38 queries)
8 Correct 1 ms 256 KB OK (39 queries)
9 Correct 1 ms 256 KB OK (40 queries)
10 Correct 0 ms 256 KB OK (2 queries)
11 Correct 1 ms 256 KB OK (13 queries)
12 Correct 1 ms 256 KB OK (21 queries)
13 Correct 1 ms 384 KB OK (39 queries)
14 Correct 1 ms 256 KB OK (31 queries)
15 Correct 1 ms 256 KB OK (46 queries)
16 Correct 1 ms 256 KB OK (22 queries)
17 Correct 1 ms 256 KB OK (35 queries)
18 Correct 1 ms 256 KB OK (24 queries)
19 Correct 1 ms 256 KB OK (26 queries)
20 Correct 1 ms 256 KB OK (36 queries)
21 Correct 1 ms 256 KB OK (51 queries)
22 Correct 0 ms 256 KB OK (2 queries)
23 Correct 0 ms 256 KB OK (2 queries)
24 Correct 1 ms 256 KB OK (3 queries)
25 Correct 0 ms 256 KB OK (3 queries)
26 Correct 0 ms 256 KB OK (2 queries)
27 Correct 0 ms 256 KB OK (4 queries)
28 Correct 0 ms 256 KB OK (4 queries)
29 Correct 1 ms 256 KB OK (3 queries)
30 Correct 1 ms 256 KB OK (2 queries)
31 Correct 0 ms 256 KB OK (5 queries)
32 Correct 0 ms 256 KB OK (5 queries)
33 Correct 1 ms 256 KB OK (4 queries)
34 Correct 1 ms 256 KB OK (3 queries)
35 Correct 1 ms 256 KB OK (2 queries)
36 Correct 1 ms 256 KB OK (6 queries)
37 Correct 0 ms 256 KB OK (6 queries)
38 Correct 0 ms 256 KB OK (5 queries)
39 Correct 1 ms 256 KB OK (4 queries)
40 Correct 0 ms 256 KB OK (3 queries)
41 Correct 0 ms 256 KB OK (2 queries)
42 Correct 0 ms 256 KB OK (7 queries)
43 Correct 0 ms 256 KB OK (7 queries)
44 Correct 0 ms 256 KB OK (6 queries)
45 Correct 0 ms 256 KB OK (5 queries)
46 Correct 0 ms 256 KB OK (4 queries)
47 Correct 0 ms 256 KB OK (3 queries)
48 Correct 0 ms 256 KB OK (2 queries)
49 Correct 0 ms 256 KB OK (8 queries)
50 Correct 1 ms 256 KB OK (8 queries)
51 Correct 0 ms 256 KB OK (7 queries)
52 Correct 0 ms 256 KB OK (6 queries)
53 Correct 1 ms 256 KB OK (5 queries)
54 Correct 1 ms 256 KB OK (4 queries)
55 Correct 0 ms 256 KB OK (3 queries)
56 Correct 0 ms 256 KB OK (2 queries)
57 Correct 0 ms 256 KB OK (18 queries)
58 Correct 1 ms 256 KB OK (18 queries)
59 Correct 1 ms 256 KB OK (37 queries)
60 Correct 1 ms 256 KB OK (37 queries)
61 Correct 0 ms 256 KB OK (2 queries)
62 Correct 1 ms 256 KB OK (63 queries)
63 Correct 0 ms 256 KB OK (3 queries)
64 Correct 1 ms 256 KB OK (63 queries)
65 Correct 0 ms 256 KB OK (4 queries)
66 Correct 1 ms 256 KB OK (62 queries)
67 Correct 0 ms 256 KB OK (5 queries)
68 Correct 1 ms 256 KB OK (61 queries)
69 Correct 0 ms 256 KB OK (6 queries)
70 Correct 1 ms 256 KB OK (60 queries)
71 Correct 0 ms 256 KB OK (2 queries)
72 Incorrect 1 ms 384 KB Query limit exceeded
73 Halted 0 ms 0 KB -