QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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))
Details
Tip: Click on the bar to expand more detailed information
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'