제출 #82450

#제출 시각아이디문제언어결과실행 시간메모리
82450farukkastamonuda콤보 (IOI18_combo)C++14
0 / 100
45 ms512 KiB
#include "combo.h" #include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000009 #define md 1000000007 #define li 100005 #define mp make_pair #define pb push_back #define mid (start+end)/2 using namespace std; int n; string y,ana; char ilk; string guess_sequence(int N){ ana.clear(); ilk=' '; n=N; y="AB"; if(press(y)>=1){ y="A"; if(press(y)>=1){ ilk='A'; } else ilk='B'; } else{ y="X"; if(press(y)>=1){ ilk='X'; } else ilk='Y'; } ana=ana+ilk; if(n==1) return ana; for(int i=2;i<=n-1;i++){ string t=ana; t.clear(); int uz=i-1; if(ilk=='A'){ t=t+"B"; t=t+ana+"XX"; t=t+ana+"XY"; t=t+ana+"XB"; //t=t+ana+'B'; int sonuc=press(t); if(sonuc==uz){ ana=ana+"Y"; } else if(sonuc==uz+1){ ana=ana+"B"; } else ana=ana+"X"; } else if(ilk=='B'){ t=t+"A"; t=t+ana+"XX"; t=t+ana+"XY"; t=t+ana+"XA"; //t=t+ana+'A'; int sonuc=press(t); if(sonuc==uz){ ana=ana+"Y"; } else if(sonuc==uz+1){ ana=ana+"A"; } else ana=ana+"X"; } else if(ilk=='X'){ t=t+"B"; t=t+ana+"AA"; t=t+ana+"AY"; t=t+ana+"AB"; //t=t+'B'; int sonuc=press(t); if(sonuc==uz){ ana=ana+"Y"; } else if(sonuc==uz+1){ ana=ana+"B"; } else ana=ana+"A"; } else if(ilk=='Y'){ t=t+"B"; t=t+ana+"AA"; t=t+ana+"AX"; t=t+ana+"AB"; //t=t+ana+'B'; int sonuc=press(t); if(sonuc==uz){ ana=ana+"X"; } else if(sonuc==uz+1){ ana=ana+"B"; } else ana=ana+"A"; } } if(n==1) return ana; string g; g.clear(); if(ilk=='A'){ g=ana+"B"+ana+"X"; int sonuc=press(g); if(sonuc==n-1){ ana=ana+"Y"; return ana; } g=ana+"B"; sonuc=press(g); if(sonuc==n-1){ ana=ana+"X"; return ana; } ana=ana+"B"; return ana; } // else if(ilk=='B'){ g=ana+"A"+ana+"X"; int sonuc=press(g); if(sonuc==n-1){ ana=ana+"Y"; return ana; } g=ana+"A"; sonuc=press(g); if(sonuc==n-1){ ana=ana+"X"; return ana; } ana=ana+"A"; return ana; } // else if(ilk=='X'){ g=ana+"B"+ana+"A"; int sonuc=press(g); if(sonuc==n-1){ ana=ana+"Y"; return ana; } g=ana+"B"; sonuc=press(g); if(sonuc==n-1){ ana=ana+"A"; return ana; } ana=ana+"B"; return ana; } else if(ilk=='Y'){ g=ana+"B"+ana+"X"; int sonuc=press(g); if(sonuc==n-1){ ana=ana+"A"; return ana; } g=ana+"B"; sonuc=press(g); if(sonuc==n-1){ ana=ana+"X"; return ana; } ana=ana+"B"; return ana; } }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:103:9: warning: control reaches end of non-void function [-Wreturn-type]
  103 |  string g;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...