This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
#include <bits/stdc++.h>
using namespace std;
const int mod=100003;
int cnt[10][mod][60];
int ss[10][mod];
double get(int h, int i, int j){
int sum=ss[h][i];
if (!sum) return 0;
return (double)cnt[h][i][j]/(double)sum;
}
int cc[56], tc;
double sum[56];
int a[10][100];
void excerpt(int *E) {
for (int h=0; h<4; ++h) for (int i=h; i<100; ++i){
if (h==0) a[h][i]=E[i];
else a[h][i]=(1ll*a[h-1][i-1]*65536+E[i])%mod;
}
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){
sum[j]+=get(h, a[h][i], 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){
++cnt[h][a[h][i]][real];
++ss[h][a[h][i]];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |