QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#625023 | #7618. Pattern Search | Abrin | WA | 16ms | 10604kb | Python3 | 388b | 2024-10-09 17:11:30 | 2024-10-09 17:11:31 |
Judging History
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'