Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- _int64 n;
- cin >> n;
- int a;
- int b;
- _int64 cnt = 1;
- _int64 res = 1;
- for (int i = 1; i <= n; i++) {
- cin >> a;
- if (i > 1 && a == b) {
- cnt++;
- } else {
- cnt = 1;
- }
- if (cnt > res) {
- res = cnt;
- }
- b = a;
- }
- cout << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement