Submission #316395

#TimeUsernameProblemLanguageResultExecution timeMemory
316395juggernaut휴가 (IOI14_holiday)C++14
23 / 100
5090 ms2624 KiB
#include"holiday.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; long long int findMaxAttraction(int n,int start,int d,int attraction[]){ long long rs=0; for(int i=0;i<=start;i++){ priority_queue<int>q; long long sum=0; for(int j=i;j<n;j++){ q.push(-attraction[j]); sum+=attraction[j]; int rem=d-min(start+j-(i<<1),(j<<1)-start-i); while(q.size()>rem){ sum+=q.top(); q.pop(); } rs=max(rs,sum); } } return rs; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:17:27: warning: comparison of integer expressions of different signedness: 'std::priority_queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |             while(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...