Submission #758663

#TimeUsernameProblemLanguageResultExecution timeMemory
758663SanguineChameleonLanguages (IOI10_languages)C++17
78 / 100
618 ms11316 KiB
#include <stdlib.h> #include <stdio.h> #include "grader.h" #include "lang.h" #define SZ 100 #include <bits/stdc++.h> using namespace std; map<int, int> cnt_all[56]; map<int, int> cnt_cur; int sum[56]; long double calc(int id) { long double res = 0.0L; for (auto p: cnt_cur) { long double exp = 1.0L * (cnt_all[id][p.first] + 1) / (sum[id] + 10000); int obs = p.second; res += (exp - obs) * (exp - obs) / exp; } return res; } void excerpt(int *E) { cnt_cur.clear(); for (int i = 0; i < 100; i++) { cnt_cur[E[i]]++; } pair<long double, int> best = make_pair(1e18L, -1); for (int i = 0; i < 56; i++) { best = min(best, make_pair(calc(i), i)); } int id = language(best.second); for (int i = 0; i < 100; i++) { cnt_all[id][E[i]]++; } sum[id] += 100; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...