| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 2957 | ainta | Languages (IOI10_languages) | C++98 | 0 ms | 0 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 <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <map>
#include <algorithm>
using namespace std;
#include "grader.h"
#include "lang.h"
#define SZ 100
int prev[66000][56];
short Map[56][262144],Map2[56][262144],Map3[56][262144];
double C[56],tt;
void excerpt(int *E) {
int i,j,x,t;
double M=-1;
for(i=0;i<56;i++)C[i]=0;
for(i=0;i<SZ;i++){
for(j=0;j<56;j++){
tt=prev[E[i]][j];
C[j]+=tt/(tt+0.9);
if(i!=99){
t=E[i]*2735+E[i+1]*11295;
tt=Map[j][t&262143];
C[j]+=tt/(tt+1.0);
}
if(i<98){
t+=E[i+2]*9763;
tt=Map2[j][t&262143];
C[j]+=tt/(tt+1.0);
}
if(i<97){
t+=E[i+3]*4793;
tt=Map3[j][t&262143];
C[j]+=tt/(tt+1.0);
}
}
}
M=-1;
for(i=0;i<56;i++)if(M<C[i])M=C[i],x=i;
x=language(x);
for(i=0;i<SZ;i++){
prev[E[i]][x]++;
if(i<99){t=E[i]*2735+E[i+1]*11295;Map[x][t&262143]++;}
if(i<98){t+=E[i+2]*9763;Map2[x][t&262143]++;}
if(i<97){t+=E[i+3]*4793;Map3[x][t&262143]++;}
}
}
