Submission #511407

#TimeUsernameProblemLanguageResultExecution timeMemory
511407600MihneaLanguages (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 = 1; unordered_set<int> words[L]; int score[L]; int f[L][(] bool first = 1; void excerpt(int *a) { if (first) { first = 0; } for (int i = 0; i < N - 3; i++) { int x = a[i]; int y = 111111111 * a[i] + a[i + 1]; int z = (111111111 * a[i] + a[i + 1] * 111111111) + a[i + 2]; for (int l = 0; l < L; l++) { // score[l] += words[l].count(x); score[l] += words[l].count(x); score[l] += words[l].count(z); } } 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 - 3; i++) { int x = a[i]; int y = 111111111 * a[i] + a[i + 1]; int z = (111111111 * a[i] + a[i + 1] * 111111111) + a[i + 2]; for (int l = 0; l < L; l++) { // words[solution].insert(x); words[solution].insert(x); words[solution].insert(z); } } }

Compilation message (stderr)

lang.cpp:12:11: error: expected primary-expression before ']' token
   12 | int f[L][(]
      |           ^
lang.cpp:12:11: error: expected ')' before ']' token
   12 | int f[L][(]
      |          ~^
      |           )
lang.cpp:13:15: error: expected ']' before ';' token
   13 | bool first = 1;
      |               ^
      |               ]
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:16:7: error: 'first' was not declared in this scope
   16 |   if (first) {
      |       ^~~~~
lang.cpp:22:9: warning: unused variable 'y' [-Wunused-variable]
   22 |     int y = 111111111 * a[i] + a[i + 1];
      |         ^
lang.cpp:41:9: warning: unused variable 'y' [-Wunused-variable]
   41 |     int y = 111111111 * a[i] + a[i + 1];
      |         ^