Submission #432210

#TimeUsernameProblemLanguageResultExecution timeMemory
432210jeqchoBoxes with souvenirs (IOI15_boxes)C++17
0 / 100
1 ms204 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii> vpi; #define FOR(i,a,b) for(int i=a;i<b;++i) #define F0R(i,b) FOR(i,0,b) #define ROF(i,a,b) for(int i=b-1;i>=a;--i) #define R0F(i,b) ROF(i,0,b) #define trav(a,x) for(auto&a:x) #define all(x) begin(x),end(x) #define fi first #define se second #define pb push_back #define sz(x) int(x.size()) int const N=1e3+3; vpi adj[N]; int n; bitset<N>vis; ll d[N]; ll const INF=1e18; ll delivery(int n1, int K, int L, int p[]) { n=n1; ll ans = L; ll cw=-1; ll ccw=-1; F0R(i,n) { if(p[i]<= L/2) { cw=p[i]; } else { ccw=p[i]; break; } } if(ccw==-1) { ans=cw*2; } else { ans=min(ans,(cw + L-ccw)*2); } return ans; }

Compilation message (stderr)

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