제출 #1195694

#제출 시각아이디문제언어결과실행 시간메모리
1195694nikulid선물상자 (IOI15_boxes)C++20
0 / 100
0 ms328 KiB
#include "boxes.h" #include <vector> #include <math.h> using namespace std; #define ll long long /* Lemma: this is dp and I will move on to q2 after getting the first sub task */ long long delivery(int N, int K, int L, int p[]) { vector<int> ns; for(int i=0; i<N; i++){ ns.push_back(p[i]); } ll ans=0; int cur, furthest=0; for(auto e:ns){ cur = min(e, L-e+1); ans += cur; furthest = max(cur, furthest); } return 2*ans - furthest; }
#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...