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"
using namespace std;
using ll = unsigned long long;
static const int hmax = 65535;
static const ll B = 65537;
static const int L = 100;
// B ^ 3 - max
// len 4
set<ll> l[56][5];
void excerpt(int E[]) {
vector<ll> seq[5];
for(int len=1; len<=4; len++)
for(int i=0; i+len-1<L; i++) {
ll hval = 0;
for(int j=i; j<=i+len-1; j++)
hval = B * hval + E[j];
seq[len].emplace_back(hval);
}
ll mx = -1; int w = 0;
for(int i=0; i<56; i++) {
ll cnt = 0;
for(int len=1; len<=4; len++)
for(auto x : seq[len])
if(l[i][len].find(x) != l[i][len].end()) cnt++;
if(cnt > mx) {
mx = cnt;
w = i;
}
}
int ans = language(w);
for(int len=1; len<=4; len++) {
for(int i=0; i+len-1<L; i++) {
ll hval = 0;
for(int j=i; j<=i+len-1; j++)
hval = B * hval + E[j];
l[ans][len].emplace(hval);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |