제출 #316409

#제출 시각아이디문제언어결과실행 시간메모리
316409juggernaut휴가 (IOI14_holiday)C++14
47 / 100
5065 ms1996 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(int i=0;i<=start;i++){ priority_queue<int>q; ll sum=0; for(int j=i;j<n;j++){ q.push(-attraction[j]); sum+=(ll)attraction[j]; int rem=d-min((start-i)+(j-i),(j-start)+(j-i)); if(rem<1||j<start)continue; while(!q.empty()&&q.size()>rem){ sum+=(ll)q.top(); q.pop(); } rs=max(rs,sum); } } return rs; } /* 5 2 7 10 2 20 30 1 */

컴파일 시 표준 에러 (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<int>::size_type' {aka 'long unsigned int'} and '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...