제출 #139684

#제출 시각아이디문제언어결과실행 시간메모리
139684Bazarkuly2003콤보 (IOI18_combo)C++14
0 / 100
4 ms1892 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N){ string s,q,t; int m,k; if(press("AB")==1){ if(press("A")==1){s="A";q="BXY";}else{s="B";q="AXY";}}else if(press("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";} while(s.size()<N){k=s.size(); if(k*4+7>N*4){ m=press(s+q[0]+q[1]); if(m==k+2)s+=q[0]+q[1];else if(m==k+1){if(press(s+q[0])==k+1)s+=q[0]; else s+=q[1]; }else if(m==k) s+=q[2]; } else{ t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1]; m=press(t); if(m==k+0)s+=q[2];else if(m==k+1)s+=q[1];else if(m==k+2)s+=q[0];} } return s; }

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

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