Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- ifstream cin("test.in");
- // ofstream cout("test.out");
- int n,m,x,y,lung=1,lmax=0,pozST,pozDR;
- cin>>n>>x;
- for (int i=2; i<=n; i++)
- {
- cin>>y;
- if (x%2==0 && y%2==0)
- {
- lung++;
- }
- else
- {
- lung=1;
- }
- if (lung>=lmax)
- {
- lmax=lung;///lung = pozDR - pozST +1
- pozDR = i;
- pozST = pozDR - lung +1;
- }
- x=y;
- }
- cout<<lmax<<" "<<pozST<<" "<<pozDR;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement