39092023-03-03 21:41:04AndrásSíkság (55)python3Wrong answer 0/55172ms29244 KiB
Lenght = int(input())
Block = input().split()
Search = Block[0]
x = 0
Max = 0
Place = 0
for i in range(len(Block)):
    if i == 0:
        x = x + 1
    elif x == 0:
        if Change == 1:
            Place = i-1
        x = x + 2
    else:
        Change = 0
        if int(Block[i]) - int(Block[i-1]) <= 1 and int(Block[i]) - int(Block[i-1]) >= -1:
            x = x + 1
        else:
            if x > Max:
                Max = x
                Change = 1
                x = 0
            else:
                x = 0
print(Max,Place)
        
    
SubtaskSumTestVerdictTimeMemory
base0/55
1Wrong answer0/017ms11180 KiB
2Wrong answer0/029ms12744 KiB
3Wrong answer0/217ms11564 KiB
4Wrong answer0/217ms11672 KiB
5Wrong answer0/217ms11828 KiB
6Wrong answer0/217ms11992 KiB
7Wrong answer0/317ms12304 KiB
8Wrong answer0/218ms12692 KiB
9Wrong answer0/318ms12668 KiB
10Wrong answer0/332ms14288 KiB
11Wrong answer0/330ms13556 KiB
12Wrong answer0/332ms14464 KiB
13Wrong answer0/3149ms29244 KiB
14Wrong answer0/3159ms15536 KiB
15Wrong answer0/3167ms24924 KiB
16Wrong answer0/3172ms28256 KiB
17Wrong answer0/3167ms28500 KiB
18Wrong answer0/3168ms28368 KiB
19Wrong answer0/3163ms27980 KiB
20Wrong answer0/3170ms28220 KiB
21Wrong answer0/393ms21600 KiB
22Wrong answer0/3137ms25096 KiB