Submission #282320

#TimeUsernameProblemLanguageResultExecution timeMemory
282320KastandaLanguages (IOI10_languages)C++11
95 / 100
888 ms19808 KiB
// M #include<bits/stdc++.h> #include "grader.h" using namespace std; typedef unsigned long long ll; const int N = 56, K = 6, 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 = i; 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 = i; j < i + K; j ++) hsh = hsh * Base + E[j]; MP[hsh] = Lang; } return ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...