제출 #217778

#제출 시각아이디문제언어결과실행 시간메모리
217778DavidDamian선물상자 (IOI15_boxes)C++11
10 / 100
5 ms384 KiB
#include<bits/stdc++.h> //#include "boxes.h" using namespace std; typedef long long ll; long long delivery(int N, int K, int L, int p[]) { ll total=0; int remaining=K; for(int i=0;i<N;i++){ if(remaining==K) total+=(ll)min(p[i],L-p[i]); else total+=(ll)p[i]-p[i-1]; remaining--; if(remaining==0 || i==N-1){ total+=(ll)min(p[i],L-p[i]); remaining=K; } } return total; }
#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...