Submission #1018093

#TimeUsernameProblemLanguageResultExecution timeMemory
1018093socpiteLanguages (IOI10_languages)C++14
45 / 100
267 ms8272 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...