# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149593 | 2019-09-01T06:47:58 Z | Cafe Maru(#3599, bryan, pps789, kazel) | Crosses on the Grid (FXCUP4_cross) | C++17 | 5 ms | 384 KB |
#include "cross.h" #include<bits/stdc++.h> using namespace std; map<int,vector<int>> oi; long long SelectCross(int K, std::vector<int> I, std::vector<int> O) { int N = I.size(); for(int i=0;i<N;i++) { oi[-O[i]].push_back(I[i]); } int ans = 0; priority_queue<int> pq; for(auto& [z, s] : oi) { int x = -z; for(int i : s) { pq.push(-i); } while(pq.size() > K) pq.pop(); if (pq.size() == K) { int y = -pq.top(); int tmp = y*(2*x-y); if(tmp > ans) ans = tmp; } } return ans; }
Compilation message
# | 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 | - |