Submission #217244

#TimeUsernameProblemLanguageResultExecution timeMemory
217244DystoriaXHoliday (IOI14_holiday)C++14
0 / 100
22 ms3204 KiB
#include"holiday.h" #include <bits/stdc++.h> using namespace std; long long int ans, sum = 0; priority_queue<int, vector<int>, greater<int> > pq; long long int findMaxAttraction(int n, int start, int d, int attraction[]) { for(int i = 0; i <= d; i++){ sum += attraction[i]; pq.push(attraction[i]); while(pq.size() > d - i) sum -= pq.top(), pq.pop(); ans = max(ans, sum); } return ans; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:15:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   while(pq.size() > d - i) sum -= pq.top(), pq.pop();
         ~~~~~~~~~~^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...