# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
915310 | 2024-01-23T16:26:38 Z | Trisanu_Das | Holiday (IOI14_holiday) | C++17 | 27 ms | 6224 KB |
#include <bits/stdc++.h> #include "holiday.h" using namespace std; long long findMaxAttraction(int n, int s, int k, int a[]){ long long ans = 0; if(s == 0){ multiset<int> ss; long long curr; for(int j = 0; j < min(n, k - 1); j++){ ss.insert(a[j]); curr += a[j]; while(j + ss.size() > k){ curr -= *ss.begin(); ss.erase(ss.begin()); } ans = max(ans, curr); } return ans; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 604 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 22 ms | 5468 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 860 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 27 ms | 6224 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |