이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |