# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
339527 | 2020-12-25T15:22:34 Z | bigDuck | 선물상자 (IOI15_boxes) | C++14 | 1 ms | 384 KB |
#include "boxes.h" #include<bits/stdc++.h> using namespace std; #define INIT ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define mp make_pair #define pb push_back #define ft first #define sc second #define ll long long #define pii pair<int, int> #define count_bits __builtin_popcount int p1[10000010], p2[10000010]; long long delivery(int N, int K, int L, int p[]) { int mn1=0; int mn2=0; int n=N, k=K, l=L; int ac=k; int cr=0; for(int i=0; i<n; i++){ ac--; if(ac==0){ cr=cr+p[i]*2; p1[i]=cr; ac=k; } else{ p1[i]=cr+p[i]*2; } } cr=0; ac=k; for(int i=n; i>=0; i--){ ac--; if(ac==0){ cr=cr+p[i]*2; p2[i]=cr; ac=k; } else{ p2[i]=cr+p[i]*2; } } int mn=1e18; for(int i=0; i<n; i++){ mn=min(p1[i]+p2[i+1], mn); } for(int i=k-1; i<n; i++){ if( (i-k)>=0 ){ mn=min(p2[i+1]+p1[i-k]+l, mn); } else{ mn=min(p2[i+1]+l, mn); } } return mn; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |