Submission #149083

#TimeUsernameProblemLanguageResultExecution timeMemory
149083お前はもう死んでいる (#200)Crosses on the Grid (FXCUP4_cross)C++17
0 / 100
5 ms384 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...