0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-11 16:31:58 +00:00

P4445 [AHOI2018初中组]报名签到

R40110902
This commit is contained in:
Baoshuo Ren 2020-10-19 20:06:06 +08:00 committed by Baoshuo Ren
parent 0109c1cf92
commit 35668d8e4e
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

17
problem/P4445/P4445.cpp Normal file
View File

@ -0,0 +1,17 @@
#include<bits/stdc++.h>
using namespace std;
int main() {
int n, a[100005];
long long ans=0;
cin >> n;
for(int i = 0 ; i < n ; i++) {
cin >> a[i];
}
for(int i = 1 ; i < n ; i++) {
ans += max(a[i], a[i-1]);
}
cout << ans << endl;
return 0;
}