제출 #1019764

#제출 시각아이디문제언어결과실행 시간메모리
1019764NValchanov휴가 (IOI14_holiday)C++17
23 / 100
123 ms860 KiB
#include <bits/stdc++.h> #include "holiday.h" using namespace std; typedef long long ll; ll start0(int n, int d, int a[]) { ll ans = 0; map < ll, ll > m; for(int i = 0; i < n; i++) { m[a[i]]++; ll ost = d - i; ll sum = 0; for(ll val = 100; val >= 1; val--) { if(ost == 0) break; ll cur = min(ost, m[val]); sum += cur * val; ost -= cur; } ans = max(ans, sum); } return ans; } ll slow(int n, int start, int d, int a[]) { return -1; } long long int findMaxAttraction(int n, int start, int d, int a[]) { if(start == 0) return start0(n, d, a); else return slow(n, start, d, a); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...