제출 #129869

#제출 시각아이디문제언어결과실행 시간메모리
129869miguel콤보 (IOI18_combo)C++14
5 / 100
3 ms2040 KiB
#include<bits/stdc++.h> #include <combo.h> using namespace std; #define rc(x) return cout<<x<<endl,0 #define pb push_back #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define sz size() #define x first #define y second #define pi pair <int, int> #define pii pair <int, pi> #define vi vector <int> const ll mod = 1e9 + 7; string guess_sequence(int n){ string s=""; vector <string> ch={"A", "B", "X", "Y"}; if(press("A")) s="A"; else if(press("B")) s="B"; else if(press("X")) s="X"; else s="Y"; // cout<<s<<endl; vector <string> use; for(int i=0; i<=3; i++) if(ch[i]!=s) use.pb(ch[i]); //for(string i: use) cout<<"x"<<i<<endl; for(int i=1; i<n-1; i++){ string xd=s+use[0]+s+use[1]+use[0]+s+use[1]+use[1]+s+use[1]+use[2]; // cout<<s<<" "<<xd;//<<endl; int q=press(xd); //cout<<" "<<q<<endl; if(q-2==i) s=s+use[1]; else if(q-1==i) s=s+use[0]; else s=s+use[2]; //cout<<s<<endl; }//cout<<s<<endl; int q=press(s+use[0]+s+use[1]); if(q==n-1){ s+=use[2]; } else{ q=press(s+use[0]); if(q==n-1) s+=use[1]; else (s+=use[0]); } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...