Submission #130912

#TimeUsernameProblemLanguageResultExecution timeMemory
130912antimirageBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
2 ms504 KiB
#include "boxes.h" //#include "grader.cpp" #include <bits/stdc++.h> #define fr first #define sc second #define mk make_pair #define pb push_back #define all(s) s.begin(), s.end() using namespace std; const int N = 1e7 + 5; long long dp[N]; long long delivery(int n, int k, int l, int pos[]) { for (int i = 0; i < n; i++) { if (i < k) { dp[i] = min( pos[i] * 2, min( l, (l - pos[0]) * 2 ) ); } else { dp[i] = dp[i - k] + min( pos[i] * 2, min( l, (l - pos[i - k + 1]) * 2 ) ); } } return dp[n - 1]; }
#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...