제출 #128808

#제출 시각아이디문제언어결과실행 시간메모리
128808kostia244콤보 (IOI18_combo)C++14
30 / 100
61 ms524 KiB
#include "combo.h" using namespace std; std::string guess_sequence(int N) { char a[] = {'A', 'B', 'Y', 'X'}; char ban = 'X', def = 'A'; std::string cur; int coins; for(int i = 0; i < 3; i++) if(press(string(1, a[i]))) { ban = a[i]; def = a[(i+1)%4]; break; } cur = ban; char c; for(int k = 2; k <= N; k++) { c = def; for(int i = 0; i < 4; i++) { if(a[i] == ban || a[i] == def) continue; if(press(cur+a[i]) == k) { c = a[i]; break; } } cur += c; } return cur; }

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:7: warning: unused variable 'coins' [-Wunused-variable]
    7 |   int coins;
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...