# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
586374 | LastRonin | 휴가 (IOI14_holiday) | C++14 | 5085 ms | 5332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"holiday.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
long long int findMaxAttraction(int n, int start, int d, int attraction[]) {
ll answ = 0;
for(int i = 0; i < n; i++) {
multiset<ll> a;
ll sum = 0;
for(int j = i; j < start; j++)
a.insert(attraction[j]), sum += attraction[j];
for(int j = start; j < n; j++) {
a.insert(attraction[j]);
sum += attraction[j];
int enrg = d - min(2 * (j - start) + (start - i), (j - start) + 2 * (start - i));
if(enrg < 0)break;
while(a.size() > enrg) {
sum -= *a.begin();
a.erase(a.begin());
}
answ = max(answ, sum);
}
}
return answ;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |