ZhenlongDai/ACPR huggingface dataset:
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
flag = True
traslate = [[i, i] for i in range(26)]
use = [False] * 26
for i in range(len(S)):
    si = ord(S[i]) - ord('a')
    ti = ord(T[i]) - ord('a')
    
    if(traslate[si][1] != ti):
        if(use[si] == False and use[ti] == False):
            traslate[si][1], traslate[ti][1] = traslate[ti][1], traslate[si][1]
            use[si] = True
            use[ti] = True
        else:
            flag = False

if(flag):
    print("Yes")
else:
    print("No")


Failing test case input:
abcdefghijklmnopqrstuvwxyz
unomzpgwdtsjxlcvakerfqhybi

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
T = input()
flag = True
traslateT = [0] * 26
traslateS = [0] * 26
use = [False] * 26
for i in range(len(S)):
    si = ord(S[i]) - ord('a')
    ti = ord(T[i]) - ord('a')
    if(traslateS[si] != 0 and traslateS[si] != ti):
        flag = False
    if(traslateT[ti] != 0 and traslateT[ti] != si):
        flag = False
    traslateS[si] = ti
    traslateT[ti] = si

if(flag):
    print("Yes")
else:
    print("No")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
s = input()
t = input()

if s==t:
    print("Yes")
    sys.exit()

alpha = [chr(i) for i in range(97, 97+26)]
checkalpha = []
checknum = []
for a in alpha:
    idxs = [i for i, x in enumerate(s) if x == a]
    if idxs==[]: continue
    checkalpha.append(a)
    checknum.append(idxs)
    tn = [t[i] for i in idxs]
    x = tn[0]
    for i in tn:
        if i != x:
            print("No")
            sys.exit()
print("Yes")


Failing test case input:
zyxwvutsrqponmlkjihgfedcba
unonzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
s = input()
t = input()

if s==t:
    print("Yes")
    sys.exit()

alpha = [chr(i) for i in range(97, 97+26)]
checkalpha = []
checks = [0 for i in range(26)]
checkt = [0 for i in range(26)]
for i,a in enumerate(alpha):
    checks[i] = len([i for i, x in enumerate(s) if x == a])
    checkt[i] = len([i for i, x in enumerate(t) if x == a])
checks.sort()
checkt.sort()
if checks == checkt:
    print("Yes")
else:
    print("No")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):





mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    
    
    S = input()
    T = input()
    ok = True
    dic_s = {}
    dic_t = {}
    for i in range(len(S)):
        s = S[i]
        t = T[i]
        if s in dic_s.keys():
            if dic_s[s] != t:
                ok = False
        if t in dic_t.keys():
            if dic_t[t] != s:
                ok = False
        dic_s[s] = t
        dic_t[t] = s
        print(dic_s,dic_t,sep='\n')
    if ok:
        print('Yes')
    else:
        print('No')



if __name__ == '__main__':
  main()


Failing test case input:
cvhpjjda
decoccsr

Expected output:
No


Actual output:
{'c': 'd'}
{'d': 'c'}
{'c': 'd', 'v': 'e'}
{'d': 'c', 'e': 'v'}
{'c': 'd', 'v': 'e', 'h': 'c'}
{'d': 'c', 'e': 'v', 'c': 'h'}
{'c': 'd', 'v': 'e', 'h': 'c', 'p': 'o'}
{'d': 'c', 'e': 'v', 'c': 'h', 'o': 'p'}
{'c': 'd', 'v': 'e', 'h': 'c', 'p': 'o', 'j': 'c'}
{'d': 'c', 'e': 'v', 'c': 'j', 'o': 'p'}
{'c': 'd', 'v': 'e', 'h': 'c', 'p': 'o', 'j': 'c'}
{'d': 'c', 'e': 'v', 'c': 'j', 'o': 'p'}
{'c': 'd', 'v': 'e', 'h': 'c', 'p': 'o', 'j': 'c', 'd': 's'}
{'d': 'c', 'e': 'v', 'c': 'j', 'o': 'p', 's': 'd'}
{'c': 'd', 'v': 'e', 'h': 'c', 'p': 'o', 'j': 'c', 'd': 's', 'a': 'r'}
{'d': 'c', 'e': 'v', 'c': 'j', 'o': 'p', 's': 'd', 'r': 'a'}
No


Fixed submission (verdict: Accepted):





mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    
    
    S = input()
    T = input()
    ok = True
    dic_s = {}
    dic_t = {}
    for i in range(len(S)):
        s = S[i]
        t = T[i]
        if s in dic_s.keys():
            if dic_s[s] != t:
                ok = False
        if t in dic_t.keys():
            if dic_t[t] != s:
                ok = False
        dic_s[s] = t
        dic_t[t] = s
        
    if ok:
        print('Yes')
    else:
        print('No')



if __name__ == '__main__':
  main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def resolve():
    S = input()
    T = input()

    for i in range(len(S)-1):
        if S[i] != T[i]:
            c1 = S.find(S[i], i+1)
            if c1 != -1 and T[c1] != T[i]:
                print("No")
                return
            c2 = S.find(T[i], i+1)
            if c2 != -1 and S[i] != T[c2]:
                print("No")
                return
            print("{} <-> {}".format(S[i], T[i]))
    print("Yes")



if '__main__' == __name__:
    resolve()

Failing test case input:
`djcoivj
rscdoded

Expected output:
No


Actual output:
` <-> r
d <-> s
No


