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<bits/stdc++.h>
using namespace std;
#include "grader.h"
#include "lang.h"
const int lang_cnt = 56;
const int char_cnt = (1<<16);
int app[char_cnt];
int vis[lang_cnt];
int total[lang_cnt][char_cnt];
int cnt;
void excerpt(int *E) {
map<int, int> mp;
for(int i = 0; i < 100; i++)mp[E[i]]++;
long double best = 0;
int pos = 0;
for(int i = 0; i < lang_cnt; i++){
if(!vis[i])continue;
long double sum = 0;
for(auto v: mp){
if(total[i][v.first])sum += (long double)v.second*total[i][v.first]*cnt/app[v.first];
}
if(sum > best){
best = sum;
pos = i;
}
}
int id = language(pos);
if(!vis[id])cnt += (vis[id] = 1);
for(auto v: mp){
if(!total[id][v.first])app[v.first]++;
total[id][v.first] += v.second;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |