Submission #676125

# Submission time Handle Problem Language Result Execution time Memory
676125 2022-12-29T11:35:14 Z coding_snorlax Combo (IOI18_combo) C++14
97 / 100
70 ms 572 KB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
#define pb push_back
char all_possible[4]={'A','B','X','Y'};
vector<char> guess_all;
string guess_sequence(int N){
    int mark=3;
    string answer;
    string guess;
    for(int i=0;i<3;i++){
        guess.pb(all_possible[i]);
        if(press(guess)){
            answer.pb(all_possible[i]);
            mark = i;
        }
        guess.pop_back();
    }
    if(mark==3) answer.pb('Y');
    for(int i=0;i<4;i++){
        if(i!=mark) guess_all.pb(all_possible[i]);
    }
    if(N==1) return answer;
    for(int i=0;i<N-2;i++){
        guess.clear();
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[0]);
        guess.pb(guess_all[0]);
        //if(press(guess)==i+3) {answer.pb(guess_all[0]);continue;}
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[0]);
        guess.pb(guess_all[1]);
        //if(press(guess)==i+3) {answer.pb(guess_all[0]);continue;}
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[0]);
        guess.pb(guess_all[2]);
        //if(press(guess)==i+3) {answer.pb(guess_all[0]);continue;}
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[1]);
        int check = press(guess);
        if(check==i+3) answer.pb(guess_all[0]);
        else if(check==i+2) answer.pb(guess_all[1]);
        else answer.pb(guess_all[2]);
    }
    for(int i=0;i<1;i++){
        guess.clear();
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[0]);
        if(press(guess)==N) {answer.pb(guess_all[0]);continue;}
        guess.clear();
        for(auto i : answer) guess.pb(i);
        guess.pb(guess_all[1]);
        if(press(guess)==N) {answer.pb(guess_all[1]);continue;}
        answer.pb(guess_all[2]);
    }
    return answer;
 
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 0 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Correct 0 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 208 KB Output is correct
14 Correct 0 ms 208 KB Output is correct
15 Correct 0 ms 208 KB Output is correct
16 Correct 0 ms 208 KB Output is correct
17 Correct 0 ms 208 KB Output is correct
18 Correct 1 ms 208 KB Output is correct
19 Correct 1 ms 208 KB Output is correct
20 Correct 0 ms 208 KB Output is correct
21 Correct 1 ms 208 KB Output is correct
22 Correct 0 ms 208 KB Output is correct
23 Correct 1 ms 208 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 0 ms 208 KB Output is correct
26 Correct 0 ms 208 KB Output is correct
27 Correct 0 ms 208 KB Output is correct
28 Correct 0 ms 208 KB Output is correct
29 Correct 0 ms 208 KB Output is correct
30 Correct 1 ms 208 KB Output is correct
31 Correct 0 ms 208 KB Output is correct
32 Correct 0 ms 208 KB Output is correct
33 Correct 1 ms 208 KB Output is correct
34 Correct 1 ms 208 KB Output is correct
35 Correct 1 ms 208 KB Output is correct
36 Correct 0 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Partially correct 1 ms 208 KB Output is partially correct
7 Partially correct 0 ms 208 KB Output is partially correct
8 Correct 0 ms 208 KB Output is correct
9 Partially correct 0 ms 208 KB Output is partially correct
10 Partially correct 0 ms 208 KB Output is partially correct
11 Correct 0 ms 208 KB Output is correct
12 Partially correct 1 ms 208 KB Output is partially correct
13 Partially correct 0 ms 208 KB Output is partially correct
14 Correct 1 ms 208 KB Output is correct
15 Partially correct 1 ms 208 KB Output is partially correct
16 Partially correct 1 ms 208 KB Output is partially correct
17 Correct 65 ms 408 KB Output is correct
18 Correct 62 ms 432 KB Output is correct
19 Partially correct 66 ms 456 KB Output is partially correct
20 Partially correct 68 ms 380 KB Output is partially correct
21 Partially correct 58 ms 364 KB Output is partially correct
22 Correct 0 ms 208 KB Output is correct
23 Partially correct 1 ms 208 KB Output is partially correct
24 Partially correct 1 ms 208 KB Output is partially correct
25 Partially correct 1 ms 208 KB Output is partially correct
26 Correct 1 ms 296 KB Output is correct
27 Correct 2 ms 208 KB Output is correct
28 Partially correct 2 ms 300 KB Output is partially correct
29 Partially correct 2 ms 208 KB Output is partially correct
30 Partially correct 2 ms 300 KB Output is partially correct
31 Partially correct 2 ms 208 KB Output is partially correct
32 Partially correct 54 ms 348 KB Output is partially correct
33 Partially correct 62 ms 444 KB Output is partially correct
34 Correct 62 ms 392 KB Output is correct
35 Partially correct 67 ms 348 KB Output is partially correct
36 Partially correct 63 ms 412 KB Output is partially correct
37 Correct 65 ms 416 KB Output is correct
38 Partially correct 59 ms 348 KB Output is partially correct
39 Correct 59 ms 404 KB Output is correct
40 Correct 62 ms 452 KB Output is correct
41 Partially correct 67 ms 356 KB Output is partially correct
42 Partially correct 68 ms 348 KB Output is partially correct
43 Correct 67 ms 344 KB Output is correct
44 Correct 68 ms 352 KB Output is correct
45 Correct 59 ms 400 KB Output is correct
46 Partially correct 63 ms 348 KB Output is partially correct
47 Partially correct 64 ms 460 KB Output is partially correct
48 Partially correct 68 ms 352 KB Output is partially correct
49 Partially correct 61 ms 352 KB Output is partially correct
50 Partially correct 63 ms 432 KB Output is partially correct
51 Correct 61 ms 352 KB Output is correct
52 Partially correct 65 ms 348 KB Output is partially correct
53 Partially correct 63 ms 400 KB Output is partially correct
54 Correct 62 ms 360 KB Output is correct
55 Correct 70 ms 452 KB Output is correct
56 Correct 64 ms 468 KB Output is correct
57 Correct 65 ms 508 KB Output is correct
58 Partially correct 53 ms 372 KB Output is partially correct
59 Partially correct 57 ms 432 KB Output is partially correct
60 Partially correct 63 ms 436 KB Output is partially correct
61 Partially correct 66 ms 348 KB Output is partially correct
62 Partially correct 65 ms 476 KB Output is partially correct
63 Partially correct 53 ms 432 KB Output is partially correct
64 Partially correct 65 ms 504 KB Output is partially correct
65 Partially correct 68 ms 472 KB Output is partially correct
66 Partially correct 64 ms 468 KB Output is partially correct
67 Partially correct 65 ms 344 KB Output is partially correct
68 Partially correct 68 ms 344 KB Output is partially correct
69 Correct 59 ms 344 KB Output is correct
70 Partially correct 63 ms 460 KB Output is partially correct
71 Partially correct 65 ms 452 KB Output is partially correct
72 Correct 66 ms 412 KB Output is correct
73 Partially correct 55 ms 468 KB Output is partially correct
74 Partially correct 68 ms 408 KB Output is partially correct
75 Correct 63 ms 344 KB Output is correct
76 Partially correct 64 ms 464 KB Output is partially correct
77 Correct 59 ms 572 KB Output is correct
78 Correct 0 ms 208 KB Output is correct
79 Partially correct 1 ms 208 KB Output is partially correct
80 Partially correct 1 ms 208 KB Output is partially correct
81 Partially correct 1 ms 208 KB Output is partially correct
82 Partially correct 1 ms 208 KB Output is partially correct
83 Partially correct 1 ms 208 KB Output is partially correct
84 Correct 1 ms 208 KB Output is correct
85 Partially correct 1 ms 208 KB Output is partially correct
86 Partially correct 2 ms 208 KB Output is partially correct
87 Partially correct 2 ms 208 KB Output is partially correct
88 Correct 1 ms 208 KB Output is correct
89 Correct 1 ms 208 KB Output is correct
90 Correct 1 ms 208 KB Output is correct
91 Correct 1 ms 208 KB Output is correct
92 Partially correct 1 ms 208 KB Output is partially correct
93 Partially correct 1 ms 208 KB Output is partially correct
94 Partially correct 1 ms 208 KB Output is partially correct
95 Partially correct 1 ms 208 KB Output is partially correct
96 Partially correct 1 ms 208 KB Output is partially correct
97 Partially correct 1 ms 208 KB Output is partially correct
98 Partially correct 1 ms 208 KB Output is partially correct
99 Partially correct 1 ms 208 KB Output is partially correct
100 Correct 1 ms 208 KB Output is correct
101 Correct 2 ms 208 KB Output is correct
102 Correct 1 ms 208 KB Output is correct
103 Correct 1 ms 208 KB Output is correct
104 Partially correct 1 ms 208 KB Output is partially correct
105 Partially correct 1 ms 208 KB Output is partially correct
106 Partially correct 1 ms 208 KB Output is partially correct
107 Partially correct 1 ms 208 KB Output is partially correct
108 Partially correct 1 ms 208 KB Output is partially correct
109 Partially correct 0 ms 208 KB Output is partially correct
110 Partially correct 1 ms 208 KB Output is partially correct
111 Partially correct 1 ms 208 KB Output is partially correct
112 Partially correct 1 ms 208 KB Output is partially correct
113 Partially correct 1 ms 208 KB Output is partially correct
114 Partially correct 1 ms 208 KB Output is partially correct
115 Partially correct 1 ms 208 KB Output is partially correct
116 Correct 1 ms 208 KB Output is correct
117 Partially correct 1 ms 208 KB Output is partially correct
118 Correct 1 ms 208 KB Output is correct
119 Partially correct 1 ms 208 KB Output is partially correct
120 Partially correct 1 ms 208 KB Output is partially correct
121 Partially correct 1 ms 208 KB Output is partially correct
122 Partially correct 1 ms 208 KB Output is partially correct
123 Partially correct 1 ms 208 KB Output is partially correct