Submission #8122

# Submission time Handle Problem Language Result Execution time Memory
8122 2014-08-30T14:02:03 Z gs13105 Languages (IOI10_languages) C++
0 / 100
10000 ms 234184 KB
#include <map>
#include <math.h>
#include <string.h>
#include "grader.h"
#include "lang.h"
 
typedef std::map<unsigned int,int> M;
M pre[56];
M num;
double now[56];

void excerpt(int *E)
{
    int c,r,mxnum=0,i,j;
    unsigned int p[98];
    double z,mx;
    memset(now,0,sizeof(now));
	p[0]=E[0]<<16^E[1]<<8^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]<<8^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
1 Execution timed out 10038 ms 234184 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10027 ms 234104 KB Time limit exceeded