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 <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 = 0.3L * (cnt_all[id][p.first] + 1) / (sum[id] + 2000);
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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |