# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
424425 | APROHACK | 휴가 (IOI14_holiday) | C++14 | 5052 ms | 1828 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"holiday.h"
#include <bits/stdc++.h>
#define PB push_back
#define F first
#define S second
using namespace std;
int att[100000];
long long int findMaxAttraction(int n, int start, int d, int attraction[]) {
////for(int i = 0 ; i < n ; i++)att[i]=attraction[i];
long long total = 0;
//segTree *st=new segTree(0, 101);
for(int i = 0 ; i <= d-1 && start+i<n; i++){
long long sum= 0;
priority_queue<long long>pq;
for(int j = start ; j<= start+i ; j++){
sum+=attraction[j];
pq.push(-attraction[j]);
}
long long dist=i;
if(d<=dist)break;
while(pq.size() > d - dist){
sum -= -pq.top();
pq.pop();
}
for(int j = 1 ; j<= (d-i) && (start-(j))>=0; j++){
//st->encender(att[i], true);
pq.push(-attraction[start-j]);
//total=max(total, st->query((d-i)));
dist=i*2+j;
if(d<=dist)break;
while(pq.size() > d - dist){
sum -= -pq.top();
pq.pop();
}
total=max(total, sum);
}
}
return total;
}
컴파일 시 표준 에러 (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... |