제출 #728882

#제출 시각아이디문제언어결과실행 시간메모리
728882Toxtaq콤보 (IOI18_combo)C++17
30 / 100
43 ms472 KiB
#include <bits/stdc++.h> using namespace std; int press(std::string p); std::string guess_sequence(int N){ int n = N; string res = "", s; if(press("A")){ res += 'A'; s = "BXY"; } else if(press("B")){ res += 'B'; s = "AXY"; } else if(press("X")){ res += 'X'; s = "ABY"; } else{ res += 'Y'; s = "ABX"; } for(int i = 1;i < n;++i){ bool ok = 0; for(int j = 0;j < 2;++j){ res += s[j]; if(press(res) == res.size()){ ok = 1; break; } res.pop_back(); } if(!ok){ res += s[2]; } } return res; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |             if(press(res) == res.size()){
      |                ~~~~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...