#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 |
1 |
Incorrect |
984 ms |
49056 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1039 ms |
49028 KB |
Output isn't correct - 1.91% |
2 |
Halted |
0 ms |
0 KB |
- |