Fixed submission (verdict: Accepted):
def resolve():
    S = input()
    T = input()
    smap = {}
    tmap = {}
    for i in range(len(S)):
        if S[i] in smap: 
            if smap[S[i]] != T[i]:
                print("No")
                return
        else:
            smap[S[i]] = T[i]
        
        if T[i] in tmap: 
            if tmap[T[i]] != S[i]:
                print("No")
                return
        else:
            tmap[T[i]] = S[i]

    print("Yes")
    return


if '__main__' == __name__:
    resolve()
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
S = list(input())
T = list(input())
l = len(S)
ds = defaultdict(str)
dt = defaultdict(str)
for i in range(l):
    if ds[S[i]] == "":
        ds[S[i]] = T[i]
    elif ds[S[i]] == T[i]:
        pass
    else:
        exit()
    if dt[T[i]] == "":
        dt[T[i]] = S[i]
    elif dt[T[i]] == S[i]:
        pass
    else:
        print('No')
        exit()

print('Yes')

Failing test case input:
zyxwvutsrqpnnmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
from collections import defaultdict
S = list(input())
T = list(input())
l = len(S)
ds = defaultdict(str)
dt = defaultdict(str)
for i in range(l):
    if ds[S[i]] == "":
        ds[S[i]] = T[i]
    elif ds[S[i]] == T[i]:
        pass
    else:
        print('No')
        exit()
    if dt[T[i]] == "":
        dt[T[i]] = S[i]
    elif dt[T[i]] == S[i]:
        pass
    else:
        print('No')
        exit()

print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = sorted(input())
T = sorted(input())

reg = [None]*26
reg_flag = [0]*26

for i in range(len(S)):
    index = ord(S[i])-97
    if reg_flag[index] == 0:
        reg[index] = T[i]
        reg_flag[index] = 1

        index_T = ord(T[i])-97
        if reg_flag[index_T] == 0:
            reg[index_T] = S[i]
            reg_flag[index_T] = 1

    if reg[index] == T[i]:
        pass
    else:
        print('No')
        exit()

print('Yes')

Failing test case input:
ihjoudad
redncddr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import collections

S = input()
T = input()

reg = [None]*26
reg_flag = [0]*26

for i in range(len(S)):
    index = ord(S[i])-97
    if reg_flag[index] == 0:
        reg[index] = T[i]
        reg_flag[index] = 1

    if reg[index] == T[i]:
        pass
    else:
        print('No')
        exit()

reg = filter(lambda x: x != None, reg)
if collections.Counter(reg).most_common()[0][1] > 1:
    print('No')
else:
    print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():

    S = input()
    T = input()

    if len(S) != len(T):
        return "No"
    d = dict()
    for i in range(len(S)):
        if S[i] not in d:
            d[S[i]] = T[i]
        else:
            if d[S[i]] != T[i]:
                return "No"
    return "Yes"

if __name__ == '__main__':
    print(main())

Failing test case input:
cadukohi
redcoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():

    S = list(input())
    T = list(input())

    d = dict()
    d_inv = dict()
    for i in range(len(S)):
        if S[i] not in d:
            if T[i] in d_inv:
                return "No"
            else:
                d[S[i]] = T[i]
                d_inv[T[i]] = S[i]
        else:
            if d[S[i]] != T[i]:
                return "No"
    return "Yes"
        
if __name__ == '__main__':
    print(main())
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

alpha = "abcdefghijklmnopqrstuvwxyz" 

d = {}
for i in alpha:
    d[i] = None

for i in range(len(T)):
    if(d[T[i]] == None):
        d[T[i]] = S[i]
    elif(d[T[i]] != S[i]):
        print("No")
        exit()

print("Yes")

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()

alpha = "abcdefghijklmnopqrstuvwxyz" 

d = {}
for i in alpha:
    d[i] = None

for i in range(len(T)):
    if(d[T[i]] == None):
        if((S[i] in d.values()) == True):
            print("No")
            exit()
        d[T[i]] = S[i]
    elif(d[T[i]] != S[i]):
        print("No")
        exit()

print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    import copy
    s, t = input(), input()
    a = [[] for _ in range(26)]
    b = copy.deepcopy(a)
    for i, j in zip(s, t):
        x, y = map(lambda x: ord(x) - 97, [i, j])
        a[x].append(y)
        b[y].append(x)

    f = all(len(set(i)) for i in a)
    g = all(len(set(i)) for i in a)
    print("Yes" if f and g else "No")


if __name__ == '__main__':
    main()


Failing test case input:
azzle
appld

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    import copy
    s, t = input(), input()
    a = [[] for _ in range(26)]
    b = copy.deepcopy(a)
    for i, j in zip(s, t):
        x, y = map(lambda x: ord(x) - 97, [i, j])
        a[x].append(y)
        b[y].append(x)

    f = all(len(set(i)) <= 1 for i in a)
    g = all(len(set(i)) <= 1 for i in b)
    print("Yes" if f and g else "No")


if __name__ == '__main__':
    main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def string_transformation():
    s = input()
    t = input()

    f = True
    dep = {}

    for sc,tc in zip(s,t):
        if dep.get(tc) is not None or (dep.get(tc) != sc and sc in dep.values()):
            print("No")
            f = False
            break
        else:
            dep[tc] = sc

    if f:
        print("Yes")

if __name__ == "__main__":
    string_transformation()

