제출 #296009

#제출 시각아이디문제언어결과실행 시간메모리
296009Dovran전선 연결 (IOI17_wiring)C++11
13 / 100
35 ms2048 KiB
#include <bits/stdc++.h> #include "wiring.h" #define N 100009 #define pii pair <int, int> #define ff first #define ss second #define sz() size() #define pb push_back #define ll long long using namespace std; ll ans; ll min_total_length(vector<int>a, vector<int>b){ ll n=a.sz(); ll m=b.sz(); ll x=0, y=0; while(x<n and y<m){ ans+=b[y]-a[x]; x++, y++; } for(int i=x; i<n; i++) ans+=b[0]-a[i]; for(int i=y; i<m; i++) ans+=b[i]-a[n-1]; return ans; } /* int main(){ int n, m, x; vector<int>a, b; cin>>n>>m; for(int i=1; i<=n; i++) cin>>x, a.pb(x); for(int i=1; i<=m; i++) cin>>x, b.pb(x); cout<<min_total_length(a, b); }*/
#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...