#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("sse4,avx2,fma,avx")
#define FOR(i, x, y) for (int i = x; i < y; i++)
typedef long long ll;
using namespace std;
#include "grader.h"
#include "lang.h"
const int SZ = 100, LANGS = 56;
ll cnt[LANGS], quadram[SZ];
unordered_map<ll, unordered_map<int, int>> mp;
void excerpt(int *E) {
FOR(i, 0, LANGS) cnt[i] = 0;
FOR(i, 0, SZ - 3) {
quadram[i] = 0;
FOR(j, 0, 4) {
quadram[i] = (quadram[i] << 16) + E[i + j];
}
if (mp[quadram[i]].size()) {
int best = 0, sim = 0;
for (pair<int, int> k : mp[quadram[i]]) {
if (k.second > sim) {
sim = k.second;
best = k.first;
}
}
cnt[best]++;
}
}
int best = 0, sim = 0;
FOR(i, 0, LANGS) {
if (cnt[i] > sim) {
sim = cnt[i];
best = i;
}
}
int ans = language(best);
FOR(i, 0, SZ - 3) {
mp[quadram[i]][ans]++;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1107 ms |
56332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1171 ms |
56296 KB |
Output is partially correct - 88.61% |