Submission #572528

#TimeUsernameProblemLanguageResultExecution timeMemory
572528Leo121Holiday (IOI14_holiday)C++14
23 / 100
16 ms1564 KiB
#include <bits/stdc++.h> #include"holiday.h" #define for0(i, n) for(int i = 0; i < int(n); ++ i) using namespace std; typedef long long ll; priority_queue<int> pq; long long int findMaxAttraction(int n, int start, int d, int attraction[]) { ll res = 0, aux = 0; int cantidad, aux2; if(!start){ for0(i, n){ aux += (ll) attraction[i]; pq.push(-1 * attraction[i]); cantidad = d - i; while((int) pq.size() > cantidad){ aux2 = pq.top(); pq.pop(); aux -= (ll) aux2 * -1LL; } res = max(res, aux); } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...