Submission #223595

#TimeUsernameProblemLanguageResultExecution timeMemory
223595a_playerBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
5 ms384 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; for(auto x:m){ ans+=min(x.f-pos,pos+L-x.f); pos=x.f; } return ans; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:12:31: warning: unused parameter 'K' [-Wunused-parameter]
 long long delivery(int N, int K, int L, int p[]) {
                               ^
#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...