Submission #1081828

#TimeUsernameProblemLanguageResultExecution timeMemory
1081828raphael_heuchlBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
236 ms524288 KiB
#include "boxes.h" #include <vector> std::vector<int> segs; long long delivery(int N, int K, int L, int p[]) { segs.resize(L); for (int i = 0; i < N; ++i) ++segs[p[i]]; long long sum = 0; for (int i = 0; i < L; ++i) sum += 2*segs[i]*std::min(i, L - i); return sum; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:6:31: warning: unused parameter 'K' [-Wunused-parameter]
    6 | 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...