Submission #412642

#TimeUsernameProblemLanguageResultExecution timeMemory
412642losmi247Boxes with souvenirs (IOI15_boxes)C++14
10 / 100
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+2; int n,k,l; int pos[N]; ll kje1(){ ll sol = 0; for(int i = 0; i < n; i++){ ll dod = 2*min(pos[i],l-pos[i]); sol += dod; } return sol; } ll delivery(int br1,int br2,int br3,int *positions){ n = br1; k = br2; l = br3; for(int i = 0; i < n; i++) pos[i] = positions[i]; if(k == 1){ return kje1(); } }

Compilation message (stderr)

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