제출 #67278

#제출 시각아이디문제언어결과실행 시간메모리
67278theknife2001휴가 (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; }

컴파일 시 표준 에러 (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...