Submission #511395

#TimeUsernameProblemLanguageResultExecution timeMemory
511395600MihneaLanguages (IOI10_languages)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"

using namespace std;

const int N = 100;
const int L = 56;
const int LIMIT = 3;
set<int> words[L];
int score[L];

void excerpt(int *a) {
  for (int i = 0; i < N; i++) {
    ll current = 0;
    for (int len = 1; i + len - 1 < N && len <= LIMIT; len++) {
      current *= 111111111;
      current += a[i + len - 1];
      for (int l = 0; l < L; l++) {
        score[l] += words[l].count(current);
      }
    }
  }
  int highest = -1, prediction = -1;
  for (int l = 0; l < L; l++) {
    if (score[l] > highest) {
      highest = score[l];
      prediction = l;
    }
    score[l] = 0;
  }
  int solution = language(prediction);
  for (int i = 0; i < N; i++) {
    ll current = 0;
    for (int len = 1; i + len - 1 < N && len <= LIMIT; len++) {
      current *= 111111111;
      current += a[i + len - 1];
      words[solution].insert(current);
    }
  }
}

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:15:5: error: 'll' was not declared in this scope
   15 |     ll current = 0;
      |     ^~
lang.cpp:17:7: error: 'current' was not declared in this scope
   17 |       current *= 111111111;
      |       ^~~~~~~
lang.cpp:34:5: error: 'll' was not declared in this scope
   34 |     ll current = 0;
      |     ^~
lang.cpp:36:7: error: 'current' was not declared in this scope
   36 |       current *= 111111111;
      |       ^~~~~~~