제출 #1203388

#제출 시각아이디문제언어결과실행 시간메모리
1203388AMel0n선물상자 (IOI15_boxes)C++20
0 / 100
0 ms328 KiB
// doesnt calc circles #include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(i,N) for(ll i = 0; i < N; i++) #define all(x) (x).begin(), (x).end() // #define F first // #define S second #include "boxes.h" ll delivery(int N, int K, int L, int p[]) { // never optimal to take more than one full circle vector<ll> dp(N); ll mxL= 0, mxR = 0; FOR(i, N) { if (p[i] <= L/2) { if (i-K >= 0) dp[i] = dp[i-K] + 2*p[i]; else dp[i] = 2*p[i]; mxL = max(mxL, dp[i]); } else { if (i+K <= N) dp[i] = dp[(i+K)%N] + 2*(L-p[i]); else dp[i] = 2*(L-p[i]); mxR = max(mxR, dp[i]); } } return mxL+mxR; }
#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...