제출 #298920

#제출 시각아이디문제언어결과실행 시간메모리
298920infinite_iq전선 연결 (IOI17_wiring)C++14
0 / 100
1 ms256 KiB
#include <bits/stdc++.h> using namespace std ; typedef long long ll ; typedef vector < int > vi ; #define lb lower_bound #include "wiring.h" long long min_total_length ( vi r , vi b ) { ll ans = 0 ; reverse ( r .begin () , r .end () ) ; reverse ( b .begin () , b .end () ) ; if ( r .size () < b .size () ) swap ( r , b ) ; int last = b [0] ; while ( b .size () ) { ans += abs ( b .back () - r .back () ) ; b .pop_back () ; r .pop_back () ; } for ( auto u : r ) { ans += abs ( u - last ) ; } 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...