#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;
const int mod=65537;
int cnt[10][65537][60];
double get(int h, int i, int j){
int sum=accumulate(cnt[h][i], cnt[h][i]+60, 0);
if (sum==0) return 0;
return (double)cnt[h][i][j]/(double)sum;
}
int cc[56], tc;
double sum[56];
void excerpt(int *E) {
++tc;
pair<double, int> ans={0, 0};
for (int j=0; j<56; ++j){
sum[j]=0;
for (int h=0; h<3; ++h) for (int i=h; i<100; ++i){
int val=0;
for (int j=i-h; j<=i; ++j) val=(1ll*val*65536+E[j])%mod;
sum[j]+=get(h, val, j);
}
ans=max(ans, {sum[j], j});
}
int real=language(ans.second);
for (int h=0; h<3; ++h) for (int i=h; i<100; ++i){
int val=0;
for (int j=i-h; j<=i; ++j) val=(1ll*val*65536+E[j])%mod;
++cnt[h][val][real];
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5672 ms |
34892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
5428 ms |
35076 KB |
Output is partially correct - 74.09% |