Submission #39634

#TimeUsernameProblemLanguageResultExecution timeMemory
39634baactreeLanguages (IOI10_languages)C++14
100 / 100
5750 ms24696 KiB
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "grader.h" #include "lang.h" #include <iostream> #include <unordered_map> using namespace std; #define SZ 100 typedef long long ll; int cnt[1 << 6][1 << 16]; unordered_map<ll,int> hcnt[1 << 6]; int vote[1 << 6]; void excerpt(int *E) { for (int i = 0; i < 56; i++){ vote[i] = 0; for (int j = 0; j < SZ; j++){ if (cnt[i][E[j]]) vote[i]++; if (j > 2){ ll h = E[j] + ((ll)E[j - 1] << 16) + ((ll)E[j - 2] << 32) + ((ll)E[j - 3] << 48); if (hcnt[i].count(h)) vote[i]++; } } } int mm = 0; int ans = 0; for (int i = 0; i < 56; i++){ if (mm < vote[i]){ mm = vote[i]; ans = i; } } int now; now = language(ans); for (int i = 0; i < SZ; i++){ cnt[now][E[i]]++; if (i > 2){ ll h = E[i] + ((ll)E[i - 1] << 16) + ((ll)E[i - 2] << 32) + ((ll)E[i - 3] << 48); hcnt[now][h]++; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...