Failing test case input:
azzel
apple

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
def string_transformation():
    s = input()
    t = input()

    f = True
    dep = {}

    for sc,tc in zip(s,t):
        if (dep.get(tc) is not None or sc in dep.values()) and sc != dep.get(tc):
            print("No")
            f = False
            break
        else:
            dep[tc] = sc

    if f:
        print("Yes")

if __name__ == "__main__":
    string_transformation()
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


s=list(input())
t=list(input())

c1={}
c2={}
for ss,tt in zip(s,t):
    c1[ss]=c1.get(ss,'')+tt
    c2[tt]=c2.get(tt,'')+ss
    if len(c1[ss])<2 and len(c2[tt])<2:continue
    if set(c1[ss])==ss and set(c2[tt])==tt:continue
    else:
        print('No')
        exit()

print('Yes')


Failing test case input:
azzle
appld

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):


s=list(input())
t=list(input())

c1={}
c2={}
for ss,tt in zip(s,t):
    if c1.get(ss) is None:
        c1[ss]=tt
    if c2.get(tt) is None:
        c2[tt]=ss
    if c1[ss]==tt and c2[tt]==ss:continue
    else:
        print('No')
        exit()

print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def submit():
    s = input().strip()
    t = input().strip()

    
    if not set(list(s)) & (set(list(t))):
        print("Yes")
        return
    
    
    
    check = {}
    for se, te in zip(s, t):
        if te in check.keys() and check[te] != se:
            print("No")
            return
        else:
            check[te] = se
    print("Yes")


if __name__ == "__main__":
    submit()
                


Failing test case input:
azzel
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

def submit():
    s = input().strip()
    t = input().strip()

    
    
    check_s = {}
    check_t = {}
    for se, te in zip(s, t):
        if se in check_s.keys() and check_s[se] != te:
            print("No")
            return
        else:
            check_s[se] = te
        
        if te in check_t.keys() and check_t[te] != se:
            print("No")
            return
        else:
            check_t[te] = se
        
    print("Yes")


if __name__ == "__main__":
    submit()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def string_transformation():
    s = input()
    t = input()

    f = True
    dep = {}

    for sc,tc in zip(s,t):
        if dep.get(tc) is not None and dep.get(tc) != sc:
            print("No")
            f = False
            break
        else:
            dep[tc] = sc

    if f:
        print("Yes")

if __name__ == "__main__":
    string_transformation()

Failing test case input:
azzle
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def string_transformation():
    s = input()
    t = input()

    f = True
    dep = {}

    for sc,tc in zip(s,t):
        if (dep.get(tc) is not None or sc in dep.values()) and sc != dep.get(tc):
            print("No")
            f = False
            break
        else:
            dep[tc] = sc

    if f:
        print("Yes")

if __name__ == "__main__":
    string_transformation()
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
flag = True
flag2 = False
l = ''
for i in range(len(S)):
    if S[i] != T[i]:
        if flag2 and (S[i] in S[:i-1] or T[i] in T[:i-1]):
            flag = False
            break
        s = S[i]
        for j in range(i,len(S)):
            if S[j] == s:
                S = S[:j]+T[i]+S[j+1:]
            elif S[j] == T[i]:
                S = S[:j]+s+S[j+1:]
    if not flag2:
        flag2 = True
if flag:
    print('YES')
else:
    print('NO')

Failing test case input:
cadukohi
rddcoder

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
T = input()

flag = True
translate1 = [-1 for i in range(26)]
translate2 = [-1 for i in range(26)]
for i in range(len(S)):
    s = ord(S[i])-97
    t = ord(T[i])-97

    if translate1[s] == -1:
        translate1[s] = t
    else:
        if translate1[s] != t:
            flag = False
            break 

    if translate2[t] == -1:
        translate2[t] = s
    else:
        if translate2[t] != s:
            flag = False
            break


if flag:
    print('Yes')
else:
    print('No')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

s = list(input())
t = list(input())

l='abcdefghijklmnopqrstuvwxyz'
if len(set(t)) == len(set(s)):
    print('No')
    exit()

for item in l:
    can = [i for i, x in enumerate(t) if x == item]
    if len(can) > 1:
        d = [s[i] for i in can]
        if len(set(d)) != 1:
            print('No')
            exit()
print('Yes')


Failing test case input:
abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxjstdwgpzmonu

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

s = list(input())
t = list(input())

l='abcdefghijklmnopqrstuvwxyz'

for item in l:
    can = [i for i, x in enumerate(t) if x == item]

    if len(can) > 1:
        d = [s[i] for i in can]
        if len(set(d)) != 1:
            print('No')
            exit()
for item in l:
    can = [i for i, x in enumerate(s) if x == item]

    if len(can) > 1:
        d = [t[i] for i in can]
        if len(set(d)) != 1:
            print('No')
            exit()
print('Yes')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("NO")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("Yes") if ss == t else print("No")


