112622024-08-02 08:56:53probaBimmbamm (30)python3Accepted 30/3018ms3204 KiB
#bimm
N = int(input())
adat = input().strip()
#print(adatok)
i, gen, e = 1, 'SZAM', ['BUMM','BAMM','BIMM','SZAM']

while i < N and gen == adat:
    adat = input().strip()
    i += 1
    gen = e[0] if (i % 3 == 0) and (i % 5 == 0) else e[1] if i % 5 == 0 else e[2] if i % 3 == 0 else e[3]

print(i)
        
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/018ms2916 KiB
2Accepted0/017ms2964 KiB
3Accepted3/317ms2916 KiB
4Accepted3/317ms2944 KiB
5Accepted3/317ms3064 KiB
6Accepted3/317ms2920 KiB
7Accepted3/317ms2920 KiB
8Accepted3/317ms3064 KiB
9Accepted3/317ms2844 KiB
10Accepted3/317ms3192 KiB
11Accepted3/317ms3204 KiB
12Accepted3/318ms3064 KiB