26672023-01-18 14:54:38fanibarkaiSíkság (55)python3Wrong answer 0/55256ms35640 KiB
from sys import stdin, stdout
n = int(stdin.readline())
ta = list(map(int, stdin.readline().split()))
ok = (0)
tk = []
for i in range(len(ta)):
    os = (ok+1)
    if i != len(ta)-1:
        if ta[i] == ta[i+1]:
            ok += 1
        elif ta[i] - ta[i+1] < 2 and ta[i] != ta[i+1]:
            p = [ta[i],ta[i+1]]
        else:
            ok = 0
            break
    for k in range(i,len(ta)):
        if p.count(ta[k]) == 1:
            os += 1
        else:
            ok = 0
            break
    tk.append([os,i])
for i in range(2):
    stdout.write(str(max(tk)[i])+' ')
    

SubtaskSumTestVerdictTimeMemory
base0/55
1Accepted0/018ms11188 KiB
2Wrong answer0/018ms13584 KiB
3Runtime error0/217ms11776 KiB
4Wrong answer0/217ms12176 KiB
5Runtime error0/216ms11664 KiB
6Runtime error0/217ms12260 KiB
7Runtime error0/317ms12300 KiB
8Runtime error0/217ms12616 KiB
9Runtime error0/317ms12640 KiB
10Runtime error0/319ms14836 KiB
11Runtime error0/318ms13872 KiB
12Runtime error0/318ms14548 KiB
13Wrong answer0/345ms34928 KiB
14Runtime error0/332ms16768 KiB
15Runtime error0/341ms30296 KiB
16Runtime error0/343ms35640 KiB
17Runtime error0/341ms35548 KiB
18Runtime error0/345ms35488 KiB
19Runtime error0/345ms35200 KiB
20Wrong answer0/345ms35164 KiB
21Runtime error0/332ms25304 KiB
22Time limit exceeded0/3256ms14888 KiB