Submission #980393

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9803932024-05-12 07:01:02janson0109Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <combo.h>
using namespace std;
string guess_sequence(int N) {
string p = "";
string pos;
if(press("AB") >= 1) {
if(press("A") == 1) {
p += "A";
pos = "BXY";
} else {
p += "B";
pos = "AXY";
}
} else {
if(press("X") == 1) {
p += "X";
pos = "ABY";
} else {
p += "Y";
pos = "ABX";
}
}
for(int i=1; i<N-1; i++) {
string guess = p + pos[0] + pos[0] + p + pos[0] + pos[1] + p + pos[0] + pos[2] + p + pos[1];
switch(press(guess)) {
case i:
p += pos[2];
break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:18: error: the value of 'i' is not usable in a constant expression
   28 |             case i:
      |                  ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^
combo.cpp:28:18: error: the value of 'i' is not usable in a constant expression
   28 |             case i:
      |                  ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^
combo.cpp:31:20: error: the value of 'i' is not usable in a constant expression
   31 |             case i+1:
      |                    ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^
combo.cpp:31:18: error: the value of 'i' is not usable in a constant expression
   31 |             case i+1:
      |                  ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^
combo.cpp:34:20: error: the value of 'i' is not usable in a constant expression
   34 |             case i+2:
      |                    ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^
combo.cpp:34:18: error: the value of 'i' is not usable in a constant expression
   34 |             case i+2:
      |                  ^
combo.cpp:25:13: note: 'int i' is not const
   25 |     for(int i=1; i<N-1; i++) {
      |             ^