이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
#define SZ 100
int has[56][65536];
template <class T> using Vec = std::vector<T>;
void excerpt(int *E) {
std::map<int, int> map;
for (int i = 0; i < SZ; ++i) {
map[E[i]] += 1;
}
Vec<std::pair<int, int>> vec;
for (const auto [x, y] : map) {
vec.emplace_back(y, x);
}
std::sort(vec.rbegin(), vec.rend());
Vec<int> cand(56);
std::iota(cand.begin(), cand.end(), 0);
int ret = 0;
for (const auto [y, x] : vec) {
Vec<int> next;
for (const auto t : cand) {
if (has[t][x]) {
next.push_back(t);
}
}
if (next.empty()) {
break;
}
cand = std::move(next);
}
int max = -1;
for (const auto t : cand) {
int cnt = 0;
for (const auto [x, y] : map) {
cnt += has[t][x];
}
if (max < cnt) {
max = cnt;
ret = t;
}
}
const int type = language(ret);
for (int i = 0; i < SZ; ++i) {
has[type][E[i]] += 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |