Submission #428376

#TimeUsernameProblemLanguageResultExecution timeMemory
428376yuto1115Wiring (IOI17_wiring)C++17
0 / 100
1 ms204 KiB
#include "wiring.h" #include<bits/stdc++.h> #define rep(i, n) for(ll i = 0; i < ll(n); i++) #define rep2(i, s, n) for(ll i = ll(s); i < ll(n); i++) #define rrep(i, n) for(ll i = ll(n)-1; i >= 0; i--) #define pb push_back #define eb emplace_back #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() using namespace std; using ll = long long; using P = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vp = vector<P>; using vvp = vector<vp>; using vb = vector<bool>; using vvb = vector<vb>; using vs = vector<string>; const int inf = 1001001001; const ll linf = 1001001001001001001; template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } ll min_total_length(vi r, vi b) { int n = r.size(); int m = b.size(); ll ans = 0; if (n >= m) { rep(i, n - (m - 1)) ans += b[0] - r[i]; rep(i, m - 1) ans += b[i] - r[n - (m - 1) + i]; } else { rep(i, n - 1) ans += b[i] - r[i]; rep2(i, n, m) ans += b[i] - r.back(); } return ans; }
#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...