제출 #223599

#제출 시각아이디문제언어결과실행 시간메모리
223599a_player선물상자 (IOI15_boxes)C++14
10 / 100
5 ms512 KiB
#include "boxes.h" #include <bits/stdc++.h> #define f first #define s second using namespace std; typedef long long ll; map<int,int> m; long long delivery(int N, int K, int L, int p[]) { for(int i=0;i<N;i++){ m[p[i]]++; } ll ans=0; int pos=0; if(K==1){ for(auto x:m){ ans+=(ll)min(x.f,L-x.f)*(ll)x.s*2LL; } return ans; } for(auto x:m){ ans+=(ll)min(x.f-pos,pos+L-x.f); pos=x.f; } return ans; }
#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...