제출 #447524

#제출 시각아이디문제언어결과실행 시간메모리
447524MohamedAliSaidane콤보 (IOI18_combo)C++14
10 / 100
78 ms576 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; #define pb push_back #define popb pop_back #define ff first #define ss second const int MOD = 1e9 + 7; const ll INF = 1e18; const char but[4] = {'A','B','X','Y'}; string guess_sequence(int n) { string p = ""; string s = ""; int fr = -1; for(int i = 0; i < 4; i ++) { string g = p + but[i]; int rep = press(g); if(rep == 1) { fr = i; p = g; break; } } int prog = 1; for(int i = 1; i < n; i ++) { for(int j= 0; j < 4; j ++) { if(j == fr) continue; string g = p + but[j]; int tent = press(g); if(tent > prog) { p += but[j]; prog ++; break; } } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...