Submission #430832

#TimeUsernameProblemLanguageResultExecution timeMemory
430832Emin2004Boxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms204 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define endl '\n' #define pii pair <int, int> #define pb push_back #define F first #define S second #define ll long long #define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define M_PI 3.14159265358979323846 const int N = 200005; const int mod = 1e9 + 7; long long delivery(int n, int k, int l, int p[]) { if(k == 1){ ll ans = 0; for(int i = 0; i < n; i++){ ans += min(p[i], l - p[i]); } return ans * 2; } if(k == n){ ll ans = l; for(int i = 1; i < n; i++){ ll cur = (p[i - 1] + (n - p[i])); ans = min(ans, cur); } return ans * 2; } return 0; }
#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...