#include "cross.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
vector<pair<int, int> > cr;
long long res = 0;
priority_queue<long long> pq;
long long SelectCross(int K, std::vector<int> I, std::vector<int> O) {
int n = I.size();
for(int i = 0; i < n; i++)
cr.push_back({I[i], O[i]});
sort(cr.rbegin(), cr.rend());
for(int i = 0; i < n; i++){
pq.push(-cr[i].ss);
if(i >= K) pq.pop();
if(i >= K - 1){
res = max(res, -pq.top() * cr[i].ff * 2 - cr[i].ff * cr[i].ff);
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |