제출 #582777

#제출 시각아이디문제언어결과실행 시간메모리
582777MohamedFaresNebiliBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; using ll = long long; using pi = pair<ll, pair<ll, ll>>; using ii = pair<int, int>; #define pb push_back #define pp pop_back #define ff first #define ss second typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; ll delivery(int N, int K, int L, int P[]) { sort(P, P + N); ll res = L; for(int l = 0; l < N; l++) { ll lo = ll(P[l]) * 2ll; ll hi = 0; if(l < N - 1) hi = ll(L - P[l + 1]) * 2ll; res = min(res, lo + hi); } return res; }

컴파일 시 표준 에러 (stderr) 메시지

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:20:32: 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...