제출 #1064176

#제출 시각아이디문제언어결과실행 시간메모리
1064176VMaksimoski008휴가 (IOI14_holiday)C++17
23 / 100
11 ms2160 KiB
#include "holiday.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll findMaxAttraction(int n, int start, int d, int attraction[]) { if(start == 0) { ll ans = 0, sum = 0; priority_queue<ll, vector<ll>, greater<ll> > pq; for(int i=0; i<min(d, n); i++) { pq.push(attraction[i]); sum += attraction[i]; while(pq.size() > d - i) { sum -= pq.top(); pq.pop(); } ans = max(ans, sum); } return ans; } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

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