Submission #1339413

#TimeUsernameProblemLanguageResultExecution timeMemory
1339413vjudge1Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

#define ll long long
const ll MOD = 1e9 + 7;

ll ask(ll r, ll c) {
    cout << "? " << r << " " << c << endl;
    ll d; cin >> d;
    return d;
}

string guess_sequence(int N) {
    string bs = "ABXY";
    string s = "";
    
    if (press("AB")) {
        if (press("A")) s = "A";
        else s = "B";
    } else {
        if (press("X")) s = "X";
        else s = "Y";
    }

    if (N == 1) return s;

    string p = "";
    for (char c : bs) {
        if (c != s[0]) p += c;
    }

    for (int i = 1; i < N - 1; ++i) {
        string q = s + p[0] + p[0] + s + p[0] + p[1] + s + p[0] + p[2] + s + p[1];
        int res = press(q);

        if (res == s.size() + 2) {
            s += p[0];
        } else if (res == s.size() + 1) {
            s += p[1];
        } else {
            s += p[2];
        }
    }

    if (press(s + p[0]) == N) {
        s += p[0];
    } else if (press(s + p[1]) == N) {
        s += p[1];
    } else {
        s += p[2];
    }

    return s;
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1; // cin >> t;
    while (t--) guess_sequence();
    return 0;
}

Compilation message (stderr)

combo.cpp: In function 'int main()':
combo.cpp:62:31: error: too few arguments to function 'std::string guess_sequence(int)'
   62 |     while (t--) guess_sequence();
      |                 ~~~~~~~~~~~~~~^~
combo.cpp:14:8: note: declared here
   14 | string guess_sequence(int N) {
      |        ^~~~~~~~~~~~~~