Submission #288866

#TimeUsernameProblemLanguageResultExecution timeMemory
288866BeanZBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms384 KiB
#include <bits/stdc++.h> #include "boxes.h" using namespace std; #define ll long long #define endl '\n' const int N = 2e5 + 5; ll l[10000007], r[10000007]; ll delivery(int n, int k, int L, int position[]){ for (int i = 1; i <= n; i++){ l[i] = 1ll * position[i - 1] * 2; if (i > k) l[i] = l[i] + l[i - k]; } ll res = l[n]; for (int i = n; i >= 1; i--){ r[i] = 1ll * 2 * (L - position[i - 1]); if ((i + k) <= n) r[i] = r[i] + r[i + k]; } for (int i = 1; i <= n; i++){ res = min(res, l[i - 1] + r[i]); } return res; } /* int main(){ ios_base::sync_with_stdio(false); cin.tie(0); if (fopen("VietCT.INP", "r")){ freopen("VietCT.INP", "r", stdin); freopen("VietCT.OUT", "w", stdout); } } /* */

Compilation message (stderr)

boxes.cpp:34:1: warning: "/*" within comment [-Wcomment]
   34 | /*
      |
#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...