제출 #769876

#제출 시각아이디문제언어결과실행 시간메모리
769876ByeWorld콤보 (IOI18_combo)C++14
30 / 100
43 ms496 KiB
#include "combo.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ll long long
using namespace std;
typedef pair<int,int> pii;
typedef pair<pii, int> ipii;
const int MAXN = 1e5+100;

string ans, p;
int coin;

string guess_sequence(int N) {
    for(int i = 1; i<=N; ++i) {
        p.clear();
        p = ans+'A'; p += (ans+'B');
        //cout << i << ' ' << p << " p\n";
        coin = press(p);

        char add;
        if(coin >= i){ // a ato b
            p.clear();
            p = ans+'A';
            coin = press(p);
            if(coin==i) add = 'A';
            else add = 'B';
        } else {
            p.clear();
            p = ans+'X';
            coin = press(p);
            if(coin==i) add = 'X';
            else add = 'Y';
        }
        ans += add;
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...