mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-28 13:31:59 +00:00
P1567 统计天数
R41963950
This commit is contained in:
parent
7c0dd9bfdf
commit
b5a11d7086
25
problem/P1567/P1567.cpp
Normal file
25
problem/P1567/P1567.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, ans, a[1000005], f[1000005];
|
||||
|
||||
int main() {
|
||||
cin >> n;
|
||||
for (int i = 0; i < n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
for (int i = 1; i < n; i++) {
|
||||
if (a[i] > a[i - 1]) {
|
||||
f[i] = f[i - 1] + 1;
|
||||
}
|
||||
else {
|
||||
f[i] = 0;
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < n; i++) {
|
||||
ans = max(ans, f[i]);
|
||||
}
|
||||
cout << ++ans << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user