Failing test case input:
cvhpjjd`
ddcoccsr

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("No")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("Yes") if ss == t and len(list(stock.keys())) == len(list(stock.values())) else print("No")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import collections

s = list(map(str,input()))
t = list(map(str,input()))
cnts = collections.Counter(s)
cntt = collections.Counter(t)
cs = sorted(cnts.values())
ct = sorted(cntt.values())

print(cs)
print(ct)

if len(s) != len(t):
    print("No")
    sys.exit()

for i,j in zip(cs,ct):
    if i != j:
        print("No")
        sys.exit()

print("Yes")

Failing test case input:
ihokudac
redcoder

Expected output:
No


Actual output:
[1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 2, 2, 2]
No


Fixed submission (verdict: Accepted):
import sys
import collections

s = list(map(str,input()))
t = list(map(str,input()))
cnts = collections.Counter(s)
cntt = collections.Counter(t)
cs = sorted(cnts.values())
ct = sorted(cntt.values())

if len(s) != len(t):
    print("No")
    sys.exit()

for i,j in zip(cs,ct):
    if i != j:
        print("No")
        sys.exit()

print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def d(s,t):
    s1=list(set([i for i in s]))
    t1=list(set([i for i in t]))
    ans='No'
    st=list(set(s1+t1))
    
    
    if (len(st)-len(s1))%2!=0 or len(st)-len(s1)==0:
        ans='Yes'
    return ans
print(d(input(),input()))

Failing test case input:
abcdzfgiijklmnopqrstuvwxye
xbyhlfuekavcqikstdwgpznonr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def d(s,t):
    s1=list(set([i for i in s]))
    t1=list(set([i for i in t]))
    ans='No'
    st=set(zip(s,t))
    if len(st)-len(s1)==0 and len(st)-len(t1)==0:
        ans='Yes'
    return ans
print(d(input(),input()))
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
U = {}
for s, t in zip(S, T):
    if s == t:
        continue
    else:
        if U.get(s):
            if U[s] != t:
                print('No')
                exit()
        if U.get(t):
            if U[t] != s:
                print('No')
                exit()
        else:
            U[s] = t
            U[t] = s
print('Yes')


Failing test case input:
elyza
apqld

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
T = input()
dict1 = {}
dict2 = {}

for s,t in zip(S,T):
    if s in dict1:
        if dict1[s] == t:
            pass
        else:
            print('No')
            exit()
    else:
        dict1[s] = t
    if t in dict2:
        if dict2[t] == s:
            pass
        else:
            print('No')
            exit()
    else:
        dict2[t] = s
print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = input()
    t = input()

    d = dict()
    for i in range(len(s)):
        if s[i] != t[i]:
            if t[i] not in d:
                d[t[i]] = s[i]
            else:
                if d[t[i]] != s[i]:
                    print("No")
                    return
    print("Yes")

if __name__ == "__main__":
    main()

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
    s = input()
    t = input()

    dt = dict()
    ds = dict()
    for i in range(len(s)):
        if t[i] not in dt:
            dt[t[i]] = s[i]
        else:
            if dt[t[i]] != s[i]:
                print("No")
                return

        if s[i] not in ds:
            ds[s[i]] = t[i]
        else:
            if ds[s[i]] != t[i]:
                print("No")
                return

    print("Yes")

if __name__ == "__main__":
    main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s1 = input()
s2 = input()
if len(s1) != len(s2):
    print("No")
else:
    D1 = {}
    D2 = {}
    flag = True
    for x, y in zip(s1, s2):
        if x not in D1:
            D1[x] = y
        else:
            flag = (flag and (D1[x] == [y]))
        if y not in D2:
            D2[y] = x
        else:
            flag = (flag and (D2[y] == [x]))
        if not flag:
            break
    if flag:
        print("Yes")
    else:
        print("No")

Failing test case input:
azzel
apple

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s1 = input()
s2 = input()
if len(s1) != len(s2):
    print("No")
else:
    D1 = {}
    D2 = {}
    flag = True
    for x, y in zip(s1, s2):
        if x not in D1:
            D1[x] = y
        else:
            flag = (flag and (D1[x] == y))
        if y not in D2:
            D2[y] = x
        else:
            flag = (flag and (D2[y] == x))
        if not flag:
            break
    if flag:
        print("Yes")
    else:
        print("No")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

S = str(input())
T = str(input())

s_counter = Counter(S)
t_counter = Counter(T)




dict_S_to_T = {}
dict_T_to_S = {}

for s, t in zip(S, T):
    if s != t:
        dict_S_to_T[s] = t
        dict_T_to_S[t] = s


flag = True
for k, v in dict_S_to_T.items():
    if dict_T_to_S[v] != k and (s_counter[k]+s_counter[v] != t_counter[k]+t_counter[v]):
        flag = False

if flag:
    print('Yes')
else:
    print('No')


Failing test case input:
azzle
dlqpa

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter

S = str(input())
T = str(input())

s_counter = Counter(S)
t_counter = Counter(T)




dict_S_to_T = {}
dict_T_to_S = {}

for s, t in zip(S, T):
    if s not in dict_S_to_T.keys():
        dict_S_to_T[s] = t
    else:
        if dict_S_to_T[s] != t:
            print('No')
            exit()
    if t not in dict_T_to_S.keys():
        dict_T_to_S[t] = s
    else:
        if dict_T_to_S[t] != s:
            print('No')
            exit()

print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

d = dict()
for i, c in enumerate(T):
    if d.get(c) is None:
        d[c] = [i]
    else:
        d[c].append(i)

for c, indices in d.items():
    if len(indices) < 2:
        continue
    s_slice = list(map(lambda i: S[i], indices))
    if any([s_slice[0] != s_i for s_i in s_slice]):
        print('No')
        exit(0)
print('Yes')

Failing test case input:
azzel
aople

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()

d = dict()
dst = set()
for i, c in enumerate(S):
    if d.get(c) is None:
        if T[i] not in dst:
            d[c] = T[i]
            dst.add(T[i])
        else:
            print('No')
            exit(0)
    elif d[c] == T[i]:
        continue
    else:
        print('No')
        exit(0)
print('Yes')
Problem: p03252
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
T = input()

for i in range(26):
  c = chr(ord('a')+i)
  idx1 = [i for i, x in enumerate(T) if x == c]
  st1 = set([])
  idx2 = [i for i, x in enumerate(S) if x == c]
  st2 = set([])
  
  for j in idx1:
    if S[j] not in st1 and len(st1) > 0:
      print('NO')
      exit()
    elif len(st1) == 0:
      st1.add(S[j])
  for j in idx2:
    if S[j] not in st2 and len(st2) > 0:
      print('NO')
      exit()
    elif len(st2) == 0:
      st2.add(S[j])
      
print('YES')

Failing test case input:
elyza
dlqpa

Expected output:
Yes


Actual output:
YES


Fixed submission (verdict: Accepted):
S = input()
T = input()

sts = set(S)
stt = set(T)

for i in range(26):
  c = chr(ord('a')+i)
  idx1 = [i for i, x in enumerate(T) if x == c]
  st1 = set([])
  idx2 = [i for i, x in enumerate(S) if x == c]
  st2 = set([])
  
  for j in idx1:
    if S[j] not in st1 and len(st1) > 0:
      print('No')
      exit()
    elif len(st1) == 0:
      st1.add(S[j])
  for j in idx2:
    if T[j] not in st2 and len(st2) > 0:
      print('No')
      exit()
    elif len(st2) == 0:
      st2.add(T[j])
      
print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
trans_dict = dict()
flg = 0
for s, t in zip(S, T):
    if s == t:
        continue
    else:
        if trans_dict.get(s) is None:
            trans_dict[s] = t
            S.replace(s, t)
        elif trans_dict.get(s) == t:
            continue
        else:
            flg = 1
            break
if flg == 1:
    print("No")
else:
    print("Yes")

Failing test case input:
caduojhi
rddcoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
trans_dict = dict()
trans_dict_ = dict()
flg = 0
for s, t in zip(S, T):
    if trans_dict.get(s) is None:
        trans_dict[s] = t
    elif trans_dict.get(s) == t:
        continue
    else:
        flg = 1
        break
    if trans_dict_.get(t) is None:
        trans_dict_[t] = s
    elif trans_dict.get(t) == s:
        continue
    else:
        flg = 1
        break
if flg == 1:
    print("No")
else:
    print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
d = {}
for i in range(len(s)):
  if t[i] in d:
    if d[t[i]] != s[i]:
      print("No")
      break
  else:
    d[t[i]] = s[i]
else:
  print("Yes")


Failing test case input:
azzle
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()
d = {}
d2 = {}
for i in range(len(s)):
  if t[i] in d:
    if d[t[i]] != s[i]:
      print("No")
      break
  if s[i] in d2:
    if d2[s[i]] != t[i]:
      print("No")
      break
  else:
    d[t[i]] = s[i]
    d2[s[i]] = t[i]
else:
  print("Yes")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
s = input()
t = input()
dic = defaultdict(int)
trans = defaultdict(int)
for i in range(len(t)):
  c = t[i]
  m = s[i]
  if trans[c]==0:
    trans[c] = m
  elif trans[c] != m:
    print('No')
    break
else:
  print('Yes')

Failing test case input:
zyxwvutsrqpnnmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict
s = input()
t = input()
S = defaultdict(list)
T = defaultdict(list)
trans = defaultdict(int)
for i in range(len(t)):
  c = t[i]
  m = s[i]
  if T[c]==[]:
    T[c] = i
  if S[m]==[]:
    S[m] = i
  if T[c]!= S[m]:
    print('No')
    break
else:
  print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
TS = list(zip(T, S))

TS_set = set()
for x in TS:
  TS_set.add(x)

S_set = set()
for x in TS_set:
  S_set.add(x[1])

print("Yes" if len(S_set) == 26 and S == T or len(TS_set) == len(S_set) else "No")


Failing test case input:
cadukohi
redcoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
TS = list(zip(T, S))

TS_set = set()
for t,s in TS:
  TS_set.add((t,s))

S_set = set()
for x in TS_set:
  S_set.add(x[1])

T_set = set()
for x in TS_set:
  T_set.add(x[0])

print("Yes" if S == T or len(TS_set) == len(S_set) == len(T_set) else "No")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()


ans = "Yes"

for i in range(0,len(S)):
  for j in range(0,i):
    if S[j] == S[i]:
      if T[i] == T[j]:
        continue
      else:
        ans = "No"
        break
    if T[j] == T[i]:
      if S[j] == S[i]:
        continue
      else:
        ans == "No"

print(ans)

Failing test case input:
ihokudac
redcoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()

ans = "Yes"
 
for i in range(0,len(S)):
  for j in range(0,i):
    if S[j] == S[i]:
      if T[i] != T[j]:
        ans = "No"
        break
      break
    if T[j] == T[i]:
      if S[j] != S[i]:
        ans = "No"
        break
      break
print(ans)

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
t=input()

st=[]
for i in range(len(s)):
    st.append([s[i],t[i]])

st.sort()

    
yesno="Yes"
for i in range(len(st)-1):
    sj,tj=st[len(st)-i-1]
    sk,tk=st[len(st)-i-2]
    if sj==sk and tj!=tk:
        yesno="No"
        break
    
print(yesno)


Failing test case input:
abcdefghijklmnopqrstuvwxyz
unonhpgwdtskxlcvakerfqzybi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
t=input()

st=[]
ts=[]
for i in range(len(s)):
    st.append([s[i],t[i]])
    ts.append([t[i],s[i]])

st.sort()
ts.sort()

    
yesno="Yes"
for i in range(len(st)-1):
    sj,tj=st[len(st)-i-1]
    sk,tk=st[len(st)-i-2]
    if sj==sk and tj!=tk:
        yesno="No"
        break
    tj,sj=ts[len(ts)-i-1]
    tk,sk=ts[len(ts)-i-2]
    if tj==tk and sj!=sk:
        yesno="No"
        break
    
print(yesno)
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

S = Counter(list(input()))
T = Counter(list(input()))
s,t = list(S.values()),list(T.values())
print(["No", "Yes"][(s.sort() == t.sort()) or (len(s) % 2 == 0)])

Failing test case input:
cjduoahi
redcoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter

S = Counter(list(input()))
T = Counter(list(input()))
s,t = list(S.values()),list(T.values())
print(["No", "Yes"][Counter(s) == Counter(t)])

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

S = Counter(list(input()))
T = Counter(list(input()))
s,t = list(S.values()),list(T.values())
print(["No", "Yes"][(s.sort() == t.sort()) or (len(s) % 2 != 0)])

Failing test case input:
`djcohvj
rscdoded

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter

