답안 #512092

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
512092 2022-01-16T06:37:21 Z 600Mihnea Languages (IOI10_languages) C++17
100 / 100
8680 ms 22392 KB
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"

using namespace std;

typedef unsigned long long ll;
const int N = 100;
const int L = 56;
const int B = 65535;
unordered_set<ll> words[L];
int score[L];
bool first = 1;

void excerpt(int *a) {
  if (first) {
    first = 0;

  }
  for (int i = 0; i < 97; i++) {
    ll x = a[i];
    ll y = (ll) B * x + a[i + 1];
    ll z = (ll) B * y + a[i + 2];
    ll g = (ll) B * z + a[i + 3];

    for (int l = 0; l < L; l++) {
      score[l] += words[l].count(x);
      score[l] += words[l].count(g);
    }
  }
  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 < 97; i++) {
    ll x = a[i];
    ll y = (ll) B * x + a[i + 1];
    ll z = (ll) B * y + a[i + 2];
    ll g = (ll) B * z + a[i + 3];
    for (int l = 0; l < L; l++) {
      words[solution].insert(x);
      words[solution].insert(g);
    }
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 7222 ms 22356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8680 ms 22392 KB Output is correct - 91.08%