제출 #78711

#제출 시각아이디문제언어결과실행 시간메모리
78711wleung_bvg콤보 (IOI18_combo)C++14
100 / 100
50 ms544 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define eb emplace_back #define mp make_pair #define f first #define s second #define all(a) (a).begin(),(a).end() #define For(i,a,b) for(auto i=(a);i<(b);i++) #define FOR(i,b) For(i,0,b) #define Rev(i,a,b) for(auto i=(a);i>(b);i--) #define REV(i,a) Rev(i,a,-1) #define FORE(i,a) for(auto&&i:a) #define sz(a) (int((a).size())) using ll=long long;using ld=long double;using uint=unsigned int;using ull=unsigned long long; using pii=pair<int,int>;using pll=pair<ll,ll>;using pill=pair<int,ll>;using plli=pair<ll,int>;using pdd=pair<double,double>;using pld=pair<ld,ld>; constexpr const char nl='\n',sp=' ';constexpr const int INT_INF=0x3f3f3f3f;constexpr const ll LL_INF=0x3f3f3f3f3f3f3f3f; constexpr const double D_INF=numeric_limits<double>::infinity();constexpr const ld LD_INF=numeric_limits<ld>::infinity();constexpr const double EPS=1e-9; string guess_sequence(int N) { string S = press("AB") ? (press("A") ? "A" : "B") : (press("X") ? "X" : "Y"), ch = ""; FORE(c, "ABXY") if (S[0] != c) ch.pb(c); For(i, 1, N - 1) S.pb(ch[press(S + ch[1] + S + ch[2] + ch[0] + S + ch[2] + ch[1] + S + ch[2] + ch[2]) - i]); return N == 1 ? S : (press(S + ch[0] + S + ch[1]) == N ? (press(S + ch[0]) == N ? S + ch[0] : S + ch[1]) : (S + ch[2])); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...