제출 #1007407

#제출 시각아이디문제언어결과실행 시간메모리
1007407NintsiChkhaidze휴가 (IOI14_holiday)C++17
7 / 100
5083 ms5468 KiB
#include"holiday.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e5 + 3; long long int findMaxAttraction(int n, int start, int d, int attraction[]) { ll ans = 0; for (int L = 0; L <= start; L++){ for (int R = start; R < n; R++){ multiset <int> st; ll sum = 0; for (int i = L; i <= R; i++) st.insert(attraction[i]),sum += attraction[i]; int cnt = d - (R - L) - min(start - L,R - start); if (cnt <= 0) continue; while (st.size() > cnt){ sum -= *st.begin(); st.erase(st.begin()); } ans=max(ans,sum); } } return ans; }

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

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