22962023-01-09 20:40:30neszbalKvázi-Izogrampython3Accepted 100/100208ms16044 KiB
N = int(input())
mondatok = []

for i in range(N):
    mondatok.append(input().replace(" ", "").lower())

izogarom = 0


for mondat in mondatok:
    betuk_szama = {}
    izoga = True
    for betu in mondat:
        if betu.isalpha() == False:
            continue
        
        if betu not in betuk_szama:
            betuk_szama[betu] = 1
        else:
            betuk_szama[betu] += 1

    for betu in betuk_szama:
        if betuk_szama[betu] > 2:
            izoga = False

    if izoga:
        izogarom += 1

print(izogarom)

SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11316 KiB
2Accepted17ms11672 KiB
subtask230/30
3Accepted16ms11344 KiB
4Accepted17ms11752 KiB
5Accepted17ms11812 KiB
6Accepted18ms11956 KiB
7Accepted41ms13648 KiB
subtask350/50
8Accepted17ms12124 KiB
9Accepted18ms12548 KiB
10Accepted17ms12844 KiB
11Accepted17ms13080 KiB
12Accepted17ms13212 KiB
13Accepted17ms13356 KiB
subtask420/20
14Accepted27ms13104 KiB
15Accepted35ms13396 KiB
16Accepted54ms13692 KiB
17Accepted96ms14608 KiB
18Accepted166ms15536 KiB
19Accepted194ms15628 KiB
20Accepted208ms16044 KiB