Time Limit: 8 sec / Memory Limit: 64 MB Example Input 5 3 2 aaaaa aaa aab Output 1 6
- User
Time Limit: 8 sec / Memory Limit: 64 MB
Example Input
5 3 2 aaaaa aaa aab
Output
1 6
Assistant
n, m, k = map(int, input().split()) a = input().strip() s = input().strip() t = input().strip() count_s = 0 for i in range(n - m + 1): if a[i:i + m] == s: count_s += 1 ans1 = 1 if count_s >= k else 0 ans2 = (n - m + 1) * k print(ans1, ans2)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.