제출 #582771

#제출 시각아이디문제언어결과실행 시간메모리
582771MohamedFaresNebili선물상자 (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[]) {
            ll res = 1e18;
            for(int l = 0; l < N; l++) {
                ll lo = P[l] * 2;
                ll hi = 0;
                if(l < N - 1)
                    hi = (L - P[l + 1]) * 2;
                res = min(res, lo + hi);
            }
            return res;
        }

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

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