#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int n,q;
cin >> n >> q;
vector<int>a(n+1,0);
vector<int>b(n+1,0);
for(int i = 1;i<=n;i++)
{
cin >> a[i];
b[i] = a[i] -a[i-1];
}
int flag = 1;
int temp =1;
for(int i = 2;i<=n;i++)
{
if(b[i] !=b[i-1])
{
temp =0 ;
}
else
{
temp++;
flag = max(flag,temp);
}
}
while(q--)
{
int k;
int r,l,s,c;
cin >> k;
if(k == 1)
{
cin >> l >> r >> s >> c;
}
else if (k==2)
{
cin >> l >> r >> s >> c;
flag = n;
}
else
{
cin >> l >> r;
cout << flag << '\n';
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
217 ms |
7760 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
386 ms |
7232 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
202 ms |
8464 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
386 ms |
7232 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
217 ms |
7760 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |