Submission #1032221

#TimeUsernameProblemLanguageResultExecution timeMemory
1032221tolbiHoliday (IOI14_holiday)C++17
23 / 100
5050 ms1964 KiB
#include"holiday.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long int findMaxAttraction(int n, int start, int d, int attraction[]) { ll ans = 0; for (int l = start; l >= 0; l--){ priority_queue<ll,vector<ll>,greater<ll>> pq; ll somma = 0; for (int i = l; i < start; i++){ pq.push(attraction[i]); somma+=attraction[i]; } for (int r = start; r < n; r++){ pq.push(attraction[r]); somma+=attraction[r]; ll mv = r-l+min(start-l,r-start); ll kal = d-mv; while (pq.size()>kal){ somma-=pq.top(); pq.pop(); } ans=max(ans,somma); } } return ans; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:19:29: 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 'll' {aka 'long long int'} [-Wsign-compare]
   19 |             while (pq.size()>kal){
      |                    ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...