이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"holiday.h"
#include <bits/stdc++.h>
using namespace std;
const int kMax = 107;
int cnt[kMax];
long long findMaxAttraction(int n, int start, int d, int attraction[]){
long long ans = 0;
for(int dist = 0; dist < min(n, d); ++dist){
int rem = d - dist;
long long curr_ans = 0;
++cnt[attraction[dist]];
for(int i = kMax - 1; i >= 0; --i){
if(cnt[i] <= rem){
rem -= cnt[i];
curr_ans += i * cnt[i];
}
else{
curr_ans += i * rem;
break;
}
}
ans = max(ans, curr_ans);
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |