117262024-11-08 12:07:58balintBimmbamm (30)python3Accepted 30/3017ms3212 KiB
def main():
    for i in range(1, int(input()) + 1):
        inp = input()
        if i % 3 == 0:
            if i % 5 == 0:
                if inp != "BUMM":
                    break
            elif inp != "BIMM":
                break
        elif i % 5 == 0:
            if inp != "BAMM":
                break
        elif inp != "SZAM":
            break
    print(i)


main()
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/016ms2980 KiB
2Accepted0/016ms3128 KiB
3Accepted3/316ms2872 KiB
4Accepted3/316ms2872 KiB
5Accepted3/316ms2872 KiB
6Accepted3/316ms3120 KiB
7Accepted3/317ms3136 KiB
8Accepted3/317ms2872 KiB
9Accepted3/317ms2872 KiB
10Accepted3/316ms3088 KiB
11Accepted3/316ms3212 KiB
12Accepted3/316ms3108 KiB