Created
April 4, 2017 20:09
-
-
Save mikl745/365d6b94bd5d8407327c7132a96bec84 to your computer and use it in GitHub Desktop.
версия 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w = int(input()) | |
a = [list(map(int, input().split())) for x in range(w)] | |
y = 0 | |
maxCount = 1 | |
maxHeight = a[0] | |
currentCount = 1 | |
currentHeight = a[0] | |
for i in range(1,w): | |
height = a[i] | |
if currentHeight == height : | |
currentCount = currentCount + 1 | |
else: | |
if maxCount < currentCount: | |
maxCount = currentCount | |
maxHeight = currentHeight | |
currentHeight = height | |
print(maxCount,maxHeight) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment