Submission #419148

#TimeUsernameProblemLanguageResultExecution timeMemory
419148LouayFarahBoxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms204 KiB
#include "bits/stdc++.h" #include "boxes.h" using namespace std; long long delivery(int n, int k, int l, int positions[]) { if(k==1) { long long res = 0; for(int i = 0; i<n; i++) { if(positions[i]>l/2) { res+=2*(l-positions[i]); } else { res+=2*(positions[i]); } } return res; } else if(k==n) { } else { } }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#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...