# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
434370 |
2021-06-21T05:22:36 Z |
KoD |
Languages (IOI10_languages) |
C++17 |
|
3436 ms |
218112 KB |
#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 = 4000037;
constexpr double COEFF[] = {1.0, 6.0, 2.5, 13.0};
bool appeared[LANG][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];
for (int j = 0; j < LANG; ++j) {
point[j] += COEFF[k] * appeared[j][hash[i] % MOD];
}
}
}
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];
appeared[type][hash[i] % MOD] = true;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3436 ms |
218108 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
3383 ms |
218112 KB |
Output is partially correct - 90.75% |