#include "bits/stdc++.h"
using namespace std;
#ifdef duc_debug
#include "bits/debug.h"
#else
#define debug(...)
#include "grader.h"
#endif
const int mod = 999983;
const int base = 65536;
int a[99][4];
int d[56][mod];
int weight[] = {1, 2, 3, 4};
void excerpt(int *E) {
for (int i = 0; i < 97; ++i) {
for (int j = 0; j < 4; ++j) {
a[i][j] = (1ll * (j ? a[i][j - 1] : 0) * base % mod + E[i + j]) % mod;
}
}
int match = 0, pos = 0;
for (int i = 0; i < 56; ++i) {
int cur = 0;
for (int j = 0; j < 97; ++j) {
for (int k = 0; k < 4; ++k) {
cur += d[i][a[j][k]] * weight[k];
}
}
if (match < cur) {
match = cur, pos = i;
}
}
int L = language(pos);
for (int i = 0; i < 97; ++i) {
for (int j = 0; j < 4; ++j) {
++d[L][a[i][j]];
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |