# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
425350 | APROHACK | 선물상자 (IOI15_boxes) | C++14 | 1 ms | 204 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "boxes.h"
#define PB push_back
#define F first
#define S second
using namespace std;
pair<long long, long long>teams[10000002];
int kt, lt, n;
int dp(int poscur, int ksobrante){
return 0;
}
long long delivery(int N, int K, int L, int p[]) {
int ant = p[0], rep = 1, pointer = 0;
kt=K, n = N, lt = L;
for(int i = 1 ; i < N ; i++){
if(p[i]!=ant){
teams[pointer++]={ant, rep};
rep=1;
}else rep++;
ant=p[i];
}
int mx=L/2, temp;
long long sm = 0;
for(int i = 0 ; i < pointer ; i++){
if(teams[i].F>mx){
temp=i;
break;
}
sm+=teams[i].S*2*teams[i].F;
}
for(int i = pointer-1 ; i >= temp ; i--){
sm+=teams[i].S*2*(L-teams[i].F);
}
return sm;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |