#include <bits/stdc++.h>
#include "grader.h"
//#include "lang.h"
using namespace std;
const int N = 60;
const int m = 100;
map<int, int> s[N];
int ss[N];
double t[N];
void excerpt(int *E)
{
//sort(E, E + m);
map<int, int> ys;
for (int i = 0; i < m; ++i)
ys[E[i]]++;
double minu = 1000000000;
int mini = 0;
for (int i = 0; i < 56; ++i)
{
double q = 0;
//for (auto it = s[i].begin(); it != s[i].end(); ++it)
// g.insert(it->first);
q += t[i];
for (auto it = ys.begin(); it != ys.end(); ++it)
{
int x = it->first;
double u1 = 0;
if (ys.find(x) != ys.end())
u1 = ys[x] / (double)m;
double u2 = 0;
if (s[i].find(x) != s[i].end())
u2 = s[i][x] / (double)ss[i];
q += abs(u1 - u2);
q -= u2;
if (s[i].find(x) == s[i].end())
q += 5;
}
if (q < minu)
{
minu = q;
mini = i;
}
}
int u = language(mini);
ss[u] += m;
for (int j = 0; j < m; ++j)
{
s[u][E[j]]++;
}
t[u] = 0;
for (auto it = s[u].begin(); it != s[u].end(); ++it)
{
t[u] += (it->second / (double)ss[u]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3145 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
3120 ms |
1016 KB |
Output is partially correct - 76.02% |