mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-02-04 13:20:06 +00:00
P4445 [AHOI2018初中组]报名签到
R40110902
This commit is contained in:
parent
0109c1cf92
commit
35668d8e4e
17
problem/P4445/P4445.cpp
Normal file
17
problem/P4445/P4445.cpp
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user