S = Counter(list(input()))
T = Counter(list(input()))
s,t = list(S.values()),list(T.values())
print(["No", "Yes"][Counter(s) == Counter(t)])

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input=sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()
    A = [[] for i in range(26)]
    for i,c in enumerate(T):
        a = A[ord(c)-ord("a")]
        if len(a) == 0:
            a.append(S[i])
        elif len(a) == 1 and S[i] in a:
            pass
        else:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()


Failing test case input:
azzel
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
input=sys.stdin.readline

def main():
    S = input().strip()
    T = input().strip()
    a = [set() for i in range(26)]
    for i,c1 in enumerate(S):
        s = a[ord(c1)-ord("a")]
        s |= set(T[i])
        if len(s) >= 2:
            print("No")
            return
    a = [set() for i in range(26)]
    for i,c1 in enumerate(T):
        s = a[ord(c1)-ord("a")]
        s |= set(S[i])
        if len(s) >= 2:
            print("No")
            return
        
    print("Yes")

if __name__ == '__main__':
    main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
a = b = {}
for c, d in zip(s, t) :
    if a.setdefault(c, d) != d : print("No") ; break
    if b.setdefault(d, c) != c : print("No") ; break
else : print("Yes")

Failing test case input:
azyle
dlqpb

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()
a = {} ; b = {}
for c, d in zip(s, t) :
    if a.setdefault(c, d) != d : print("No") ; break
    if b.setdefault(d, c) != c : print("No") ; break
else : print("Yes")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

flag = True
translate1 = [-1 for i in range(26)]
translate2 = [-1 for i in range(26)]
for i in range(len(S)):
    s = ord(S[i])-97
    t = ord(T[i])-97

    if translate1[s] == -1:
        translate1[s] = t
    else:
        if translate1[s] != t:
            flag = False
            break 

    if translate2[t] == -1:
        translate2[t] = s
    else:
        if translate2[t] != s:
            flag = False
            break


if flag:
    print('YES')
else:
    print('NO')

Failing test case input:
caduojhi
redcoder

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
T = input()

flag = True
translate1 = [-1 for i in range(26)]
translate2 = [-1 for i in range(26)]
for i in range(len(S)):
    s = ord(S[i])-97
    t = ord(T[i])-97

    if translate1[s] == -1:
        translate1[s] = t
    else:
        if translate1[s] != t:
            flag = False
            break 

    if translate2[t] == -1:
        translate2[t] = s
    else:
        if translate2[t] != s:
            flag = False
            break


if flag:
    print('Yes')
else:
    print('No')

Problem: p03252
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict
s = input()
t = input()
n = len(s)

d = defaultdict(str)

for i in range(n):
    if d[t[i]] == "":
        d[t[i]] = s[i]
    elif d[t[i]] != s[i]:
        print("No")
        exit()
print("Yes")


Failing test case input:
azzel
aople

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict
s = input()
t = input()
n = len(s)

d = defaultdict(str)



for i in range(n):
    if d[t[i]] == "":
        d[t[i]] = s[i]
    elif d[t[i]] != s[i]:
        print("No")
        exit()
d.clear()
for i in range(n):
    if d[s[i]] == "":
        d[s[i]] = t[i]
    elif d[s[i]] != t[i]:
        print("No")
        exit()

print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict

d1=defaultdict(lambda:'AA')
d2=defaultdict(lambda:'AA')
S=input()
T=input()
flag =True
for i in range(len(S)):
	if d1[S[i]]!='AA':
		if d1[S[i]] != T[i]:
			flag = False
			break
	d1[S[i]]=T[i]

if flag:
	print('Yes')
else:
	print('No')

Failing test case input:
cvhpjjda
decoccsr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict

