# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587041 | krit3379 | Holiday (IOI14_holiday) | C++17 | 17 ms | 2048 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include"holiday.h"
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define N 100005
long long ans;
long long int findMaxAttraction(int n,int st,int d,int a[]){
int i;
if(n<=3000){
}
else if(st==0){
long long sum=0;
priority_queue<long long,vector<long long>,greater<long long>> q;
for(i=0;i<n;i++){
q.push(a[i]);
sum+=a[i];
while(q.size()>d-i){
sum-=q.top();
q.pop();
}
ans=max(ans,sum);
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |