This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdlib.h>
#include <stdio.h>
#include <bits/stdc++.h>
#include <unordered_map>
#include "grader.h"
#include "lang.h"
#define SZ 100
typedef long long lld;
using namespace std;
static int word_list[56][65536];
lld trigram_arr[SZ + 1];
bool isInit = false;
int hash2(int a, int b, int c) {
return (a * 37 + b * 59 + c) % 65536;
}
void excerpt(int *E) {
for (int i = 2; i < SZ; i++) {
trigram_arr[i - 2] = hash2(E[i - 2], E[i - 1], E[i]);
}
int maxs = 0, guess_ans = 0;
for (int i = 0; i <= 55; ++i) {
int res = 0;
for (int j = 0; j < SZ - 2; ++j) {
res += word_list[i][trigram_arr[j]];
}
if (maxs < res) {
guess_ans = i;
maxs = res;
}
}
int real_ans = language(guess_ans);
for (int i = 0; i < SZ - 2; i++) {
word_list[real_ans][trigram_arr[i]]++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |