# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
363599 | Sparky_09 | 선물상자 (IOI15_boxes) | C++17 | 143 ms | 235176 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define trav(a, x) for(auto& a : x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
void usaco(string s){
freopen((s+".in").c_str(), "r", stdin);
freopen((s+".out").c_str(), "w", stdout);
}
ll maxn = 1e7+1000;
vector<ll> pre(maxn+2, 0), suf(maxn+2, 0), pos1(maxn+2);
int delivery(int n, int k, int l, int pos[]){
for(int i = 0; i < n; i++) pos1[i] = pos[i];
for(int i = 0; i < n; i++){
pre[i] = (i>=k?pre[i-k]+min(l,2*pos[i]):min(l,2*pos[i]));
}
for(int i = n-1; i >= 0; i--){
suf[i] = (i<=n-1-k?suf[i+k]+min(l,2*(l-pos[i])):min(l,2*(l-pos[i])));
}
ll ans = min(pre[0],suf[0]);
for(int i = 0; i < n; i++){
ans = min(ans, pre[i] + suf[i+1]);
}
return ans;
}
컴파일 시 표준 에러 (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... |