0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 05:38:47 +00:00

P1567 统计天数

R41963950
This commit is contained in:
Baoshuo Ren 2020-11-15 19:29:24 +08:00 committed by Baoshuo Ren
parent 7c0dd9bfdf
commit b5a11d7086
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

25
problem/P1567/P1567.cpp Normal file
View 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;
}