Submission #866926

#TimeUsernameProblemLanguageResultExecution timeMemory
866926Onur_IlgazHoliday (IOI14_holiday)C++17
23 / 100
24 ms6236 KiB
#include"holiday.h" #include <bits/stdc++.h> #define int long long #define inf ((int)1e18) using namespace std; int findMaxAttraction(int32_t n, int32_t start, int32_t d, int32_t arr[]) { multiset <int> st; int sum = 0, mx = 0; for(int i = 0; i < n; i++, d--) { st.insert(arr[i]); sum += arr[i]; while(st.size() > d) { sum -= *st.begin(); st.erase(st.begin()); } mx = max(mx, sum); } return mx; return 0; }

Compilation message (stderr)

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