112612024-08-02 08:54:11probaBimmbamm (30)python3Accepted 30/3019ms3192 KiB
#bimm
N = int(input())
adat = input().strip()
#print(adatok)
i, gen = 1, 'SZAM'

while i < N and gen == adat:
    adat = input().strip()
    i += 1
    gen = 'BUMM' if (i % 3 == 0) and (i % 5 == 0) else 'BAMM' if i % 5 == 0 else 'BIMM' if i % 3 == 0 else 'SZAM'

print(i)
        
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/017ms2916 KiB
2Accepted0/019ms2916 KiB
3Accepted3/317ms2916 KiB
4Accepted3/317ms2920 KiB
5Accepted3/317ms2960 KiB
6Accepted3/317ms2916 KiB
7Accepted3/317ms2916 KiB
8Accepted3/317ms3192 KiB
9Accepted3/317ms2848 KiB
10Accepted3/317ms3064 KiB
11Accepted3/318ms2916 KiB
12Accepted3/318ms2960 KiB