d1=defaultdict(lambda:'AA')
d2=defaultdict(lambda:'AA')
S=input()
T=input()
flag =True
for i in range(len(S)):
	if d1[S[i]]!='AA':
		if d1[S[i]] != T[i]:
			flag = False
			break
	if d2[T[i]]!='AA':
		if d2[T[i]]!=S[i]:
			flag =False
			break
	d1[S[i]]=T[i]
	d2[T[i]]=S[i]
if flag:
	print('Yes')
else:
	print('No')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
def main():
    S = input()
    T = input()

    s_dict = defaultdict(list)
    t_dict = defaultdict(list)

    for ch_s, ch_t in zip(S, T):
        s_dict[ch_s].append(ch_t)
        t_dict[ch_t].append(ch_s)

    for value in s_dict.values():
        if len(value) >= 2:
            print('No')
            return

    for value in t_dict.values():
        if len(value) >= 2:
            print('No')
            return

    print('Yes')
    return


main()

Failing test case input:
azzel
apple

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    S = input()
    T = input()

    s_dict = {}
    t_dict = {}

    for ch_s, ch_t in zip(S, T):
        if ch_t in t_dict.keys():
            if t_dict[ch_t] != ch_s:
                print("No")
                return
        else:
            t_dict[ch_t] = ch_s

        if ch_s in s_dict.keys():
            if s_dict[ch_s] != ch_t:
                print("No")
                return
        else:
            s_dict[ch_s] = ch_t
        
        

    print('Yes')
    return


main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
l = [[] for _ in range(26)]
for k, c in enumerate([chr(ord("a") + i) for i in range(26)]):
    for i,t in enumerate(T):
        if t == c:
            l[k].append(i)

for a in l:
    if len(a) <= 1:
        continue
    prop = S[a[0]]
    for i in a:
        if prop != S[i]:
            print("No")
            exit()
print("Yes")

Failing test case input:
azzle
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()

def fix(T,S):
    l = [[] for _ in range(26)]
    for k, c in enumerate([chr(ord("a") + i) for i in range(26)]):
        for i,t in enumerate(T):
            if t == c:
                l[k].append(i)

    for a in l:
        if len(a) <= 1:
            continue
        prop = S[a[0]]
        for i in a:
            if prop != S[i]:
                print("No")
                exit()

fix(T,S)
fix(S,T)

print("Yes")

Problem: p03252
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = memo.values()
if set(a) != len(a):
    ans = 'No'
print(ans)

Failing test case input:
azyle
bpqld

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()
memo = {}
ans = 'Yes'
for i in range(len(s)):
    if s[i] in memo:
        if t[i] != memo[s[i]]:
            ans = 'No'
            break
    else:
        memo[s[i]] = t[i]
a = list(memo.values())
b = list(set(a))
if len(b) != len(a):
    ans = 'No'
print(ans)
Problem: p03252
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






S = input()
T = input()





myset = set(T)
for x in myset:
    mylist = [i for i in range(len(T)) if T[i] == x]
    if len(mylist) > 0:
        tmp = S[mylist[0]]
        for j in mylist[1:]:
            if S[j] != tmp:
                print("No")
                break
        else:
            continue
        break
else:
    print("Yes")









Failing test case input:
elzza
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):






S = input()
T = input()





mydict = {}
for i in range(len(S)):
    if S[i] in mydict:
        if T[i] != mydict[S[i]]:
            ans = "No"
            break
    else:
        mydict[S[i]] = T[i]
else:
    a = list(mydict.values())
    b = list(set(a))
    if len(b) != len(a):
        ans = "No"
    else:
        ans = "Yes"
print(ans)

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
t=str(input())
dic={}
li=[]
for i in range(len(s)):
    if s[i]!=t[i] and t[i] in li:
        if dic[t[i]]!=s[i]:
            print("No")
            break
    elif s[i]!=t[i]:
        if i==len(s)-1:
            print("Yes")
        else:
            dic.update([(t[i],s[i])])
            li.append(t[i])    
        
        

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S=str(input())
T=str(input())
x=[]
y=[]
dic={}

for i in range(len(S)):
    x.append(S[i])
    y.append(T[i])
    
for s,t in zip(x,y):
    if s in dic:
        if dic[s]!=t:
            print("No")
            exit()
    else:
        dic[s]=t

if len(dic)!=len(set(dic.values())):
    print("No")   
else:
    print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
t = str(input())

d = {}

c = 0
for i in range(len(s)):
  if s[i] not in d:
    d[s[i]] = c
    c += 1

d_ = {}
for i in range(len(t)):
  if t[i] not in d_:
    d_[t[i]] = d[s[i]]

s_ = ''
for i in range(len(s)):
  s_ += str(d[s[i]])

t_ = ''
for i in range(len(t)):
  t_ += str(d_[t[i]])

if s_ == t_:
  print('Yes')
else:
  print('No')
  

Failing test case input:
azzel
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = str(input())
t = str(input())

d = {}

c = 0
for i in range(len(s)):
  if s[i] not in d:
    d[s[i]] = c
    c += 1

d_ = {}
used = set()
for i in range(len(t)):
  if t[i] not in d_ and s[i] not in used:
    d_[t[i]] = d[s[i]]
    used.add(s[i])
  elif t[i] not in d_ and s[i] in used:
    print('No')
    exit()
  else:
    pass

for i in range(len(s)):
  if d[s[i]] != d_[t[i]]:
    print('No')
    exit()
