Submission #1325898

#TimeUsernameProblemLanguageResultExecution timeMemory
1325898x_aCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

string guess_sequence(int N) {
  string p = "", s = "";
  int last = 0;
  char t = 'x';
  vector<char> A = {'A', 'B', 'X', 'Y'};
  for (int i = 0; i < N; ++i) {
    p = s;

    ll cnt = 0;
    for(int j = 0; j < 4; j ++){
      if(t == A[j]) continue;
      if(cnt == 2 && j){
        last ++;
        s += A[j];
        break;
      }
      int x = press(p + A[j]);
      if(x > last){
        if(last == 0){
          t = A[j];
        }
        s += A[j];
        last = x;
        break;
      }
      else{
        cnt ++;
      }
    }
  }
  return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:5: error: 'll' was not declared in this scope
   14 |     ll cnt = 0;
      |     ^~
combo.cpp:17:10: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |       if(cnt == 2 && j){
      |          ^~~
      |          int
combo.cpp:32:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   32 |         cnt ++;
      |         ^~~
      |         int