Submission #359206

# Submission time Handle Problem Language Result Execution time Memory
359206 2021-01-26T12:28:46 Z mohamedsobhi777 Languages (IOI10_languages) C++14
67 / 100
516 ms 3180 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;
int freq[66000];

long long calc(int lan)
{
       for (int i = 0; i < 100; ++i)
              freq[glo[i]] = 0;
       long long ret = 0;
       for (int i = 0; i < 100; ++i)
       {
              ret += ++freq[glo[i]] * lang[lan][glo[i]];
       }
       return ret;
}

void excerpt(int *ex)
{
       glo = ex;
       long long simi = 0;
       int wnr = 0;
       for (int i = 0; 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]]++;
              lang[z][ex[i]] = min(lang[z][ex[i]] + 1, 15);
       }
}
# Verdict Execution time Memory Grader output
1 Correct 515 ms 3180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 516 ms 3052 KB Output is partially correct - 62.10%