QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#625023#7618. Pattern SearchAbrinWA 16ms10604kbPython3388b2024-10-09 17:11:302024-10-09 17:11:31

Judging History

你现在查看的是最新测评结果

  • [2024-10-09 17:11:31]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:10604kb
  • [2024-10-09 17:11:30]
  • 提交

answer

from collections import Counter

z = int(input())
results = []

for _ in range(z):
    s, t = input().split()

    count_s = Counter(s)
    count_t = Counter(t)

    max_occurrences = float('inf')
    for char in count_t:
        max_occurrences = min(max_occurrences, count_s[char] // count_t[char])

    results.append(str(max_occurrences))

print("\n".join(results))

詳細信息

Test #1:

score: 100
Accepted
time: 12ms
memory: 10572kb

input:

2
bajkaaall aal
abca cba

output:

2
1

result:

ok 2 number(s): "2 1"

Test #2:

score: -100
Wrong Answer
time: 16ms
memory: 10604kb

input:

16
a a
a b
b a
aa a
ab aa
ab b
ab c
aaz az
abcde edcba
aaaaaaaaaaaabbb aaaaaaaaabb
aaaaaazz az
aaaaaaaaaz zzzzz
gggggggggggggggggggge ggggeeee
hyphyphyphyphyphyphyphyphyphyphyphyp eeeeeeeeee
hyphyphyphyphyphyphyphyphyphyphyphype eeteeteeteet
aaaabbbbbbcccccccc aaabbbbbcccccc

output:

1
0
0
2
0
1
0
1
1
1
2
0
0
0
0
1

result:

wrong answer 10th numbers differ - expected: '2', found: '1'