Submission #1085945

#TimeUsernameProblemLanguageResultExecution timeMemory
1085945kiethm07Combo (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <combo.h>

#define pii pair<int,int>
#define iii pair<int,pii>
#define fi first
#define se second

#define vi vector<int>
#define all(x) x.begin(),x.end()

#define TEXT "a"

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int inf = 1e9 + 7;
const ld eps = 1e-8;
const double pi = acos(-1);

string ch[4] = {"A","B","X","Y"};

string S = "ABX";

string guess_sequence(int n){
    string s = "";
    int f = -1;
    int g = press(s + ch[0] + ch[1]);
    if (g == 0){
        g = press(s + ch[2]);
        if (g == 0) f = 3;
        else f = 2;
    }
    else{
        g = press(s + ch[0]);
        if (g == 0) f = 1;
        else f = 0;
    }
    s += ch[f];
    vector<string> a;
    for (int i = 0; i < 4; i++){
        if (i == f) continue;
        a.push_back(ch[i]);
    }
    string g1,g2,g3;
    g1 = g2 = g3 = "";
    g1 += a[1] + a[0];
    g2 += a[1] + a[1];
    g3 += a[1] + a[2];
    for (int i = 2; i < n; i++){
        int g = press(s + a[0]] + s + g1 + s + g2 + s + g3);
        int t = s.size();
        if (g == 0 + t) s += a[2];
        if (g == 1 + t) s += a[0];
        if (g == 2 + t) s += a[1];
    }
    int t = s.size();
    g = press(s + a[0]);
    if (g == t){
        g = press(s + a[1]);
        if (g == t) s += a[2];
        else s += a[1];
    }
    else s += a[0];
    return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:54:31: error: expected ')' before ']' token
   54 |         int g = press(s + a[0]] + s + g1 + s + g2 + s + g3);
      |                      ~        ^
      |                               )