#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
#define SZ 100
#define A 65536LL
#define ld long double
#define MOD 458047
using namespace std;
int a[SZ][3],d[56][MOD][3];
void excerpt(int *E){
pair <int, int> mx={0,0};
for (int i=0;i<SZ-2;i++){
a[i][0]=E[i];
for (int j=1;j<3;j++)
a[i][j]=(a[i][j-1]*A+E[i+j])%MOD;
}
for (int i=0;i<56;i++){
int cnt=0;
for (int j=0;j<SZ-2;j++)
for (int k=0;k<3;k++)
cnt+=min(d[i][a[j][k]][k],k)*(1<<k);
mx=max(mx,{cnt,i});
}
int res=language(mx.second);
for (int i=0;i<SZ-2;i++)
for (int j=0;j<3;j++)
d[res][a[i][j]][j]++;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2722 ms |
239444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2928 ms |
239640 KB |
Output is partially correct - 88.43% |