제출 #586567

#제출 시각아이디문제언어결과실행 시간메모리
586567SeDunion휴가 (IOI14_holiday)C++17
23 / 100
23 ms1108 KiB
#include"holiday.h" #include<algorithm> #include<iostream> #include<vector> using namespace std; using ll = long long; int cnt[111]; ll findMaxAttraction(int n, int start, int d, int attraction[]) { ll ans = 0; for (int i = 0 ; i < n ; ++ i) { cnt[attraction[i]]++; int x = d - i; ll cur = 0; for (int y = 100 ; y >= 0 ; -- y) { int q = min(cnt[y], x); x -= q; cur += q * y; } ans = max(ans, cur); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...