제출 #956051

#제출 시각아이디문제언어결과실행 시간메모리
956051Faissel콤보 (IOI18_combo)C++17
30 / 100
23 ms1464 KiB
#include <bits/stdc++.h> using namespace std; #include "combo.h" #define ll long long #define endl '\n' string guess_sequence(int n) { string y = "ABXY"; string ans = ""; for(int i=1;i<=n;i++){ bool f= false; for(int j=0;j<y.size()-1;j++){ int val = press(ans+y[j]); if(val == i){ ans += y[j]; f = true; if(i==1)y.erase(y.begin()+j); break; } } if(!f){ ans += y[y.size()-1]; if(i==1)y.erase(y.begin()+y.size()-1); } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |       for(int j=0;j<y.size()-1;j++){
      |                   ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...