Submission #604259

#TimeUsernameProblemLanguageResultExecution timeMemory
604259cheissmartBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
1 ms300 KiB
#include "boxes.h" #include <bits/stdc++.h> #define F first #define S second #define V vector #define PB push_back #define EB emplace_back #define MP make_pair #define SZ(v) int((v).size()) #define ALL(v) (v).begin(), (v).end() using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef V<int> vi; const int INF = 1e9 + 7; ll delivery(int n, int k, int l, int p[]) { vi a; for(int i = 0; i < n; i++) if(p[i]) a.PB(p[i]); n = SZ(a); ll ans = 0; for(int i = 0; i < n; i++) { ans += min(a[i], l - a[i]); } return ans; }

Compilation message (stderr)

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:20:24: warning: unused parameter 'k' [-Wunused-parameter]
   20 | ll 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...