# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
793473 | Markynoodle | Boxes with souvenirs (IOI15_boxes) | C++17 | 2 ms | 304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll delivery(int n, int k, int l, int posin[]){
vector<int> pos(n);
for(int i =0; i<n ;i++){
pos[i] = posin[i];
}
if(k == -1){
ll s = 0;
for(auto k : pos)s += min(k*2, (l - k)*2);
return s;
}
ll sol = 1e16;
sort(pos.begin(), pos.end());
for(int i = 0; i<=n; i++){
ll tempsol = 0;
int cnt = 0;
int cycle = 0;
while(cnt < i){
if(cnt + 1 == i){
tempsol += pos[cnt];
tempsol += min(pos[cnt], l - pos[cnt]);
break;
}
if(cycle == k){
tempsol += pos[cnt];
tempsol += min(pos[cnt], l - pos[cnt]);
cycle = 0;
}
cnt++;
cycle++;
}
//cout<<tempsol<<" ";
cnt = n-1;
cycle = 0;
while(cnt >= i){
if(cnt == i){
tempsol += l - pos[cnt];
tempsol += min(pos[cnt], l - pos[cnt]);
break;
}
if(cycle == k){
tempsol += l - pos[cnt];
tempsol += min(pos[cnt], l - pos[cnt]);
cycle = 0;
}
cnt--;
cycle++;
}
sol = min(sol, tempsol);
//cout<<tempsol<<"_";
}
return sol;
}
컴파일 시 표준 에러 (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... |