Wrong Answer.wrong answer On line 1 column 1, read 3, expected 5.
第一个测试点WA
#include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int arr[n], result = 1, before, after; cin >> before;
for(int i = 0; i < n - 1; i++){
cin >> after;
if(before + 1 == after){
result++;
}else {
result = 1;
}
arr[i] = result;
before = after;
}
int max_result = arr[0];
for(int i : arr){
if(i > max_result){
max_result = i;
}
}
cout << max_result << endl;
return 0;
}