Submission #511399

#TimeUsernameProblemLanguageResultExecution timeMemory
511399600MihneaLanguages (IOI10_languages)C++17
81 / 100
7076 ms4996 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;
set<int> words[L];
int score[L];

void excerpt(int *a) {
  for (int i = 0; i < N - 3; i++) {
    int x = a[i];
    int y = 111111111 * a[i] + a[i + 1];
    for (int l = 0; l < L; l++) {
      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];
    for (int l = 0; l < L; l++) {
      words[solution].insert(y);
    }
  }
}

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:15:9: warning: unused variable 'x' [-Wunused-variable]
   15 |     int x = a[i];
      |         ^
lang.cpp:31:9: warning: unused variable 'x' [-Wunused-variable]
   31 |     int x = a[i];
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...