Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream in ("platou1.in");
- ofstream out ("platou1.out");
- int main () {
- int a, b, l, lmax, nmax;
- nmax = 100000;
- lmax = 0;
- l = 1;
- in >> a;
- while (in >> b){
- if (a == b) {
- l ++;
- }
- else {
- l = 1;
- }
- if (l > lmax || (l == lmax && a < nmax)) {
- lmax = l;
- nmax = a;
- }
- a = b;
- }
- out << lmax << " " << nmax;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement