#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;
const int mod=65537;
int cnt1[65537][60];
double get1(int i, int j){
int sum=accumulate(cnt1[i], cnt1[i]+60, 0);
if (sum==0) return 0;
return (double)cnt1[i][j]/(double)sum;
}
int cnt2[65537][60];
double get2(int i, int j){
int sum=accumulate(cnt2[i], cnt2[i]+60, 0);
if (sum==0) return 0;
return (double)cnt2[i][j]/(double)sum;
}
int cc[56], tc;
double sum[56];
void excerpt(int *E) {
++tc;
pair<double, int> ans={0, 0};
set<int> st(E, E+10);
for (int j=0; j<56; ++j){
sum[j]=0;
for (int i=0; i<100; ++i) sum[j]+=get1(E[i], j);
for (int i=1; i<100; ++i) sum[j]+=get2((1ll*E[i-1]*65536+E[i])%mod, j);
ans=max(ans, {sum[j], j});
}
int real=language(ans.second);
for (int i=0; i<100; ++i) ++cnt1[E[i]%mod][real];
for (int i=1; i<100; ++i) ++cnt2[(1ll*E[i-1]*65536+E[i])%mod][real];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2801 ms |
24832 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
2944 ms |
24980 KB |
Output is partially correct - 73.63% |