Submission #1007400

#TimeUsernameProblemLanguageResultExecution timeMemory
1007400NintsiChkhaidzeHoliday (IOI14_holiday)C++17
23 / 100
24 ms6296 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 sum = 0,ans = 0; multiset <int> st; for (int i = 0; i < n; i++){ st.insert(attraction[i]); sum += attraction[i]; while (st.size() > max(0,d - i)){ sum -= *st.begin(); st.erase(st.begin()); } ans=max(ans,sum); } return ans; }

Compilation message (stderr)

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:15:23: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'const int' [-Wsign-compare]
   15 |      while (st.size() > max(0,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...