# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148491 | 강력한 한방 필살기 (#200) | Crosses on the Grid (FXCUP4_cross) | C++17 | 118 ms | 5740 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cross.h"
#include <bits/stdc++.h>
#define sz(v) ((int)(v).size())
using namespace std;
using pi = pair<int, int>;
using lint = long long;
const int MAXN = 200005;
int N;
lint X[MAXN], Y[MAXN];
lint dp[21][MAXN];
lint func(lint X, lint Y){
return 2 * X * Y - X * X;
}
long long SelectCross(int K, std::vector<int> I, std::vector<int> O) {
if(K > 20) return 69;
N = I.size();
vector<pi> v, A;
for(int i=0; i<N; i++) v.emplace_back(I[i], O[i]);
sort(v.begin(), v.end());
reverse(v.begin(), v.end());
priority_queue<int, vector<int>, greater<int> > pq;
lint ret = 0;
for(int i=0; i<sz(v); ){
int e = i;
while(e < sz(v) && v[i].first == v[e].first) e++;
for(int j=i; j<e; j++) pq.push(v[j].second);
while(sz(pq) > K) pq.pop();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |