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 "grader.h"
#include "lang.h"
#define SZ 100
#include <bits/stdc++.h>
using namespace std;
unordered_set<long long> words[56][5];
long long score[56];
int weight[5];
void excerpt(int *E) {
for (int i = 0; i < 56; i++) {
score[i] = 0;
}
for (int len = 1; len <= 5; len++) {
for (int i = 0; i < 101 - len; i++) {
unsigned long long h = 0;
for (int j = 0; j < len; j++) {
h = h << 16 | E[i + j];
}
for (int j = 0; j < 56; j++) {
score[j] += words[j][len - 1].count(h) * len;
}
}
}
pair<long long, int> best = make_pair(-1, -1);
for (int i = 0; i < 56; i++) {
best = max(best, make_pair(score[i], i));
}
int ans = language(best.second);
for (int len = 1; len <= 5; len++) {
for (int i = 0; i < 101 - len; i++) {
unsigned long long h = 0;
for (int j = 0; j < len; j++) {
h = h << 16 | E[i + j];
}
words[ans][len - 1].insert(h);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |