Submission #67278

#TimeUsernameProblemLanguageResultExecution timeMemory
67278theknife2001Holiday (IOI14_holiday)C++17
0 / 100
21 ms3688 KiB
#include"holiday.h" #include <bits/stdc++.h> using namespace std; priority_queue < int , vector < int > , greater < int > > pq; long long int findMaxAttraction(int n, int start, int d, int a[]) { int x=(d-1)/2; int ans=0; for(int i=0;i<x;i++) { pq.push(a[i]); ans+=a[i]; } int fi,se; fi=se=-1; for(int i=x;i<n;i++) { if(fi!=-1&&pq.size()) { fi=pq.top(); pq.pop(); } if(se!=-1&&pq.size()) { se=pq.top(); pq.pop(); } if(a[i]>fi+se) { ans+=a[i]-fi-se; fi=se=-1; } } return ans; }

Compilation message (stderr)

grader.cpp: In function 'int main()':
grader.cpp:7:12: warning: variable 'n_s' set but not used [-Wunused-but-set-variable]
     int i, n_s;
            ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...