Submission #359162

# Submission time Handle Problem Language Result Execution time Memory
359162 2021-01-26T11:56:13 Z mohamedsobhi777 Languages (IOI10_languages) C++14
0 / 100
10000 ms 3600 KB
#include <bits/stdc++.h>
#include "lang.h"
#include "grader.h"

using namespace std;

const int Lang = 56;

int lang[Lang + 1][66000];
int *glo;

double calc(int lan)
{
       map<int, int> mp;
       for (int i = 0; i < 100; ++i)
              mp[glo[i]]++;
       double ret = 0;
       for (int i = 1; i < 65535; ++i)
       {
              double diff = lang[lan][i] - mp[i];
              ret += diff * diff;
       }
       return ret;
}

void excerpt(int *ex)
{
       glo = ex;
       double simi = 1e18;
       int wnr = 0;
       for (int i = 1; i <= Lang; ++i)
       {
              double y = calc(i);
              if (y < simi)
              {
                     simi = y;
                     wnr = i;
              }
       }
       int z = language(wnr);
       for (int i = 0; i < 100; ++i)
       {
              lang[z][ex[i]]++;
       }
}
# Verdict Execution time Memory Grader output
1 Execution timed out 10077 ms 3564 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10077 ms 3600 KB Time limit exceeded