제출 #136090

#제출 시각아이디문제언어결과실행 시간메모리
136090arthurconmy휴가 (IOI14_holiday)C++14
23 / 100
20 ms2292 KiB
#include <bits/stdc++.h> #ifndef ARTHUR_LOCAL #include "holiday.h" #endif using namespace std; using ll=long long; ll findMaxAttraction(int n, int sta, int d, int A[]) { int ans=0; priority_queue<int> active; int active_sum=0; for(int i=0; i<n; i++) { active.push(-A[i]); active_sum += A[i]; while(int(active.size()) + i > d && !active.empty()) { active_sum += active.top(); active.pop(); } if(int(active.size()) + i <= d) ans = max(ans,active_sum); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...