제출 #127252

#제출 시각아이디문제언어결과실행 시간메모리
127252ekrem선물상자 (IOI15_boxes)C++98
10 / 100
5 ms504 KiB
#include "boxes.h" #include <bits/stdc++.h> #define st first #define nd second #define mp make_pair #define pb push_back #define sol (k+k) #define sag (k+k+1) #define orta ((bas+son)/2) #define coc g[node][i] #define mod 1000000007 #define inf 1000000009 #define N 1000005 using namespace std; typedef long long ll; typedef pair < int , int > ii; ll cvp, bas[N], son[N]; ll delivery(int n, int k, int l, int p[]) { for(int i = 0; i < n; i++) bas[i] = (i >= k) ? bas[i - k] + p[i]*2 : p[i]*2; for(int i = n - 1; i >= 0; i--) son[i] = (n - i > k) ? son[i + k] + (l - p[i])*2 : (l - p[i])*2; cvp = son[0]; for(int i = -1; i < n; i++) for(int j = i + 1; j <= n; j++) cvp = min(cvp, ((i>=0)?bas[i]:0) + son[j] + (j - i - 1 + k - 1)/k*l); return cvp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...