제출 #380850

#제출 시각아이디문제언어결과실행 시간메모리
380850fl0rian콤보 (IOI18_combo)C++14
10 / 100
86 ms440 KiB
#include <cstdio> #include <cstdlib> #include <algorithm> #include <string> #include "combo.h" #include <iostream> using namespace std; string lets[4]={"A","B","X","Y"}; std::string guess_sequence(int N) { string ans=""; int dontUse=-1; int found=0; int i=0; for(int i=0;i<4&&dontUse==-1;i++) if(press(lets[i])) dontUse=i; ans+=lets[dontUse]; for(int i=1;i<N;i++){ found=0; for(int j=0;j<4 && !found;j++) if(dontUse!=j && press(ans + lets[j])==i+1 ){ ans+=lets[j]; found=1; } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:9: warning: unused variable 'i' [-Wunused-variable]
   17 |     int i=0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...