제출 #139700

#제출 시각아이디문제언어결과실행 시간메모리
139700ekrem콤보 (IOI18_combo)C++17
0 / 100
2 ms280 KiB
#include "combo.h" #include <bits/stdc++.h> #define st first #define nd second #define mp make_pair #define pb push_back #define sol (k+k) #define sag (k+k+1) #define orta ((bas+son)/2) #define coc g[node][i] #define mod 1000000007 #define inf 1000000009 #define MAXN 1000005 using namespace std; typedef long long ll; typedef pair < int , int > ii; int n, m, ilk; map < int , string > h, x; string guess_sequence(int n) { h[1] = "A"; h[2] = "B"; h[3] = "X"; h[4] = "Y"; if(press(h[1] + h[2])){ if(press(h[1])) ilk = 1; else ilk = 2; } else{ if(press(h[3])) ilk = 3; else ilk = 4; } // for(int i = 1; i <= 4; i++){ // if(press(h[i]) > 0){ // ilk = i; // break; // } // } string s = ""; // cout << s << endl; s += h[ilk]; if(n == 1) return s; // cout << s << endl; for(int i = 1; i <= 4; i++){ if(i == ilk)continue; x[++m] = h[i]; } // cout << n << " " << ilk << " " << s << endl; for(int i = 2; i <= n - 1; i++){ string sor = ""; sor += s;sor += x[1];sor += x[1]; sor += s;sor += x[1];sor += x[2]; sor += s;sor += x[1];sor += x[3]; sor += s;sor += x[2]; // cout << n << " " << sor.size() << " " << sor << endl; int ans = press(sor); if(ans == i) s += x[2]; else if(ans == i + 1) s += x[1]; else s += x[3]; } if(press(s + x[1] + s + x[2]) == n){ if(press(s + x[1])) s += x[1]; else s += x[2]; } else s += x[3]; // for(int i = 1; i <= 3; i++){ // if(press(s + x[i]) == n){ // s += x[i]; // break; // } // } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...