제출 #419881

#제출 시각아이디문제언어결과실행 시간메모리
419881Blagojce전선 연결 (IOI17_wiring)C++11
13 / 100
39 ms4140 KiB
#include <bits/stdc++.h> #define fr(i, n, m) for(int i = (n); i < (m); i ++) #define pb push_back #define st first #define nd second #define pq priority_queue #define all(x) begin(x), end(x) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const ll inf = 1e18; const int i_inf = 1e9; const ll mod = 1e9+7; mt19937 _rand(time(NULL)); const int mxn = 5e5+5; #include "wiring.h" long long min_total_length(std::vector<int> r, std::vector<int> b){ while((int)r.size() < (int)b.size()){ r.pb(r.back()); } while((int)b.size() < (int)r.size()){ b.pb(b[0]); } ll ans = 0; for(auto u : b) ans += u; for(auto u : r) ans -= u; return ans; } /* int main(){ cout<<min_total_length({1, 2, 3, 7}, {0, 4, 5, 9, 10}); } */
#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...