제출 #589402

#제출 시각아이디문제언어결과실행 시간메모리
589402yutabi휴가 (IOI14_holiday)C++14
0 / 100
5050 ms3008 KiB
#include"holiday.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll subtask(int n, int start, int d, int attraction[]) { ll ans=attraction[0]; multiset <int> st; st.insert(-attraction[0]); ll sum=attraction[0]; for(int i=1;i<n;i++) { sum+=attraction[i]; st.insert(-attraction[i]); ll res=0; int j=0; for(multiset <int>::iterator it=st.begin();j<d-i && it!=st.end();j++,it++) { res+=-(*it); } //printf("%lld %lld\n",sum,res); ans=max(ans,res); } return ans; } long long int findMaxAttraction(int n, int start, int d, int attraction[]) { if(d==0) { return 0; } if(start==0) { return subtask(n,start,d,attraction); } assert(0); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...