Submission #1009402

# Submission time Handle Problem Language Result Execution time Memory
1009402 2024-06-27T13:21:11 Z Increedible Combo (IOI18_combo) C++14
10 / 100
35 ms 1936 KB
#include "combo.h"
#include <string>
using namespace std;

string getGuess(int N, string s, char c) {
    string cur = "";
    int am = 1;
    while (cur.size() + s.size() + am <= N * 4) {
        cur += s + string(am, c);
        am++;
    }
    return cur;
}

string guess_sequence(int N) {
    string s = "";
    int oldcoins = 0;
    while (s.size() < N) {
        if (s.size() == 0) {
            if (press(s + "A") > oldcoins) {
                oldcoins++;
                s += "A";
            } else if (press(s + "B") > oldcoins) {
                oldcoins++;
                s += "B";
            } else if (press(s + "X") > oldcoins) {
                oldcoins++;
                s += "X";
            } else if (press(s + "Y") > oldcoins) {
                oldcoins++;
                s += "Y";
            }
        } else {
            s += string(press(getGuess(N, s, 'A')) - s.size(), 'A');
            if (s.size() >= N) break;
            s += string(press(getGuess(N, s, 'B')) - s.size(), 'B');
            if (s.size() >= N) break;
            s += string(press(getGuess(N, s, 'X')) - s.size(), 'X');
            if (s.size() >= N) break;
            s += string(press(getGuess(N, s, 'Y')) - s.size(), 'Y');
            if (s.size() >= N) break;
        }
    }
    return s;
}

Compilation message

