제출 #86930

#제출 시각아이디문제언어결과실행 시간메모리
86930tjdgus4384Combo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include<cstdio> #include "combo.h" #include<string> using namespace std; string x[4] = {"A", "B", "X", "C"}; string guess_sequence(int n) { string p; int f, a; for(int i = 0;i < 4;i++) { a = press(x[i]); if(a == 1) f = i; } p = x[f]; for(int i = 1;i < n;i++) { for(int j = 0;j < 4;j++) { if(j == f) continue; string q = p + x[j]; a = press(q); if(a == i + 1) { p += x[j]; break; } } } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:13: warning: 'f' may be used uninitialized in this function [-Wmaybe-uninitialized]
   21 |             if(j == f) continue;
      |             ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...