Files
python/LuoGu/RuMen/P1420.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

18 lines
331 B
C++

#include<iostream>
using namespace std;
int main() {
int n, ans = 0, c, b, max = 1;
cin >> n >> b;
for (int i = 0; i < n - 1; i++) {
cin >> c;
if (c == b + 1) max++;
else max = 1;
if (ans < max) ans = max;
b = c;
}
cout << ans << endl;
return 0;
}