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 <cmath>
#include <string.h>
#include "grader.h"
#include "lang.h"
unsigned short pre3[56][1048576];
unsigned short num3[1048576];
unsigned int p3[98];
unsigned int pre1[65536][56];
unsigned int num1[65536];
double now[56];
const unsigned int mod=1048575;
void excerpt(int *E)
{
int c,r,mxnum=0,i,j;
double z,mx;
memset(now,0,sizeof(now));
p3[0]=(E[0]<<10^E[1]<<5^E[2])&mod;
c=num3[p3[0]];
for(i=0;i<56;i++)
{
z=cbrt(pre3[i][p3[0]]);
now[i]+=1.9*z*z/(c+5);
}
for(i=1;i<98;i++)
{
p3[i]=(p3[i-1]<<5^E[i+2])&mod;
c=num3[p3[i]];
for(j=0;j<56;j++)
{
z=cbrt(pre3[j][p3[i]]);
now[j]+=1.9*z*z/(c+5);
}
}
for(i=0;i<100;i++)
{
if(num1[E[i]]>0)
{
for(j=0;j<56;j++)
{
z=cbrt(pre1[E[i]][j]);
now[j]+=z*z/num1[E[i]];
}
}
}
mx=now[0];
for(i=1;i<56;i++)
{
if(now[i]>mx)
{
mx=now[i];
mxnum=i;
}
}
r=language(mxnum);
for(i=0;i<98;i++)
{
num3[p3[i]]++;
pre3[r][p3[i]]++;
}
for(i=0;i<100;i++)
{
num1[E[i]]++;
pre1[E[i]][r]++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |