General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
195703752 Practice:
gaju_01
1800E2 - 31 PyPy 3-64 Accepted 499 ms 23076 KB 2023-03-02 19:56:41 2023-03-03 15:35:21
→ Source
t = int(input())
for _ in range(t):
    ret = 'YES'
 
    n, k = list(map(int, input().split(' ')))
    s = input()
    t = input()
 
    for i in range(max(n - k, 0), min(k, n)):
        if s[i] != t[i]:
            ret = 'NO'
 
    if sorted(s) != sorted(t):
        ret = 'NO'
 
    print(ret)
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details