제출 #890725

#제출 시각아이디문제언어결과실행 시간메모리
890725kokoue콤보 (IOI18_combo)C++14
5 / 100
1 ms500 KiB
#include<bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string p = ""; std::string S = ""; p="AX"; std::string let; int bid; int coins=press(p); if(coins>=1) { p="A"; coins=press(p); if(coins==1) {S+="A";let="XBY";} else {S+="X";let="ABY";} } else { p="B"; coins=press(p); if(coins==1) {S+="B";let="AXY";} else {S+="Y";let="AXB";} } // std::cout<<"Current s = "<<S<<"\n"; for(int i=1;i<N-1;i++) { p=""; p=S+let[0]; p+=S+let[1]+let[0]; p+=S+let[1]+let[1]; p+=S+let[1]+let[2]; coins=press(p); // std::cout<<"Press returned: "<<coins-i<<"\n"; if(coins==1+i) S+=let[0]; if(coins==2+i) S+=let[1]; if(coins==0+i) S+=let[2]; // std::cout<<"Current s = "<<S<<"\n"; } p=S+let[0]; p+=S+let[1]; coins=press(p); if(coins==0+N-1) S+=let[2]; else { p=S+let[0]; coins=press(p); if(coins==0+N-1) S+=let[1]; if(coins==1+N-1) S+=let[0]; } //std::cout<<"Current s = "<<S<<"\n"; return S; }

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

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