Submission #915312

#TimeUsernameProblemLanguageResultExecution timeMemory
915312Trisanu_DasHoliday (IOI14_holiday)C++17
23 / 100
24 ms6236 KiB
#include <bits/stdc++.h> #include "holiday.h" using namespace std; long long findMaxAttraction(int n, int s, int d, int a[]) { multiset<int> ss; long long ans = 0, curr = 0; for (int j=0; j < min(n,d - 1); j++) { ss.insert(a[j]); curr += a[j]; while (j + ss.size() > d) { curr -= *begin(ss); ss.erase(begin(ss)); } ans = max(ans, curr); } return ans; }

Compilation message (stderr)

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