else:
  print('Yes')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
d = defaultdict(str)

S = input()
T = input()

ans = "Yes"

for i in range(len(S)):
  if S[i] == T[i]:
    continue

  d[S[i]] = T[i]

li = []

for i in d:
  if i in li:
    ans = 'No'
    break

  li.append(i)
  
li = []
  
for i in d:
  if d[i] in li:
    ans = 'No'
    break
    
  li.append(d[i])

print(ans)

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict
d = defaultdict(str)
k = defaultdict(str)

S = input()
T = input()

ans = "Yes"

for i in range(len(S)):
  if d[S[i]] and d[S[i]] != T[i]:
    ans = 'No'
    break

  if k[T[i]] and k[T[i]] != S[i]:
    ans = 'No'
    break

  d[S[i]] = T[i]
  k[T[i]] = S[i]

print(ans)

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if t[i] not in dic:
        dic[t[i]]=s[i]
    
    if s[i]==t[i]:
        if dic[t[i]]==t[i]:
            continue
        else:
            ans='No'
            break

    else:
        if dic[t[i]]==s[i]:
            continue
        else :
            ans='No'
            break

print(ans)

Failing test case input:
zyxwvutsrqpnnmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
t=input()
n=len(s)

dic={}
ans='Yes'
for i in range(n):
    if t[i] not in dic:
        dic[t[i]]=s[i]
    
    else:
        if dic[t[i]]==s[i]:
            continue
        else :
            ans='No'
            break
    
if len(dic)!=len(set(dic.values())):
    ans='No'
print(ans)

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("NO")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("YES") if ss == t else print("NO")


Failing test case input:
azzel
apple

Expected output:
Yes

Actual output:
YES


Fixed submission (verdict: Accepted):
import collections as C
import sys
s = input()
t = input()

if len(set(s)) != len(set(t)):
    print("No")
    sys.exit()

ans = [0] * len(s)
stock = C.Counter([])
for i in range(len(s)):
    if s[i] not in stock.keys():
        stock[s[i]] = t[i]
    ans[i] = stock[s[i]]

ss = "".join(ans)

print("Yes") if ss == t and len(list(stock.keys())) == len(list(stock.values())) else print("No")
Problem: p03252
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s=list(input())
t=list(input())

import sys
dic_s={}
dic_t={}

for i in range(len(s)):
  a=dic_s.get(s[i],t[i])
  b=dic_t.get(t[i],s[i])
  if a!=t[i] or b!=s[i]:
    print(i,a,b)
    print("No")
    sys.exit()
  dic_s[s[i]]=t[i]
  dic_t[t[i]]=s[i]
print("Yes")



Failing test case input:
ihojudac
redcoder

Expected output:
No


Actual output:
5 d o
No


Fixed submission (verdict: Accepted):
s=list(input())
t=list(input())

import sys
dic_s={}
dic_t={}

for i in range(len(s)):
  a=dic_s.get(s[i],t[i])
  b=dic_t.get(t[i],s[i])
  if a!=t[i] or b!=s[i]:
    print("No")
    sys.exit()
  dic_s[s[i]]=t[i]
  dic_t[t[i]]=s[i]
print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

sc = ["" for i in range(0, 26)]
tc = ["" for i in range(0, 26)]
scf = False
tcf = False
for i in range(0, len(s)):
    sci = sc[ord(s[i]) - ord('a')]
    if sci != "" and t[i] != sci:
        print("No")
        scf = True
        break
    else:
        sc[ord(s[i]) - ord('a')] = t[i]

if not scf:
    for i in range(0, len(t)):
        tci = tc[ord(t[i]) - ord('a')]
        if tci != "":
            if t[i] == tci or t[i] == s[i]:
                print("No")
                tcf = True
                break
        else:
            tc[ord(t[i]) - ord('a')] = s[i]

    if not tcf:
        print("Yes")

Failing test case input:
abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxkstdwgpznonu

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()

sc = ["" for i in range(0, 26)]
tc = ["" for i in range(0, 26)]
scf = False
tcf = False
for i in range(0, len(s)):
    sci = sc[ord(s[i]) - ord('a')]
    if sci != "" and t[i] != sci:
        print("No")
        scf = True
        break
    else:
        sc[ord(s[i]) - ord('a')] = t[i]

if not scf:
    for i in range(0, len(t)):
        tci = tc[ord(t[i]) - ord('a')]
        if tci != "" and s[i] != tci:
            print("No")
            tcf = True
            break
        else:
            tc[ord(t[i]) - ord('a')] = s[i]
    if not tcf:
        print("Yes")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
t = input()
sd, td = {}, {}
for i in range(len(s)):
    if s[i] not in sd and t[i] not in td:
        sd[s[i]] = t[i]
        td[t[i]] = s[i]
    else:
        
        if s[i] in sd and t[i] in td:
            pass
        else:
            print("No")
            exit()

for k in sd.keys():
    if k in sd.values():
        print("No")
        exit()

print("Yes")


Failing test case input:
ayzel
apqle

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

s, t = input(), input()
sd, td = {}, {}
for i in range(len(s)):
    if t[i] not in td and s[i] not in sd:
        sd[s[i]] = t[i]
        td[t[i]] = s[i]
    elif t[i] in td and s[i] in sd and td[t[i]] == s[i] and sd[s[i]] == t[i]:
        continue
    else:
        print("No")
        exit()
print("Yes")