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 <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
constexpr int SIZE = 100;
constexpr int LANG = 56;
constexpr int LEN = 4;
constexpr int MOD = 1000003;
constexpr double COEFF[] = {1.0, 4.0, 1.0, 6.0};
int appeared[LANG][MOD];
int whole[MOD];
void excerpt(int *E) {
double point[LANG] = {};
unsigned long long hash[SIZE] = {};
for (int k = 0; k < LEN; ++k) {
for (int i = 0; i < SIZE - k; ++i) {
hash[i] = (hash[i] << 16) ^ E[i + k];
const int t = hash[i] % MOD;
for (int j = 0; j < LANG; ++j) {
if (appeared[j][t]) {
point[j] += COEFF[k] * appeared[j][t] / whole[t];
}
}
}
}
const int type = language(std::max_element(point, point + LANG) - point);
std::memset(hash, 0, sizeof(hash));
for (int k = 0; k < LEN; ++k) {
for (int i = 0; i < SIZE - k; ++i) {
hash[i] = (hash[i] << 16) ^ E[i + k];
const int t = hash[i] % MOD;
appeared[type][t] += 1;
whole[t] += 1;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |