Submission #862947

#TimeUsernameProblemLanguageResultExecution timeMemory
862947HataNoKokoroCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string result = ""; int coin; ///ask first char coin = press("AB"); if(coin == 0) { c_list[0] = 'A'; c_list[1] = 'B'; result += (press("X") ? 'X' : 'Y'); c_list[2] = (result[0] == 'X' ? 'Y' : 'X'); } else { result += (press("A") ? 'A' : 'B'); c_list[0] = (result[0] == 'A' ? 'B' : 'A'); c_list[1] = 'X'; c_list[2] = 'Y'; } ///ask 2 -> n-1 char for(int i = 2; i < N; i++) { coin = press(result + c_list[0] + c_list[0] + result + c_list[0] + c_list[1] +result + c_list[0] + c_list[2] + result + c_list[1]); if(coin == i + 1) result += c_list[0]; else if(coin == i) result += c_list[1]; else result += c_list[2]; } ///ask n char coin = press(result + c_list[0] + result + c_list[1]); if(coin == N) return (press(result + c_list[0]) == N ? result + c_list[0] : result + c_list[1]); return result + c_list[2]; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:9: error: 'c_list' was not declared in this scope; did you mean 'va_list'?
   14 |         c_list[0] = 'A';
      |         ^~~~~~
      |         va_list
combo.cpp:22:9: error: 'c_list' was not declared in this scope; did you mean 'va_list'?
   22 |         c_list[0] = (result[0] == 'A' ? 'B' : 'A');
      |         ^~~~~~
      |         va_list
combo.cpp:30:31: error: 'c_list' was not declared in this scope; did you mean 'va_list'?
   30 |         coin = press(result + c_list[0] + c_list[0] + result + c_list[0] + c_list[1]
      |                               ^~~~~~
      |                               va_list
combo.cpp:40:27: error: 'c_list' was not declared in this scope; did you mean 'va_list'?
   40 |     coin = press(result + c_list[0] + result + c_list[1]);
      |                           ^~~~~~
      |                           va_list