제출 #534529

#제출 시각아이디문제언어결과실행 시간메모리
534529Abdulmohsen1284콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include"bits/stdc++.h" using namespace std; std::string guess_sequence(int N) { string g,s; g="AB"; long long ans=press(g); if(ans==1) { g="A"; ans=press(g); if(ans==1) s="A"; else s="B"; } else { g="X"; ans=press(g); if(ans==1) s="X"; else s="Y"; } char a[4]; long long cur=0; string chek="ABXY"; for(int i=0;i<(int)chek.size();i++) { if(s[0]!=chek[i]) { a[cur]=chek[i]; cur++; } } for(int i=1;i<N-1;i++) { string rn; rn=s+chek[0]; for(int j=0;j<3;j++) rn+=s+chek[1]+chek[j]; ans=press(rn); if(ans==(long long)s.size()) { s+=chek[2]; } if(ans==(long long)s.size()+1) { s+=chek[0]; } if(ans==(long long)s.size()+2) { s+=chek[1]; } } if(N!=1) { string rn=s+"A"+s+"B"; ans=press(rn); if(ans==(long long)s.size()+1) { rn=s+"A"; ans=press(rn); if(ans==(long long)s.size()+1) s+="A"; else s+="B"; } else { rn=s+"X"; ans=press(rn); if(ans==(long long)s.size()+1) s+="X"; else s+="Y"; } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:26:10: warning: variable 'a' set but not used [-Wunused-but-set-variable]
   26 |     char a[4];
      |          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...