19322022-12-11 23:36:50mintaaronKvázi-Izogrampython3Time limit exceeded 80/1001.082s13964 KiB
x=0
abc = 'abcdefghijklmnopqrstuvwxyz'
n=int(input())
mondatok=[]
for i in range(n):
    mondat=input()
    mondatok.append(mondat)

def fgv(t):
    for k in range(len(t)):
        c = 0
        for l in range(len(t)):
            if t[k]==t[l]:
                c+=1
                if t[k] not in abc:
                    c -= 1
                if c > 2:
                    return 0
    if c<=2:
        return 1

for i in mondatok:
    a = ""
    for j in i.split():
        for k in j:
            a+=k
    x+=fgv(a.lower())
print(x)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11160 KiB
2Accepted17ms11212 KiB
subtask230/30
3Accepted17ms11568 KiB
4Accepted17ms11892 KiB
5Accepted17ms12200 KiB
6Accepted19ms12528 KiB
7Accepted54ms13964 KiB
subtask350/50
8Accepted25ms12324 KiB
9Accepted27ms12400 KiB
10Accepted28ms12452 KiB
11Accepted29ms12544 KiB
12Accepted30ms12516 KiB
13Accepted32ms12656 KiB
subtask40/20
14Accepted96ms12816 KiB
15Accepted172ms12700 KiB
16Accepted330ms13184 KiB
17Accepted648ms13780 KiB
18Time limit exceeded1.062s6256 KiB
19Time limit exceeded1.082s6340 KiB
20Time limit exceeded1.082s6536 KiB