제출 #440284

#제출 시각아이디문제언어결과실행 시간메모리
440284julian33콤보 (IOI18_combo)C++14
30 / 100
71 ms572 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #ifdef LOCAL #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) { cerr<<vars<<" = "; string delim=""; (...,(cerr<<delim<<values,delim=", ")); cerr<<"\n"; } #else #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) {} #endif #define pb push_back #define sz(x) (int)(x.size()) typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; template<typename T> inline void maxa(T& a,T b){a=max(a,b);} template<typename T> inline void mina(T& a,T b){a=min(a,b);} // int press(string p){ // deb(p); // string pref=S; // while(sz(pref)){ // if(p.find(pref)!=string::npos){ // deb(pref); // return sz(pref); // } // pref.pop_back(); // } // return 0; // } string guess_sequence(int N){ string res=""; while(sz(res)!=N){ int num=press(res+'A'+res+'B'); if(num>sz(res)){ int a=press(res+'A'); if(a>sz(res)) res+='A'; else res+='B'; } else{ int x=press(res+'X'); if(x>sz(res)) res+='X'; else res+='Y'; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...