제출 #359166

#제출 시각아이디문제언어결과실행 시간메모리
359166mohamedsobhi777Languages (IOI10_languages)C++14
0 / 100
1 ms492 KiB
#include <bits/stdc++.h>
#include "lang.h"
#include "grader.h"

using namespace std;

const int Lang = 56;

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

long long calc(int lan)
{
       return rand() % 1000000000;
       for (int i = 0; i < 100; ++i)
              freq[glo[i]] = 0;
       for (int i = 0; i < 100; ++i)
              freq[glo[i]]++;
       long long ret = 0;
       for (int i = 1; 10 * i < 65535; ++i)
       {
              long long diff = lang[lan][i] - freq[i];
              ret += diff * diff;
       }
       return ret;
}

void excerpt(int *ex)
{
       glo = ex;
       long long simi = 1e18;
       int wnr = 0;
       for (int i = 1; i <= Lang; ++i)
       {
              double y = calc(i);
              if (y < simi)
              {
                     simi = y;
                     wnr = i;
              }
       }
       assert(wnr);
       int z = language(wnr);
       for (int i = 0; i < 100; ++i)
       {
              lang[z][ex[i]]++;
       }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...