时间限制: 1 Sec 内存限制: 256 MB
提交: 0 解决: 19
Judge Mode:Std IO
File Name:
[提交][状态]
[题目描述]
输入
第一行,一个整数N
第二行,N个非负整数p1,p2,…,pN
第三行,N个非负整数t1,t2,…,tN
输出
一个整数,需要的最小指令数
样例输入
5 1 5 3 3 4 1 2 2 2 1
样例输出
5
提示
ji
//G
#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int N=2e5+10;
typedef long long ll;
int a[N],b[N];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
for(int i=1;i<=n;i++){
scanf("%d",&b[i]);
b[i]=a[i]-b[i];
}
int ans=0;
for(int i=1;i<=n+1;i++){
ans+=max(b[i]-b[i-1],0);
}
printf("%d\n",ans);
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
return 0;
}