mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-01-11 20:31:58 +00:00
P3078 [USACO13MAR]Poker Hands S
R52369270
This commit is contained in:
parent
33b4e12a05
commit
1d309f4839
17
Luogu/problem/P3078/P3078.cpp
Normal file
17
Luogu/problem/P3078/P3078.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
long long n, a[1000005], s;
|
||||||
|
cin >> n;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
}
|
||||||
|
s = a[0];
|
||||||
|
for (int i = 1; i < n; i++) {
|
||||||
|
s += max(0ll, a[i] - a[i - 1]);
|
||||||
|
}
|
||||||
|
cout << s << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user