제출 #8122

#제출 시각아이디문제언어결과실행 시간메모리
8122gs13105Languages (IOI10_languages)C++98
0 / 100
10038 ms234184 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...