Submission #1120932

#TimeUsernameProblemLanguageResultExecution timeMemory
1120932SalihSahinBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms336 KiB
#include <bits/stdc++.h> #define pb push_back using namespace std; #include "boxes.h" const long long inf = 1e18; long long delivery(int N, int K, int L, int p[]) { vector<long long> pos(N); for(int i = 0; i < N; i++){ pos[i] = p[i]; } long long val = 0; for(int i = 0; i < N; i++){ val = (val + min(pos[i], L - pos[i]) * 2); } return val; }

Compilation message (stderr)

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