제출 #1064394

#제출 시각아이디문제언어결과실행 시간메모리
1064394YassirSalama휴가 (IOI14_holiday)C++17
23 / 100
25 ms2140 KiB
#include"holiday.h" #include<bits/stdc++.h> using namespace std; #define ll long long long long int findMaxAttraction(int n, int start, int d, int v[]) { ll ans = 0; int cnt[101]; memset(cnt,0,sizeof(cnt)); for(int i=0;i<n;i++){ cnt[v[i]]++; ll val=0; ll cost=d-i; for(int i=100;i>=0;i--){ ll a=cnt[i]; a=min(a,cost); cost-=a; val+=i*a; } ans=max(ans,val); } 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...