Submission #282314

# Submission time Handle Problem Language Result Execution time Memory
282314 2020-08-24T09:46:52 Z Kastanda Languages (IOI10_languages) C++11
95 / 100
1014 ms 25592 KB
// M
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
typedef unsigned long long ll;
const int N = 56, K = 4, Base = 1 << 16;
int C[N];
map < ll , int > MP;
void excerpt(int * E)
{
        memset(C, 0, sizeof(C));
        for (int i = 0; i + K <= 100; i ++)
        {
                ll hsh = 0;
                for (int j = 0; j < i + K; j ++)
                        hsh = hsh * Base + E[j];
                if (MP.count(hsh))
                        C[MP[hsh]] ++;
        }

        int Lang = 0;
        for (int i = 0; i < N; i ++)
                if (C[i] > C[Lang])
                        Lang = i;

        Lang = language(Lang);

        for (int i = 0; i + K <= 100; i ++)
        {
                ll hsh = 0;
                for (int j = 0; j < i + K; j ++)
                        hsh = hsh * Base + E[j];
                MP[hsh] = Lang;
        }
        return ;
}
# Verdict Execution time Memory Grader output
1 Correct 981 ms 25592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 1014 ms 25380 KB Output is partially correct - 86.70%