#include <stdlib.h>
#include <stdio.h>
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
#define SZ 100
using namespace std;
const int MUL = 100000;
static map<int, int> word_list[56];
bool isInit = false;
void excerpt(int *E) {
if (!isInit) {
for (int i = 0; i <= 55; i++) {
word_list[i] = map<int, int>();
}
isInit = true;
}
int trigram_arr[SZ + 1];
for (int i = 2; i < SZ; i++) {
int trigram = E[i - 2] * MUL * MUL + E[i - 1] * MUL + E[i];
trigram_arr[i - 2] = trigram;
}
int maxs = 0, guess_ans = 0;
for (int i = 0; i <= 55; i++) {
int res = 0;
for (int j = 0; j < SZ - 2; j++) {
int element = trigram_arr[j];
if (word_list[i].count(element) != 0) {
res += word_list[i][element];
}
}
if (maxs < res) {
guess_ans = i;
maxs = res;
}
}
int real_ans = language(guess_ans);
for (int i = 0; i < SZ; i++) {
word_list[real_ans][trigram_arr[i]] += 1;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10029 ms |
13000 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10094 ms |
11744 KB |
Time limit exceeded |