제출 #897603

#제출 시각아이디문제언어결과실행 시간메모리
897603oblantis선물상자 (IOI15_boxes)C++17
10 / 100
0 ms348 KiB
#include "boxes.h" #include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #define all(v) v.begin(), v.end() #define pb push_back #define ss second #define ff first #define vt vector using namespace std; //using namespace __gnu_pbds; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, int> pdi; const ll inf = 1e18 + 10000; const int mod = 1e9+7; const int maxn = 1e5 + 12; long long delivery(int n, int k, int l, int p[]) { vi P((n + k - 1) / k * k); for(int i = 0; i < (n + k - 1) / k * k; i++){ P[i] = p[min(n - 1, i)]; } ll ret = 0, ter = 0; for(int i = 0; i < n; i += k){ ret += min(min(P[i + k - 1] * 2, (l - P[i]) * 2), l); } for(int i = 0; i < (n + k - 1) / k * k; i++){ P[i] = p[n - min(n - 1, i) - 1]; } for(int i = 0; i < n; i += k){ ter += min(min(P[i] * 2, (l - P[i + k - 1]) * 2), l); } return min(ret, ter); }
#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...