제출 #1045299

#제출 시각아이디문제언어결과실행 시간메모리
1045299ArthuroWich휴가 (IOI14_holiday)C++17
47 / 100
5092 ms5488 KiB
#include "holiday.h" #include<bits/stdc++.h> using namespace std; #define int long long int int findMaxAttraction(int32_t n, int32_t st, int32_t d, int32_t at[]) { int ans = 0; for (int l = st; l >= 0; l--) { int co = 0, k; multiset<int> s; if (st-l > d) { break; } for (int i = st; i >= l; i--) { co += at[i]; s.insert(at[i]); } k = d-(st-l); while(s.size() > k) { co -= *s.begin(); s.erase(s.begin()); } ans = max(ans, co); for (int r = st+1; r < n; r++) { if (st-l+r-st+min(r-st,st-l) > d) { break; } int k = d-(st-l+r-st+min(r-st,st-l)); s.insert(at[r]); co += at[r]; while(s.size() > k) { co -= *s.begin(); s.erase(s.begin()); } ans = max(ans, co); } } return ans; }

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

holiday.cpp: In function 'long long int findMaxAttraction(int32_t, int32_t, int32_t, int32_t*)':
holiday.cpp:18:24: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   18 |         while(s.size() > k) {
      |               ~~~~~~~~~^~~
holiday.cpp:30:28: warning: comparison of integer expressions of different signedness: 'std::multiset<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   30 |             while(s.size() > k) {
      |                   ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...