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"
int pre[56][65536];
int num[65536];
double now[56];
void excerpt(int *E)
{
int c,r,mxnum=0,i,j;
unsigned short p[98];
double z,mx;
memset(now,0,sizeof(now));
p[0]=E[0]<<8^E[1]<<4^E[2];
c=num[p[0]];
if(c!=0)
{
for(j=0;j<56;++j)
{
z=cbrt(pre[j][p[0]]);
now[j]+=z*z/c;
}
}
for(i=1;i<98;++i)
{
p[i]=p[i-1]<<4^E[i+2];
c=num[p[i]];
if(c!=0)
{
for(j=0;j<56;++j)
{
z=cbrt(pre[j][p[i]]);
now[j]+=z*z/c;
}
}
}
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)
{
++num[p[i]];
++pre[r][p[i]];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |