Submission #511401

#TimeUsernameProblemLanguageResultExecution timeMemory
511401600MihneaLanguages (IOI10_languages)C++17
0 / 100
2158 ms276 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];
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(y);
    }
  }
  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++) {
      score[l] += words[l].count(x);
      score[l] += words[l].count(y);
    }
  }
}

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:22:9: warning: unused variable 'z' [-Wunused-variable]
   22 |     int z = (111111111 * a[i] + a[i + 1] * 111111111) + a[i + 2];
      |         ^
lang.cpp:40:9: warning: unused variable 'z' [-Wunused-variable]
   40 |     int z = (111111111 * a[i] + a[i + 1] * 111111111) + a[i + 2];
      |         ^
lang.cpp:36:7: warning: unused variable 'solution' [-Wunused-variable]
   36 |   int solution = language(prediction);
      |       ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...