#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<4; ++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<4; ++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];
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7987 ms |
50256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
7797 ms |
50260 KB |
Output is partially correct - 73.69% |