# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746888 | 2023-05-23T08:13:25 Z | vjudge1 | Calvinball championship (CEOI15_teams) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; ll delivery(int N, int K, int L, vector<int> positions) { ll ans = 0; for (int i = N - 1; i >= 0; i -= K) { if (positions[i] > N / 2) ans += L; else ans += 2 * positions[i]; } return ans; }