제출 #1327021

#제출 시각아이디문제언어결과실행 시간메모리
1327021apxoLanguages (IOI10_languages)C++20
49 / 100
1587 ms218308 KiB
#include "bits/stdc++.h" using namespace std; #ifdef duc_debug #include "bits/debug.h" #else #define debug(...) #include "grader.h" #endif const int mod = 999983; const int base = 65536; int a[99][4]; int d[56][mod]; int weight[] = {1, 2, 3, 4}; void excerpt(int *E) { for (int i = 0; i < 97; ++i) { for (int j = 0; j < 4; ++j) { a[i][j] = (1ll * (j ? a[i][j - 1] : 0) * base % mod + E[i + j]) % mod; } } int match = 0, pos = 0; for (int i = 0; i < 56; ++i) { int cur = 0; for (int j = 0; j < 97; ++j) { for (int k = 0; k < 4; ++k) { cur += d[i][a[j][k]] * weight[k]; } } if (match < cur) { match = cur, pos = i; } } int L = language(pos); for (int i = 0; i < 97; ++i) { for (int j = 0; j < 4; ++j) { ++d[L][a[i][j]]; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...