Submission #948511

#TimeUsernameProblemLanguageResultExecution timeMemory
948511irmuunBoxes with souvenirs (IOI15_boxes)C++17
10 / 100
1 ms448 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() ll delivery(int N,int K,int L,int pos[]){ ll ans=0; vector<int>l,r; for(int i=0;i<N;i++){ if(pos[i]<L-pos[i]){ l.pb(pos[i]); } else{ r.pb(L-pos[i]); } } for(int i=K-1;i<(int)l.size();i+=K){ ans+=l[i]*2; } for(int i=K-1;i<(int)r.size();i+=K){ ans+=r[i]*2; } int left=(int)l.size()%K+(int)r.size()%K; int need=(left+K-1)/K; ans+=(ll)need*L; 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...