# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
271049 |
2020-08-18T04:32:03 Z |
TMJN |
Languages (IOI10_languages) |
C++17 |
|
8542 ms |
134544 KB |
#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<pair<int,int>,vector<int>>mpv;
map<pair<int,pair<int,int>>,vector<int>>mppv;
map<pair<int,pair<int,pair<int,int>>>,vector<int>>mpppv;
map<pair<int,pair<int,pair<int,pair<int,int>>>>,vector<int>>mppppv;
int C[56];
void excerpt(int *E) {
pair<double,int>mx={0,0};
long long 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],E[i+1]}]){
c[j]+=1000;
}
}
for(int i=0;i<98;i++){
for(int j:mppv[{E[i],{E[i+1],E[i+2]}}]){
c[j]+=1000000;
}
}
for(int i=0;i<97;i++){
for(int j:mpppv[{E[i],{E[i+1],{E[i+2],E[i+3]}}}]){
c[j]+=1000000000;
}
}
for(int i=0;i<97;i++){
for(int j:mppppv[{E[i],{E[i+1],{E[i+2],{E[i+3],E[i+4]}}}}]){
c[j]+=1000000000000;
}
}
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],E[i+1]}].push_back(l);
}
for(int i=0;i<98;i++){
mppv[{E[i],{E[i+1],E[i+2]}}].push_back(l);
}
for(int i=0;i<97;i++){
mpppv[{E[i],{E[i+1],{E[i+2],E[i+3]}}}].push_back(l);
}
for(int i=0;i<96;i++){
mppppv[{E[i],{E[i+1],{E[i+2],{E[i+3],E[i+4]}}}}].push_back(l);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8023 ms |
134544 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
8542 ms |
134520 KB |
Output is partially correct - 84.84% |