Submission #285423

# Submission time Handle Problem Language Result Execution time Memory
285423 2020-08-28T22:51:55 Z Pichon5 Combo (IOI18_combo) C++17
97 / 100
40 ms 652 KB
#include "combo.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
string guess_sequence(int N){
    vector<char>v;
    char arr[4]={'A','B','X','Y'};
    int c=0;
    string s="",ss;
    if(press("X")==1){
        s+='X';
    }else{
        if(press("Y")==1){
            s+='Y';
        }else{
            if(press("A")==1){
                s+='A';
            }else{
                s+='B';
            }
        }
    }
    for(int i=0;i<4;i++){
        if(arr[i]!=s[0]){
           v.pb(arr[i]);
        }
    }
    for(int i=2;i<=N;i++){
        ss=s;
        if(i==N){
            ss+=v[0];
            if(press(ss)==i){
                s=ss;
                break;
            }
            ss=s+v[1];
            if(press(ss)==i){
                s=ss;
                break;
            }
            s+=v[2];
            break;
        }
        ss=ss+v[0]+ss+v[1]+v[0]+ss+v[1]+v[1]+ss+v[1]+v[2];
        int x=press(ss);
        if(x==i){
            s+=v[0];
            continue;
        }
        if(x==i+1){
            s+=v[1];
            continue;
        }
        s+=v[2];
    }
    return s;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:9: warning: unused variable 'c' [-Wunused-variable]
    8 |     int c=0;
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 1 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 1 ms 200 KB Output is correct
13 Correct 0 ms 200 KB Output is correct
14 Correct 0 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 1 ms 200 KB Output is correct
17 Correct 1 ms 200 KB Output is correct
18 Correct 1 ms 200 KB Output is correct
19 Correct 1 ms 200 KB Output is correct
20 Correct 1 ms 200 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 240 KB Output is correct
25 Correct 0 ms 200 KB Output is correct
26 Correct 1 ms 200 KB Output is correct
27 Correct 1 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 1 ms 200 KB Output is correct
31 Correct 0 ms 200 KB Output is correct
32 Correct 1 ms 200 KB Output is correct
33 Correct 1 ms 200 KB Output is correct
34 Correct 1 ms 200 KB Output is correct
35 Correct 1 ms 200 KB Output is correct
36 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 0 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Partially correct 0 ms 200 KB Output is partially correct
7 Partially correct 1 ms 200 KB Output is partially correct
8 Correct 1 ms 200 KB Output is correct
9 Partially correct 0 ms 200 KB Output is partially correct
10 Partially correct 1 ms 200 KB Output is partially correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 0 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 1 ms 200 KB Output is correct
17 Correct 26 ms 572 KB Output is correct
18 Correct 28 ms 620 KB Output is correct
19 Partially correct 21 ms 448 KB Output is partially correct
20 Correct 30 ms 524 KB Output is correct
21 Correct 36 ms 512 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 292 KB Output is correct
24 Partially correct 1 ms 200 KB Output is partially correct
25 Partially correct 2 ms 200 KB Output is partially correct
26 Correct 1 ms 308 KB Output is correct
27 Correct 2 ms 328 KB Output is correct
28 Partially correct 2 ms 328 KB Output is partially correct
29 Correct 2 ms 328 KB Output is correct
30 Partially correct 3 ms 456 KB Output is partially correct
31 Correct 3 ms 328 KB Output is correct
32 Correct 38 ms 512 KB Output is correct
33 Partially correct 20 ms 564 KB Output is partially correct
34 Correct 32 ms 652 KB Output is correct
35 Correct 39 ms 400 KB Output is correct
36 Correct 35 ms 488 KB Output is correct
37 Correct 35 ms 612 KB Output is correct
38 Correct 31 ms 448 KB Output is correct
39 Correct 38 ms 444 KB Output is correct
40 Correct 39 ms 400 KB Output is correct
41 Correct 36 ms 472 KB Output is correct
42 Partially correct 25 ms 404 KB Output is partially correct
43 Correct 25 ms 404 KB Output is correct
44 Correct 40 ms 404 KB Output is correct
45 Correct 25 ms 524 KB Output is correct
46 Partially correct 36 ms 400 KB Output is partially correct
47 Partially correct 37 ms 408 KB Output is partially correct
48 Correct 32 ms 404 KB Output is correct
49 Correct 33 ms 524 KB Output is correct
50 Partially correct 36 ms 412 KB Output is partially correct
51 Correct 38 ms 444 KB Output is correct
52 Correct 39 ms 528 KB Output is correct
53 Correct 31 ms 544 KB Output is correct
54 Correct 38 ms 612 KB Output is correct
55 Correct 27 ms 436 KB Output is correct
56 Correct 34 ms 496 KB Output is correct
57 Correct 35 ms 524 KB Output is correct
58 Partially correct 29 ms 508 KB Output is partially correct
59 Partially correct 31 ms 480 KB Output is partially correct
60 Correct 37 ms 528 KB Output is correct
61 Correct 31 ms 480 KB Output is correct
62 Partially correct 22 ms 604 KB Output is partially correct
63 Partially correct 35 ms 528 KB Output is partially correct
64 Correct 27 ms 404 KB Output is correct
65 Correct 32 ms 504 KB Output is correct
66 Partially correct 32 ms 484 KB Output is partially correct
67 Partially correct 34 ms 440 KB Output is partially correct
68 Correct 37 ms 476 KB Output is correct
69 Correct 35 ms 464 KB Output is correct
70 Partially correct 35 ms 580 KB Output is partially correct
71 Partially correct 33 ms 556 KB Output is partially correct
72 Correct 29 ms 404 KB Output is correct
73 Correct 33 ms 404 KB Output is correct
74 Partially correct 37 ms 404 KB Output is partially correct
75 Correct 29 ms 428 KB Output is correct
76 Correct 40 ms 456 KB Output is correct
77 Correct 31 ms 652 KB Output is correct
78 Correct 1 ms 200 KB Output is correct
79 Correct 1 ms 200 KB Output is correct
80 Partially correct 1 ms 200 KB Output is partially correct
81 Correct 1 ms 200 KB Output is correct
82 Correct 1 ms 200 KB Output is correct
83 Partially correct 1 ms 200 KB Output is partially correct
84 Correct 1 ms 200 KB Output is correct
85 Correct 1 ms 200 KB Output is correct
86 Partially correct 1 ms 200 KB Output is partially correct
87 Correct 1 ms 200 KB Output is correct
88 Correct 1 ms 200 KB Output is correct
89 Correct 1 ms 200 KB Output is correct
90 Correct 1 ms 200 KB Output is correct
91 Correct 1 ms 200 KB Output is correct
92 Partially correct 1 ms 200 KB Output is partially correct
93 Partially correct 1 ms 200 KB Output is partially correct
94 Correct 1 ms 200 KB Output is correct
95 Correct 1 ms 288 KB Output is correct
96 Partially correct 1 ms 200 KB Output is partially correct
97 Partially correct 1 ms 200 KB Output is partially correct
98 Correct 1 ms 200 KB Output is correct
99 Correct 1 ms 200 KB Output is correct
100 Correct 1 ms 200 KB Output is correct
101 Correct 1 ms 200 KB Output is correct
102 Correct 1 ms 200 KB Output is correct
103 Correct 1 ms 200 KB Output is correct
104 Partially correct 1 ms 200 KB Output is partially correct
105 Partially correct 1 ms 200 KB Output is partially correct
106 Correct 1 ms 200 KB Output is correct
107 Correct 1 ms 200 KB Output is correct
108 Partially correct 1 ms 200 KB Output is partially correct
109 Partially correct 1 ms 200 KB Output is partially correct
110 Correct 1 ms 200 KB Output is correct
111 Correct 1 ms 200 KB Output is correct
112 Partially correct 1 ms 200 KB Output is partially correct
113 Partially correct 1 ms 200 KB Output is partially correct
114 Correct 1 ms 200 KB Output is correct
115 Correct 1 ms 200 KB Output is correct
116 Correct 1 ms 200 KB Output is correct
117 Partially correct 1 ms 200 KB Output is partially correct
118 Correct 1 ms 200 KB Output is correct
119 Correct 1 ms 200 KB Output is correct
120 Partially correct 1 ms 200 KB Output is partially correct
121 Partially correct 1 ms 200 KB Output is partially correct
122 Correct 1 ms 200 KB Output is correct
123 Correct 2 ms 200 KB Output is correct