Submission #420103

#TimeUsernameProblemLanguageResultExecution timeMemory
420103ismoilovBoxes with souvenirs (IOI15_boxes)C++14
0 / 100
1 ms204 KiB
#include "boxes.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define all(x) (x).begin(), (x).end() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) ll delivery(int n, int k, int l, int p[]) { ll mx = 0, mx1 = 0; fp(i,0,n) mx = max(mx,p[i]*2*1ll); fp(i,0,n) mx1 = max(mx1, (l-p[i])*2*1ll); return min(mx, min(mx1, l*1ll)); }

Compilation message (stderr)

boxes.cpp: In function 'll delivery(int, int, int, int*)':
boxes.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
boxes.cpp:14:3: note: in expansion of macro 'fp'
   14 |   fp(i,0,n)
      |   ^~
boxes.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++)
      |                           ^
boxes.cpp:16:3: note: in expansion of macro 'fp'
   16 |   fp(i,0,n)
      |   ^~
boxes.cpp:12:24: warning: unused parameter 'k' [-Wunused-parameter]
   12 | 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...