제출 #375251

#제출 시각아이디문제언어결과실행 시간메모리
375251Edbert2397콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { std::string p = ""; char s[4] = {'A','B','X','Y'}; do{ for(int i = 0;i<4;i++){ p += s[i]; } int coins = press(p); if(coins == N){ string ans = ""; for(int i = 0;i<3;i++){ ans += s[i]; } int coins = press(ans); if(coins == N) { return ans; } else{ ans = ""; for(int i = 1;i<4;i++){ ans += s[i]; } return ans; } } }while(next_permutation(s,s + 4)); }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:19: warning: control reaches end of non-void function [-Wreturn-type]
    6 |   std::string p = "";
      |                   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...