제출 #572528

#제출 시각아이디문제언어결과실행 시간메모리
572528Leo121휴가 (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...