이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |