Submission #316399

#TimeUsernameProblemLanguageResultExecution timeMemory
316399juggernautHoliday (IOI14_holiday)C++14
23 / 100
5067 ms3008 KiB
#include"holiday.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; typedef long long ll; ll findMaxAttraction(int n,int start,int d,int attraction[]){ ll rs=0; for(ll i=0;i<=start;i++){ priority_queue<ll>q; ll sum=0; for(ll j=i;j<n;j++){ q.push((ll)-attraction[j]); sum+=(ll)attraction[j]; if(j<start)continue; ll rem=(ll)d-min(start+j-(i<<1ll),(j<<1ll)-start-i); while(!q.empty()&&q.size()>rem){ sum+=(ll)q.top(); q.pop(); } rs=max(rs,sum); } } return rs; }

Compilation message (stderr)

holiday.cpp: In function 'll findMaxAttraction(int, int, int, int*)':
holiday.cpp:19:39: warning: comparison of integer expressions of different signedness: 'std::priority_queue<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
   19 |             while(!q.empty()&&q.size()>rem){
      |                               ~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...