Submission #558588

#TimeUsernameProblemLanguageResultExecution timeMemory
558588n0sk1llBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms356 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; long long int typedef li; list<int> poz; long long delivery(int n, int k, int s, int p[]) { sort(p,p+n); for (int i=0;i<n;i++) poz.push_back(p[i]); li ret=0; while (!poz.empty()) { if (poz.front()<s-poz.back()) { int aman=0; for (int i=0;i<k && !poz.empty();i++) { aman=poz.front(); poz.pop_front(); } ret+=2*aman; } else { int aman=0; for (int i=0;i<k && !poz.empty();i++) { aman=s-poz.back(); poz.pop_back(); } ret+=2*aman; } } return ret; }
#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...