# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
832992 | samgiz | 십자가 놓기 (FXCUP4_cross) | C++17 | 68 ms | 14584 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct Cross {
uint64_t inner, outer;
};
uint64_t SelectCross(int32_t K, vector<int32_t> I, vector<int32_t> O) {
const uint32_t N = I.size();
vector<Cross> crosses(N);
for (uint32_t i = 0; i < N; i++) {
crosses[i].inner = I[i];
crosses[i].outer = O[i];
}
sort(crosses.begin(), crosses.end(), [](Cross a, Cross b) {
return a.inner > b.inner;
});
// Comparator for priority queue that will force the smallest outer to the top
const auto cmp = [](Cross a, Cross b) {
return a.outer > b.outer;
};
// Priority queue that keeps the k Cross elements with the largest
// outer diameter out of the ones that we have processed so far.
// And allows popping the one with the smallest outer diameter.
priority_queue<Cross, vector<Cross>, decltype(cmp)> q(cmp);
// Keep track of the best area so far
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |