mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1317 低洼地
R39922188
This commit is contained in:
parent
46a0e2b369
commit
182bdf71f7
21
problem/P1317/P1317.cpp
Normal file
21
problem/P1317/P1317.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n, t, l = 0, q = 0, ans = 0;
|
||||
cin >> n;
|
||||
for (int i = 0; i < n; i++) {
|
||||
cin >> t;
|
||||
if (t < q) {
|
||||
l = 1;
|
||||
}
|
||||
if (t > q && l == 1) {
|
||||
l = 0;
|
||||
ans++;
|
||||
}
|
||||
q = t;
|
||||
}
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user