제출 #296255

#제출 시각아이디문제언어결과실행 시간메모리
296255arayi휴가 (IOI14_holiday)C++17
47 / 100
5052 ms3236 KiB
#include <bits/stdc++.h> #include "holiday.h" #define lli long long int using namespace std; long long int findMaxAttraction(int n, int st, int d, int a[]) { lli pat = 0; for(int l = 0; l <= st; ++l) { priority_queue<lli, vector<lli>, greater<lli> > q; lli sum = 0; for (int r = l; r < n; r++) { sum += a[r]; q.push(a[r]); int sm = min(abs(r - st), abs(l - st)) + r - l; sm = d - sm; if(sm < 0) continue; while(q.size() > sm) sum -= q.top(), q.pop(); pat = max(pat, sum); } } return pat; }

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

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:20:28: 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]
   20 |             while(q.size() > sm) sum -= q.top(), q.pop();
      |                   ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...