# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
2950 | gs13068 | Languages (IOI10_languages) | C++98 | 10058 ms | 14844 KiB |
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"grader.h"
#include"lang.h"
int lang[56][65536];
int count[65536];
void excerpt(int *str)
{
double max=987654321,maxlang;
double now;
int i,j,n,sum;
for(i=0;i<65536;i++)count[i]=0;
for(i=0;i<100;i++)count[str[i]]++;
for(i=0;i<56;i++)
{
sum=65536;
for(j=0;j<65536;j++)sum+=lang[i][j];
now=0;
for(j=0;j<65536;j++)now+=((lang[i][j]+1.)/sum-count[j])*((lang[i][j]+1.)/sum-count[j]);
if(now<max)
{
max=now;
maxlang=i;
}
}
n=language(maxlang);
for(i=0;i<65536;i++)lang[n][i]+=count[i];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |