#include <stdlib.h>
#include <stdio.h>
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
#define SZ 100
using namespace std;
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 bigram_arr[SZ + 1];
for (int i = 1; i < SZ; i++) {
int bigram = E[i - 1] * 100000 + E[i];
bigram_arr[i - 1] = bigram;
}
int maxs = 0, guess_ans = 0;
for (int i = 0; i <= 55; i++) {
int res = 0;
for (int j = 0; j < SZ - 1; j++) {
int element = bigram_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][bigram_arr[i]] += 1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5730 ms |
4908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
6850 ms |
4996 KB |
Output is partially correct - 61.52% |