제출 #309716

#제출 시각아이디문제언어결과실행 시간메모리
309716wildturtle콤보 (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 ans,s,s1; long long a,n; n=N; if(press("AB")>=1) { if(press("A")==1) { ans="A"; s1='BXY'; } else { s1="AXY"; ans="B"; } } else if(press("X")==1) { ans="X"; s1="ABY"; } else { s1="ABX"; ans="Y"; } for(long long i=2;i<n;i++) { s=ans+s1[0]+ans+s1[1]+s1[0]+ans+s1[1]+s1[1]+ans+s1[1]+s1[2]; long long a=press(s); if(a==i-1) ans+=s1[2]; else if(a==i) ans+=s1[0]; else ans+=s1[1]; } s1=ans+s1[0]+ans+s1[1]; if(press(s1)==n) { s1=ans+s1[0]; if(press(s1)==n) ans=ans+s1[0]; else ans=ans+s1[1]; } else ans=ans+s1[2]; return ans; }

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

combo.cpp:10:37: warning: multi-character character constant [-Wmultichar]
   10 |     if(press("A")==1) { ans="A"; s1='BXY'; }
      |                                     ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:37: warning: overflow in conversion from 'int' to 'char' changes value from '4347993' to ''Y'' [-Woverflow]
combo.cpp:7:12: warning: unused variable 'a' [-Wunused-variable]
    7 |  long long a,n;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...