Submission #931994

#TimeUsernameProblemLanguageResultExecution timeMemory
931994ntminCombo (IOI18_combo)C++14
30 / 100
23 ms1464 KiB
#ifndef ntmin
    #include "combo.h";
#endif // ntmin

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
#define fi first
#define sc second

vector<string> p = {"A", "B", "X", "Y"};

// int press(string s){
//     cout << s << '\n';
//     int t; cin >> t;
//     return t;
// }

string guess_sequence(int N){
    string ans = "";
    for(int i = 0; i < 3; ++i){
        if(press(p[i])){
            ans += p[i];
            swap(p[i], p[3]);
            p.pop_back();
            break;
        } 
    }
    if(ans.size() == 0){
        ans += p[3];
        p.pop_back();
    }

    for(int i = 1; i < N; ++i){
        bool ok = 0;
        for(int j = 0; j < 2; ++j){
            if(press(ans + p[j]) == i + 1){
                ok = 1;
                ans.append(p[j]);
                break;
            }
        }
        if(!ok) ans.append(p[2]);
    }
    return ans;
}

// int main(){
//     cout << guess_sequence(5);
// }

Compilation message (stderr)

combo.cpp:2:23: warning: extra tokens at end of #include directive
    2 |     #include "combo.h";
      |                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...