#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int k[56][66666];
map<long long,vector<int>>mpv;
int C[56];
void excerpt(int *E) {
pair<double,int>mx={0,0};
int c[56];
for(int i=0;i<56;i++){
c[i]=0;
}
for(int i=0;i<100;i++){
for(int j=0;j<56;j++){
c[j]+=k[j][E[i]];
}
}
for(int i=0;i<99;i++){
for(int j:mpv[E[i]*66666+E[i+1]]){
c[j]+=3;
}
}
for(int i=0;i<56;i++){
if(C[i]==0)continue;
mx=max(mx,{(double)c[i]/C[i],i});
}
int l=language(mx.second);
C[l]++;
for(int i=0;i<100;i++){
k[l][E[i]]++;
}
for(int i=0;i<99;i++){
mpv[E[i]*66666+E[i+1]].push_back(l);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2712 ms |
12028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
2649 ms |
12132 KB |
Output is partially correct - 43.06% |