combo.cpp: In function 'std::string getGuess(int, std::string, char)':
combo.cpp:8:39: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    8 |     while (cur.size() + s.size() + am <= N * 4) {
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |     while (s.size() < N) {
      |            ~~~~~~~~~^~~
combo.cpp:35:26: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   35 |             if (s.size() >= N) break;
      |                 ~~~~~~~~~^~~~
combo.cpp:37:26: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |             if (s.size() >= N) break;
      |                 ~~~~~~~~~^~~~
combo.cpp:39:26: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   39 |             if (s.size() >= N) break;
      |                 ~~~~~~~~~^~~~
combo.cpp:41:26: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   41 |             if (s.size() >= N) break;
      |                 ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 344 KB Output is correct
20 Correct 0 ms 344 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 1 ms 344 KB Output is correct
27 Correct 0 ms 340 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 0 ms 344 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 0 ms 372 KB Output is correct
36 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Partially correct 0 ms 344 KB Output is partially correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Partially correct 0 ms 344 KB Output is partially correct
8 Correct 0 ms 344 KB Output is correct
9 Partially correct 0 ms 344 KB Output is partially correct
10 Partially correct 0 ms 344 KB Output is partially correct
11 Correct 0 ms 344 KB Output is correct
12 Partially correct 0 ms 344 KB Output is partially correct
13 Partially correct 0 ms 344 KB Output is partially correct
14 Partially correct 0 ms 344 KB Output is partially correct
15 Partially correct 0 ms 344 KB Output is partially correct
16 Partially correct 0 ms 344 KB Output is partially correct
17 Partially correct 28 ms 1288 KB Output is partially correct
18 Partially correct 29 ms 1292 KB Output is partially correct
19 Partially correct 31 ms 1436 KB Output is partially correct
20 Partially correct 27 ms 776 KB Output is partially correct
21 Partially correct 26 ms 640 KB Output is partially correct
22 Partially correct 1 ms 344 KB Output is partially correct
23 Partially correct 1 ms 344 KB Output is partially correct
24 Partially correct 1 ms 344 KB Output is partially correct
25 Partially correct 1 ms 344 KB Output is partially correct
26 Partially correct 1 ms 344 KB Output is partially correct
27 Partially correct 1 ms 344 KB Output is partially correct
28 Partially correct 1 ms 344 KB Output is partially correct
29 Partially correct 2 ms 456 KB Output is partially correct
30 Partially correct 2 ms 344 KB Output is partially correct
31 Partially correct 2 ms 464 KB Output is partially correct
32 Partially correct 29 ms 1764 KB Output is partially correct
33 Partially correct 33 ms 600 KB Output is partially correct
34 Partially correct 31 ms 672 KB Output is partially correct
35 Partially correct 34 ms 1016 KB Output is partially correct
36 Partially correct 34 ms 1236 KB Output is partially correct
37 Partially correct 29 ms 1532 KB Output is partially correct
38 Partially correct 35 ms 1064 KB Output is partially correct
39 Partially correct 29 ms 788 KB Output is partially correct
40 Partially correct 30 ms 1204 KB Output is partially correct
41 Partially correct 30 ms 1352 KB Output is partially correct
42 Correct 20 ms 1408 KB Output is correct
43 Correct 19 ms 640 KB Output is correct
44 Correct 26 ms 940 KB Output is correct
45 Correct 18 ms 1544 KB Output is correct
46 Correct 18 ms 796 KB Output is correct
47 Correct 18 ms 1504 KB Output is correct
48 Correct 22 ms 752 KB Output is correct
49 Correct 22 ms 1436 KB Output is correct
50 Correct 22 ms 1496 KB Output is correct
51 Correct 20 ms 700 KB Output is correct
52 Correct 20 ms 1708 KB Output is correct
53 Correct 22 ms 780 KB Output is correct
54 Correct 12 ms 1248 KB Output is correct
55 Correct 14 ms 952 KB Output is correct
56 Correct 14 ms 1680 KB Output is correct
57 Correct 14 ms 696 KB Output is correct
58 Correct 11 ms 696 KB Output is correct
59 Correct 12 ms 532 KB Output is correct
60 Correct 13 ms 660 KB Output is correct
61 Correct 14 ms 1092 KB Output is correct
62 Correct 13 ms 768 KB Output is correct
63 Correct 13 ms 768 KB Output is correct
64 Correct 13 ms 1168 KB Output is correct
65 Correct 11 ms 776 KB Output is correct
66 Partially correct 27 ms 1460 KB Output is partially correct
67 Partially correct 24 ms 1704 KB Output is partially correct
68 Partially correct 30 ms 572 KB Output is partially correct
69 Partially correct 25 ms 724 KB Output is partially correct
70 Partially correct 23 ms 1936 KB Output is partially correct
71 Partially correct 25 ms 1608 KB Output is partially correct
72 Partially correct 28 ms 648 KB Output is partially correct
73 Partially correct 32 ms 724 KB Output is partially correct
74 Partially correct 23 ms 1140 KB Output is partially correct
75 Partially correct 29 ms 1348 KB Output is partially correct
76 Partially correct 26 ms 668 KB Output is partially correct
77 Partially correct 32 ms 624 KB Output is partially correct
78 Correct 0 ms 344 KB Output is correct
79 Partially correct 0 ms 344 KB Output is partially correct
80 Partially correct 0 ms 344 KB Output is partially correct
81 Partially correct 0 ms 344 KB Output is partially correct
82 Partially correct 0 ms 344 KB Output is partially correct
83 Partially correct 0 ms 344 KB Output is partially correct
84 Partially correct 1 ms 344 KB Output is partially correct
85 Partially correct 1 ms 344 KB Output is partially correct
86 Partially correct 1 ms 344 KB Output is partially correct
87 Partially correct 1 ms 344 KB Output is partially correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 1 ms 344 KB Output is correct
90 Partially correct 0 ms 344 KB Output is partially correct
91 Correct 1 ms 344 KB Output is correct
92 Partially correct 1 ms 344 KB Output is partially correct
93 Correct 0 ms 344 KB Output is correct
94 Partially correct 0 ms 344 KB Output is partially correct
95 Partially correct 1 ms 600 KB Output is partially correct
96 Correct 0 ms 344 KB Output is correct
97 Partially correct 1 ms 344 KB Output is partially correct
98 Correct 1 ms 600 KB Output is correct
99 Correct 0 ms 420 KB Output is correct
100 Correct 1 ms 344 KB Output is correct
101 Correct 0 ms 344 KB Output is correct
102 Correct 0 ms 344 KB Output is correct
103 Correct 0 ms 344 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 0 ms 344 KB Output is correct
106 Correct 0 ms 344 KB Output is correct
107 Correct 0 ms 344 KB Output is correct
108 Correct 0 ms 344 KB Output is correct
109 Correct 0 ms 344 KB Output is correct
110 Correct 0 ms 344 KB Output is correct
111 Correct 0 ms 344 KB Output is correct
112 Correct 0 ms 344 KB Output is correct
113 Partially correct 0 ms 344 KB Output is partially correct
114 Partially correct 0 ms 344 KB Output is partially correct
115 Partially correct 0 ms 344 KB Output is partially correct
116 Correct 0 ms 344 KB Output is correct
117 Partially correct 0 ms 344 KB Output is partially correct
118 Correct 0 ms 344 KB Output is correct
119 Partially correct 0 ms 344 KB Output is partially correct
120 Partially correct 1 ms 344 KB Output is partially correct
121 Partially correct 1 ms 344 KB Output is partially correct
122 Partially correct 1 ms 344 KB Output is partially correct
123 Partially correct 1 ms 344 KB Output is partially correct