제출 #936970

#제출 시각아이디문제언어결과실행 시간메모리
936970MuntherCarrot콤보 (IOI18_combo)C++14
5 / 100
1 ms596 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; // int press(string s) string s = "ABXY"; string guess_sequence(int N){ string ans; int x = 0; if(press("AB")){ if(press("B")) swap(s[0], s[1]); } else{ if(press("X")) swap(s[0], s[2]); else swap(s[0], s[3]); } ans = s[0]; while((int)ans.size() < N - 1){ string f = ans + s[1] + ans + s[2] + s[1] + ans + s[2] + s[2] + ans + s[2] + s[3]; int res = press(f); if(res == (int)ans.size()){ ans += s[3]; } else if(res == (int)ans.size() + 1){ ans += s[1]; } else{ ans += s[2]; } } if(press(ans + s[1]) == N) ans += s[1]; else if(press(ans + s[2]) == N) ans += s[2]; else ans += s[3]; return ans; }

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

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