제출 #547230

#제출 시각아이디문제언어결과실행 시간메모리
547230urosk콤보 (IOI18_combo)C++14
100 / 100
28 ms576 KiB
#include "combo.h" #define here cerr<<"===========================================\n" #include <bits/stdc++.h> #define ld double #define ll long long #define ull unsigned long long #define llinf 100000000000000000LL // 10^17 #define iinf 2000000000 // 2*10^9 #define pb push_back #define popb pop_back #define fi first #define sc second #define endl '\n' #define pii pair<int,int> #define pll pair<ll,ll> #define pld pair<ld,ld> #define sz(a) int(a.size()) #define all(a) a.begin(),a.end() #define ceri(a,l,r) {for(ll i = l;i<=r;i++) cerr<<a[i]<< " ";cerr<<endl;} using namespace std; #define maxn 8005 ll n; string ans; string p; ll a[maxn]; bool b[maxn][5]; vector<char> v = {'.','A','B','X','Y'}; string conv(ll len){ string ans = ""; for(ll i = 1;i<=len;i++) ans.pb(v[a[i]]); return ans; } ll m = 4; ll cnt,c; string guess_sequence(int N) { n = N; string a = "A"; string b = "B"; string d = "X"; string e = "Y"; c = press("AB"); if(c){ if(press("A")) ans = "A"; else ans = "B"; }else{ if(press("X")) ans = "X"; else ans = "Y"; } if(ans=="A") a = "B",b = "X",e ="Y"; if(ans=="B") a = "A",b = "X",e ="Y"; if(ans=="X") a = "B",b = "A",e ="Y"; if(ans=="Y") a = "B",b = "X",e ="A"; for(ll i = 2;i<=n;i++){ if(i==n){ if(press(ans+a)==n) ans+=a; else if(press(ans+b)==n) ans+=b; else ans+=e; break; } c = press(ans+a+ans+b+b+ans+b+a+ans+b+e); if(c==i) ans+=a; else if(c==i+1) ans+=b; else ans+=e; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...