Submission #296255

#TimeUsernameProblemLanguageResultExecution timeMemory
296255arayiHoliday (IOI14_holiday)C++17
47 / 100
5052 ms3236 KiB
#include <bits/stdc++.h> #include "holiday.h" #define lli long long int using namespace std; long long int findMaxAttraction(int n, int st, int d, int a[]) { lli pat = 0; for(int l = 0; l <= st; ++l) { priority_queue<lli, vector<lli>, greater<lli> > q; lli sum = 0; for (int r = l; r < n; r++) { sum += a[r]; q.push(a[r]); int sm = min(abs(r - st), abs(l - st)) + r - l; sm = d - sm; if(sm < 0) continue; while(q.size() > sm) sum -= q.top(), q.pop(); pat = max(pat, sum); } } return pat; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:20:28: warning: comparison of integer expressions of different signedness: 'std::priority_queue<long long int, std::vector<long long int>, std::greater<long long int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |             while(q.size() > sm) sum -= q.top(), q.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...