제출 #316255

#제출 시각아이디문제언어결과실행 시간메모리
316255qpwoeirut휴가 (IOI14_holiday)C++17
23 / 100
5056 ms6264 KiB
#include <bits/stdc++.h> #include "holiday.h" using namespace std; typedef long long ll; ll findMaxAttraction(int n, int start, int d, int attraction[]) { ll ans = 0; for (int i=0; i<=start; ++i) { multiset<ll> in; ll sum = 0; for (int j=i; j<n; ++j) { in.insert(attraction[j]); sum += attraction[j]; if (j >= start) { ll travel = min((start - i) + (j - i), (j - start) + (j - i)); ll rem = d - travel; while (in.size() > rem) { sum -= *in.begin(); in.erase(in.begin()); } //cerr << "i,j,sum,rem: " << i << ' '<< j << ' ' << sum << ' ' << rem << endl; //cerr << "in:"; for (auto it=in.begin(); it!=in.end(); ++it) { cerr << ' ' << *it; } cerr << endl; ans = max(ans, sum); } } } return ans; }

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

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