제출 #299727

#제출 시각아이디문제언어결과실행 시간메모리
299727tzero콤보 (IOI18_combo)C++14
10 / 100
78 ms428 KiB
#include "combo.h" using namespace std; char guess_next(string & S, int N) { int len = S.size(); int checked = 0; for(char c : { 'A', 'B', 'X', 'Y'}) { if(len > 0 && c == S[0]) continue; if(checked == 2 && len > 0) return c; std::string s = S; for(int i = len; i < N; i++) { s += c; } int coins = press(s); if(coins > len) return c; else checked++; } } std::string guess_sequence(int N) { std::string S = ""; for(int i = 0; i < N; i++) { S += guess_next(S, N); } return S; }

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

combo.cpp: In function 'char guess_next(std::string&, int)':
combo.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...