ZhenlongDai/ACPR huggingface dataset:
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()


if set(list(s)) != set(list(t)):
    print("No")
    exit()


d = dict()
for si, ti in zip(s, t):
    if si not in d:
        d[si] = ti
    else:
        if d[si] != ti:
            print("No")
            exit()
print("Yes")

Failing test case input:
azzle
appld

Expected output:
Yes


Actual output:
No


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


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


d = dict()
for si, ti in zip(s, t):
    if si not in d:
        d[si] = ti
    else:
        if d[si] != ti:
            print("No")
            exit()
print("Yes")

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

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes = [i for i, x in enumerate(S) if x == k1[0]]
                indexes2 = [i for i, x in enumerate(S) if x == k2[0]]
                if indexes != indexes2:
                    print('No')
            else:
                print('Yes')
else:
    print('No')






Failing test case input:
azyle
dlqpb

Expected output:
Yes


Actual output:
Yes
Yes
Yes
Yes
Yes


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

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])


indexes = []
indexes2 = []

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes.append(tuple([i for i, x in enumerate(S) if x == k1[0]]))
                indexes2.append(tuple([i for i, x in enumerate(T) if x == k2[0]]))
        if set(indexes) == set(indexes2):
            print('Yes')
        else:
            print('No')
else:
    print('No')
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:
elzza
apqle

Expected output:
No


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()

if len(S) != len(T):
    print("No")
    exit(0)

dic = {}
for s,t in zip(S,T):
    if s in dic:
        dic[s].add(t)
    else:
        dic[s] = set([t])

for key in dic.keys():
    if len(dic[key]) >= 2:
        print("No")
        exit(0)

print("Yes")


Failing test case input:
igjoudac
redcored

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = list(input())
T = list(input())
dic = {}

for s,t in zip(S,T):
    if s in dic:
        if dic[s] != t:
            print("No")
            exit(0)   
    else:
        dic[s] = t

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

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

diffCache = {}
for s, t in zip(S,T):
    if t in diffCache:
        if s not in diffCache[t]:
            diffCache[t].append(s)
    else:
        diffCache[t] = [s]

for k, v in diffCache.items():
    if len(v) > 1:
        if k in T:
            print('No')
            quit()
print('Yes')

Failing test case input:
azzel
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
    
dt = {}
ds = {}
for s, t in zip(S,T):
    if not t in dt:
        dt[t] = s
    else:
        if dt[t] != s:
            print('No')
            quit()

    if not s in ds:
        ds[s] = t
    else:
        if ds[s] != t:
            print('No')
            quit()
print('Yes')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()


s_idx = []
t_idx = []

def f(S):
    idx = []
    dic = []
    for s in S:
        if s in dic:
            idx.append(dic.index(s))
        else:
            idx.append(len(dic))
            dic.append(s)
    
    return idx

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

print("Yes")

Failing test case input:
zyxwvutsrqponmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
Yes


Actual output:
No


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

def f(S):
    idx = []
    dic = []
    for s in S:
        if s in dic:
            idx.append(dic.index(s))
        else:
            idx.append(len(dic))
            dic.append(s)
    
    return idx

s_idx = f(S)
t_idx = f(T)
for i in range(len(S)):
    if s_idx[i] != t_idx[i]:
        print("No")
        exit()

print("Yes")

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

S_list = []
T_list = []
print(S_list)
print(T_list)
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS > 0:
        S_list.append(SS)
    if TT > 0:
        T_list.append(TT)

if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')

Failing test case input:
`djcoivj
dedodcsr

Expected output:
No


Actual output:
[]
[]
No


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

S_list = []
T_list = []
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS > 0:
        S_list.append(SS)
    if TT > 0:
        T_list.append(TT)

if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def checkTrans(s, t):
    m = {}
    for sc, tc in zip(s, t):
        if tc in m:
            if m[tc] != sc:
                return False
        else:
            m[tc] = sc

    return True

s = input()
t = input()

if checkTrans(s, t):
    print('Yes')
else:
    print('No')


Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def checkTrans(s, t):
    ms = {}
    mt = {}
    for sc, tc in zip(s, t):
        if sc in ms:
            if ms[sc] != tc:
                return False
        else:
            ms[sc] = tc

        if tc in mt:
            if mt[tc] != sc:
                return False
        else:
            mt[tc] = sc

    return True

s = input()
t = input()

if checkTrans(s, t):
    print('Yes')
else:
    print('No')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

for i in range(len(s)):
    if s[i] != t[i]:
        be = s[i]
        af = t[i]
        for j in range(i, len(s)):
            if s[j] == be:
                s[j] = af
            elif s[j] == af:
                s[j] = be
    

print('Yes') if s == t else print('No')

Failing test case input:
adjcoivj
dedodcsr

Expected output:
No


Actual output:
Yes


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

mapping = {}
for i in range(len(s)):
    if s[i] in mapping:
        if mapping[s[i]] == t[i]:
            continue
        else:
            print('No')
            break
    elif t[i] in mapping.values():
        print('No')
        break
    else:
        mapping[s[i]] = t[i]
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 s[i]==t[i]:
    if s[i] not in d:
      d[s[i]]=0
for i in range(len(s)):
  if s[i]!=t[i]:
    if t[i] in d:
      print('No')
      exit()
print('Yes')

Failing test case input:
abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxkstdwgpznonu

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
t=input()
d={}
l=[]
for i in range(len(s)):
  if s[i] in d and d[s[i]]!=t[i]:
    print('No') 
    exit()
  d[s[i]]=t[i]
if len(d.values())!=len(set(d.values())):
  print('No')
  exit()
print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
S=input()
T=input()
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
if d[0][1]>=2 or c[0][1]>=2:
    e=['']*d[0][1]
    f=['']*c[0][1]
    for i in range(len(s)):
        if t[i]==d[0][0]:
            e.append(s[i])
    for i in range(len(e)-1):
        if e[i]!=e[i+1]:
            flag=False
    for i in range(len(s)):
        if s[i]==c[0][0]:
            f.append(t[i])
    for i in range(len(f)-1):
        if f[i]!=f[i+1]:
            flag=False
if flag:
    print('Yes')
else:
    print('No')

Failing test case input:
azzel
apple

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
from collections import Counter
S=input()
T=input()
s=list(S)
t=list(T)
a=Counter(s)
b=Counter(t)
c=a.most_common()
d=b.most_common()
flag=True
for i in range(min(len(d),len(c))):
    if d[i][1]==1 and c[i][1]==1:
        break
    if d[i][1]>=2 and flag:
        e=[]
        for j in range(len(s)):
            if t[j]==d[i][0]:
                e.append(s[j])
        for j in range(len(e)-1):
            if e[j]!=e[j+1]:
                flag=False
                break
    if c[i][1]>=2 and flag:
        f=[]
        for j in range(len(s)):
            if s[j]==c[i][0]:
                f.append(t[j])
        for j in range(len(f)-1):
            if f[j]!=f[j+1]:
                flag=False
                break
if flag:
    print('Yes')
else:
    print('No')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
S = (input())
T = (input())

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes = [i for i, x in enumerate(S) if x == k1[0]]
                indexes2 = [i for i, x in enumerate(T) if x == k2[0]]
                if indexes != indexes2:
                    print('No')
            else:
                print('Yes')
else:
    print('No')






Failing test case input:
abcdefghijklmnopqrstuvwxyz
unomzpgwdtsjxlcvakerfqhybi

Expected output:
Yes


Actual output:
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes


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

count1 = collections.Counter(S)
count2 = collections.Counter(T)

count1=sorted(count1.items(), key=lambda x: x[1])
count2=sorted(count2.items(), key=lambda x: x[1])


indexes = []
indexes2 = []

if len(S) == len(T):
    if len(count1) != len(count2):
        print('No')
    else:
        for k1, k2 in zip(count1, count2):
            if k1[1] > 1:
                indexes.append(tuple([i for i, x in enumerate(S) if x == k1[0]]))
                indexes2.append(tuple([i for i, x in enumerate(T) if x == k2[0]]))
        if set(indexes) == set(indexes2):
            print('Yes')
        else:
            print('No')
else:
    print('No')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=input()
d=dict()
ans="Yes"
for i in range(len(s)):
  if s[i] not in d:
    d[s[i]]=n[i]
  elif d[s[i]]!=n[i]:
    ans="No"
if s!=n and len(s)==26:
  ans="No"
print(ans)

Failing test case input:
ihojudac
reecoder

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
n=input()
d=dict()
dd=dict()
ans="Yes"
for i in range(len(s)):
  if s[i] not in d:
    d[s[i]]=n[i]
  elif d[s[i]]!=n[i]:
    ans="No"
  if n[i] not in dd:
    dd[n[i]]=s[i]
  elif dd[n[i]]!=s[i]:
    ans="No"
print(ans)
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
s = input()
t = input()

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    elif t[i] in d.keys():
        if s[i] == d[t[i]]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]
        d[t[i]] = s[i]

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

Failing test case input:
azyle
dlqpb

Expected output:
Yes


Actual output:
No


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

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    elif t[i] in d.values():
        if d.get(s[i]) == t[i]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]

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

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = list(input())
    t = list(input())
    n = len(s)
    logs = {}

    for i in range(n):
        c1 = s[i]
        c2 = t[i]

        if c1 == c2:
            continue

        if c1 not in logs:
            logs[c1] = 1
        else:
            logs[c1] += 1

        if c2 not in logs:
            logs[c2] = 1
        else:
            logs[c2] += 1

    for c in logs.values():
        if c % 2 > 0:
            print('No')
            exit()
    print('Yes')


main()


Failing test case input:
azyle
dlqpb

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
    s = list(input())
    t = list(input())
    n = len(s)
    memo1 = {}
    memo2 = {}

    for i in range(n):
        c1 = s[i]
        c2 = t[i]
        if c1 in memo1:
            if memo1[c1] != c2:
                print('No')
                exit()
        else:
            memo1[c1] = c2
        if c2 in memo2:
            if memo2[c2] != c1:
                print('No')
                exit()
        else:
            memo2[c2] = c1

    print('Yes')


main()

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

print('Yes')

Failing test case input:
zyxwvutsrqponmlkjihgfedcba
unonzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


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):
def solve(S, T):
    StoT = {}
    TtoS = {}
    for s, t in zip(S, T):
        print('----------------')
        print(s, t)
        if s not in StoT:
            StoT[s] = t
        if t not in TtoS:
            TtoS[t] = s
        
        if StoT[s] != t or TtoS[t] != s:
            return False
        print(StoT)
        print(TtoS)

    return True
        


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

bool = solve(S, T)
if bool:
    print('Yes')
else:
    print('No')


Failing test case input:
elzza
apqle

Expected output:
No


Actual output:
----------------
e a
{'e': 'a'}
{'a': 'e'}
----------------
l p
{'e': 'a', 'l': 'p'}
{'a': 'e', 'p': 'l'}
----------------
z q
{'e': 'a', 'l': 'p', 'z': 'q'}
{'a': 'e', 'p': 'l', 'q': 'z'}
----------------
z l
No


Fixed submission (verdict: Accepted):
def solve(S, T):
    StoT = {}
    TtoS = {}
    for s, t in zip(S, T):
        if s not in StoT:
            StoT[s] = t
        if t not in TtoS:
            TtoS[t] = s
        
        if StoT[s] != t or TtoS[t] != s:
            return False

    return True
        


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

bool = solve(S, T)
if bool:
    print('Yes')
else:
    print('No')

Problem: p03252
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
T = input()

def can_match(s, t):
  if len(s) != len(t):
    return False
  
  
  table = {}
  
  for i in range(len(s)):
    if not s[i] in table:
      table[s[i]] = t[i]
      table[t[i]] = s[i]
      
    if table[s[i]] != t[i]:
      return False    
 
  return True

if can_match(S, T):
  print('Yes')
else:
  print('No')

Failing test case input:
azyle
dlqpa

Expected output:
Yes


Actual output:
No


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

def can_match(s, t):
  fs = Counter(S)
  ft = Counter(T)
  
  if len(s) != len(t):
    return False
  
  for cs, ct in zip(s, t):
    
    if fs[cs] != ft[ct]:
      return False

  return True


S = input()
T = input()

if can_match(S, T):
  print('Yes')
else:
  print('No')
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
alphabet_pairs = [None] * 26

def convert_alphabet_to_int(s):
  return ord(s) - ord('a')


for i, s in enumerate(S):
  t = T[i]
  int_s = convert_alphabet_to_int(s)
  int_t = convert_alphabet_to_int(t)
  alphabet_pairs[int_s] = int_t
  alphabet_pairs[int_t] = int_s
print(alphabet_pairs)
new_T = ''
for i, s in enumerate(S):
  string = chr(ord('a') + alphabet_pairs[convert_alphabet_to_int(s)])
  print(string)
  new_T += string
print(new_T, T)
print(len(new_T), len(T))
if new_T == T:
  print('Yes')
else:
  print('No')
    
  

Failing test case input:
abcdefgiijklmnopqrstuvwxyz
ibyhqfrekavclxkstdwgpznonu

Expected output:
No


Actual output:
[9, 1, 11, 17, 8, 5, 19, 3, 10, 0, 14, 12, 11, 24, 23, 20, 19, 3, 22, 6, 25, 25, 13, 14, 13, 20]
j
b
l
r
i
f
t
k
k
a
o
m
l
y
x
u
t
d
w
g
z
z
n
o
n
u
jblriftkkaomlyxutdwgzznonu ibyhqfrekavclxkstdwgpznonu
26 26
No


Fixed submission (verdict: Accepted):
S = input()
T = input()
s_pairs = [-1] * 26
t_pairs = [-1] * 26

def convert_alphabet_to_int(s):
  return ord(s) - ord('a')


for i, s in enumerate(S):
  t = T[i]
  int_s = convert_alphabet_to_int(s)
  int_t = convert_alphabet_to_int(t)
  if s_pairs[int_s] >= 0:
    if s_pairs[int_s] != int_t:
      print('No')
      exit()
  else:
    s_pairs[int_s] = int_t
  
  if t_pairs[int_t] >= 0:
    if t_pairs[int_t] != int_s:
      print('No')
      exit()
  else:
    t_pairs[int_t] = int_s
print('Yes')

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

valid = True
for s, t in zip(S, T):
    if s not in SD.keys():
        SD[s] = t
    if t not in TD.keys():
        TD[t] = s
    else:
        if SD[s] != t:
            valid = False
            break
        if TD[t] != s:
            valid = False
            break

print('Yes' if valid else 'No') 


Failing test case input:
elzza
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
SD = dict()
TD = dict()

valid = True
for s, t in zip(S, T):
    if s not in SD.keys():
        SD[s] = t
    else:
        if SD[s] != t:
            valid = False
            break
    if t not in TD.keys():
        TD[t] = s
    else:
        if TD[t] != s:
            valid = False
            break

print('Yes' if valid else 'No')
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])    
    else:
      if i==len(s)-1:
        print("Yes")
        
        


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.8.2), verdict: Wrong Answer):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str, T: str):
    from collections import defaultdict
    d = defaultdict(set)
    for s, t in zip(S, T):
        d[t].add(s)
    return YES if max(map(len, d.values())) < 2 else NO


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    print(solve(S, T))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()


Failing test case input:
azzle
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str, T: str):
    from collections import defaultdict
    d1 = defaultdict(set)
    d2 = defaultdict(set)
    for s, t in zip(S, T):
        d1[t].add(s)
        d2[s].add(t)
    return YES if max(map(len, d1.values())) < 2 and max(map(len, d2.values())) < 2 else NO


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    print(solve(S, T))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S, T = input(), input()
ma, ima = {}, {}
ok = True
for i in range(len(S)):
    s, t = S[i], T[i]
    if s in ma and ma[s] != t:
        ok = False
    if t in ima and ima[t] != s:
        ok = False
if ok:
    print("Yes")
else:
    print("No")

Failing test case input:
cvhpjjd`
rsccocdd

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S, T = input(), input()
ma, ima = {}, {}
ok = True
for i in range(len(S)):
    s, t = S[i], T[i]
    if s in ma and ma[s] != t:
        ok = False
    if t in ima and ima[t] != s:
        ok = False
    ma[s] = t
    ima[t] = s
if ok:
    print("Yes")
else:
    print("No")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
T = list(input())

d = dict()
ans = True
for s, t in zip(S, T):
    if t not in d:
        d[t] = s
    else:
        if d[t] != s:
            ans = False
            break

print("Yes" if ans else "No")

Failing test case input:
azzle
apqle

Expected output:
No


Actual output:
Yes


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

sd = dict()
td = dict()
ans = True
for s, t in zip(S, T):
    if s not in sd:
        sd[s] = t
    else:
        if sd[s] != t:
            ans = False
            break

    if t not in td:
        td[t] = s
    else:
        if td[t] != s:
            ans = False
            break

print("Yes" if ans else "No")

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
if __name__ == '__main__':
    S = str(input())
    T = str(input())
    
    count = defaultdict(str)
    
    flag = True
    for i in range(len(S)):
        s = S[i]
        t = T[i]
        if count[t] != '':
            if count[t] != s:
                flag = False
        else:
            count[t] = s
    if flag:
        print('Yes')
    else:
        print('No')

Failing test case input:
elzza
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import defaultdict
if __name__ == '__main__':
    S = str(input())
    T = str(input())
    
    count = defaultdict(str)
    count2 = defaultdict(str)
    flag = True
    for i in range(len(S)):
        s = S[i]
        t = T[i]
        if count[t] != '':
            if count[t] != s:
                flag = False
        else:
            if count2[s] != '':
                if count2[s] != t:
                    flag = False
            else:
                count[t] = s
                count2[s] = t
    if flag:
        print('Yes')
    else:
        print('No')

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

d = {}
flag = True
for i in range(len(s)):
    if t[i] in d.keys():
        if s[i] == d[t[i]]:
            continue
        else:
            flag=False
            break
    else:
        if s[i] == t[i]:
            continue
        else:
            d[t[i]] = s[i]

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

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


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

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    elif t[i] in d.values():
        if d.get(s[i]) == t[i]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]

print("Yes" if flag else "No")
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:
ihojudac
redcoder

Expected output:
No


Actual output:
NO


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=str(input())
t=str(input())
temp=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s=list(set(s))
t=list(set(t))
temps=[0]*len(temp)
tempt=[0]*len(temp)
for i in range(0,len(temp)):
  temps[i]=s.count(temp[i])
  tempt[i]=t.count(temp[i])
temps.sort()
tempt.sort()
if temps==tempt:
  print("Yes")
else:
  print("No")

Failing test case input:
cvhpjjd`
rsccoced

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=str(input())
t=str(input())
temp=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s=list(s)
t=list(t)
temps=[0]*len(temp)
tempt=[0]*len(temp)
for i in range(0,len(temp)):
  temps[i]=s.count(temp[i])
  tempt[i]=t.count(temp[i])
temps.sort()
tempt.sort()
if temps==tempt:
  print("Yes")
else:
  print("No")

Problem: p03252
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s=input()
t=input()
n=len(s)
d={}
for i in range(n):
    ss=s[i]
    tt=t[i]
    if ss not in d:
        d[ss]=tt
    if ss in d and (ss,tt) not in d.items():
        print("No")
        exit()
    
print("Yes")

Failing test case input:
cvhpjjda
decoccsr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
t=input()
n=len(s)
d={}
for i in range(n):
    ss=s[i]
    tt=t[i]
    if ss in d and (ss,tt) not in d.items():
        print("No")
        exit()
    if tt in d.values() and (ss,tt) not in d.items():
        print("No")
        exit()
    if ss not in d:
        d[ss]=tt    
print("Yes")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    S = input()
    T = input()
    items = {}
    can = True
    for s, t in zip(S, T):
        if t in items:
            if items[t] == s:
                continue
            can = False
            break
        items[t] = s
    if can:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Failing test case input:
azzel
apqle

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
    S = input()
    T = input()
    items = {}
    items2 = {}
    can = True
    for s, t in zip(S, T):
        if s in items2:
            if items2[s] == t:
                continue
            can = False
            break
        if t in items:
            if items[t] == s:
                continue
            can = False
            break
        items[t] = s
        items2[s] = t
    if can:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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(TS_set) == len(S_set) else "No")


Failing test case input:
zyxwvutsrqponmlkjihgfedcba
unonzpgwdtsjxlcvakerfqhybi

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()

alpha = "abcdefghijklmnopqrstuvwxyz" 

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

for i in range(len(T)):
    if(S[i] != T[i]):
        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:
azzel
aople

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):
S = input()
T = input()
R_s = [-1] * 26
R_t = [-1] * 26
ans = 'Yes'

for i in range(len(S)):
  tmpS = ord(S[i]) - 97
  tmpT = ord(T[i]) - 97
  if R_s[tmpS] < 0:
    R_s[tmpS] = tmpT
  elif R_s[tmpS] != tmpT:
    ans = 'No'
  
  if R_t[tmpT] < 0:
    R_t[tmpT] = tmpS
  elif R_t[tmpT] != tmpS:
    ans = False

print(ans)

Failing test case input:
ihojudac
redcoder

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
S = input()
T = input()
R_s = [-1] * 26
R_t = [-1] * 26
ans = 'Yes'

for i in range(len(S)):
  tmpS = ord(S[i]) - 97
  tmpT = ord(T[i]) - 97
  if R_s[tmpS] < 0:
    R_s[tmpS] = tmpT
  elif R_s[tmpS] != tmpT:
    ans = 'No'
  
  if R_t[tmpT] < 0:
    R_t[tmpT] = tmpS
  elif R_t[tmpT] != tmpS:
    ans = 'No'

print(ans)

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

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    T = inputs[1]

    appeared = {}
    for i, _ in enumerate(S):
        if T[i] in appeared:
            if not appeared[T[i]] == S[i]:
                return "No"
        else:
            appeared[T[i]] = S[i]
    return "Yes"


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)


Failing test case input:
azzel
aople

Expected output:
No


Actual output:
Yes


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

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    T = inputs[1]

    appeared = {}
    appeared_count = {}
    for i, _ in enumerate(S):
        if T[i] in appeared:
            if not appeared[T[i]] == S[i]:
                return "No"
        else:
            appeared[T[i]] = S[i]
            if S[i] in appeared_count:
                appeared_count[S[i]] += 1
            else:
                appeared_count[S[i]] = 1
    for k, v in appeared_count.items():
        if v > 1:
            return "No"
    return "Yes"


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)
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)) <= 1 for i in a)
    g = all(len(set(i)) <= 1 for i in a)
    print("Yes" if f and g else "No")


if __name__ == '__main__':
    main()


Failing test case input:
uaicojhd
redndcdr

Expected output:
No


Actual output:
Yes


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):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    S = readstr()
    T = readstr()
    sl = dict()
    for i, s in enumerate(S):
        if s == T[i]:
            continue
        else:
            if s in sl.keys():
                if sl[s] != T[i]:
                    print('No')
                    sys.exit()
            elif s in sl.values():
                print('No')
                sys.exit()
            else:
                if T[i] in sl.values():
                    print('No')
                    sys.exit()
                else:
                    sl[s] = T[i]

    print('Yes')


if __name__ == "__main__":
    main()


Failing test case input:
azyle
elqpa

Expected output:
Yes


Actual output:
No


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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    S = readstr()
    T = readstr()

    sl = dict()
    tl = dict()
    for s, t in zip(S, T):
        if s not in sl:
            sl[s] = t
        else:
            if sl[s] != t:
                print('No')
                break

        if t not in tl:
            tl[t] = s
        else:
            if tl[t] != s:
                print('No')
                break
    else:
        print('Yes')


if __name__ == "__main__":
    main()
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
c2pos=dict()
s_c2pos = dict()

for ix, c in enumerate(S):
    if s_c2pos.get(c) == None:
        s_c2pos[c] = [ix]
    else:
        s_c2pos[c].append(ix)

for ix, c in enumerate(T):
    if c2pos.get(c) == None:
        c2pos[c] = [ix]
    else:
        c2pos[c].append(ix)

res = "Yes"

for k, v in c2pos.items():
    if len(v) <= 1:
        continue

    if len(set([S[_v] for _v in v])) != 1:
        res = "No"

    if s_c2pos[S[v[0]]] != v:
        res = "No"
    
print(res)


Failing test case input:
azzle
dlqpa

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
c2pos=dict()
s_c2pos = dict()

for ix, c in enumerate(S):
    if s_c2pos.get(c) == None:
        s_c2pos[c] = [ix]
    else:
        s_c2pos[c].append(ix)

for ix, c in enumerate(T):
    if c2pos.get(c) == None:
        c2pos[c] = [ix]
    else:
        c2pos[c].append(ix)

res = "Yes"

for k, v in c2pos.items():
    if len(v) < 1:
        continue

    if len(set([S[_v] for _v in v])) != 1:
        res = "No"

    if s_c2pos[S[v[0]]] != v:
        res = "No"
    
print(res)

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

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]

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

Failing test case input:
uaicojhd
redndcdr

Expected output:
No


Actual output:
Yes


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

d = {}
flag = True
for i in range(len(s)):
    if s[i] in d.keys():
        if t[i] == d[s[i]]:
            continue
        else:
            flag=False
            break
    elif t[i] in d.values():
        if d.get(s[i]) == t[i]:
            continue
        else:
            flag=False
            break
    else:
        d[s[i]] = t[i]

print("Yes" if flag else "No")
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

from sys import stdin
import re

s_in = lambda: stdin.readline()[:-1] 
d_in = lambda: int(stdin.readline()) 
ds_in = lambda: list(map(int, stdin.readline().split())) 

S = s_in()
T = s_in()
N = len(S)

rec = []
for i in range(N):
    if (S[i] != T[i]):
        S = re.sub(S[i], T[i], S) 
        if S[i] in rec:
            print('No')
            exit()
    rec.append(T[i])
print('Yes')


Failing test case input:
azzel
aople

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

from sys import stdin
import re

s_in = lambda: stdin.readline()[:-1] 
d_in = lambda: int(stdin.readline()) 
ds_in = lambda: list(map(int, stdin.readline().split())) 

S = s_in()
T = s_in()
N = len(S)

rec = []
idxes = [i for i in range(26)]

def alpnum(s):
    return ord(s) - ord('a')

for i in range(N):
    si = alpnum(S[i])
    ti = alpnum(T[i])
    if (idxes[si] != ti):
        if (idxes[si] in rec) or (ti in rec):
            print('No')
            exit()
        idx = idxes.index(ti)
        idxes[si], idxes[idx] = idxes[idx], idxes[si]
    rec.append(ti)
print('Yes')

Problem: p03252
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A = list(input())
B = list(input())
dic = {}
for i in range(len(A)):
    dic.setdefault(B[i], A[i])
    if dic.get(B[i]) != A[i]:
        print("No")
        exit()
print("Yes")

Failing test case input:
zyxwvutsrqpnnmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A = list(input())
B = list(input())
dicB = {}
dicA = {}
for i in range(len(A)):
    dicB.setdefault(B[i], A[i])
    dicA.setdefault(A[i], B[i])
    if dicB.get(B[i]) != A[i] or dicA.get(A[i]) != B[i]:
        print("No")
        exit()
print("Yes")

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

    d={}

    for i in range(len(s)):
        si=s[i]
        ti=t[i]
        if not si in d:
            d[si]=ti
        else:
            if d[si]==ti:
                continue
            else:
                return "No"
            
    vals=d.values()
    if len(vals)==len(set(vals)):
        return "Yes"
    else:
        return "No"
    

Failing test case input:
adjcovij
dedodcrr

Expected output:
No


Actual output:

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

    d={}

    for i in range(len(s)):
        si=s[i]
        ti=t[i]
        if not si in d:
            d[si]=ti
        else:
            if d[si]==ti:
                continue
            else:
                return "No"
            
    vals=d.values()
    if len(vals)==len(set(vals)):
        return "Yes"
    else:
        return "No"
print(check())
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
ans ='Yes'
d = {}
for i, (s, t) in enumerate(zip(S, T)):
    if s == t:
        continue
    if d.get(s) is not None or d.get(t) is not None:
        if d.get(s) != t or d.get(t) != s:
            ans = 'No'
            break
    d[s] = t
    d[t] = s
    
print(ans)

Failing test case input:
azyle
dlqpa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
T = input()
ans ='Yes'
d = {}
d2 = {}
for s, t in zip(S, T):

    if d.get(s) is not None:
        if d[s] != t:
            ans = 'No'
            break
    else:
        d[s] = t

    if d2.get(t) is not None:
        if d2[t] != s:
            ans = 'No'
            break
    else:
        d2[t] = s

print(ans)

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


S = list(input())
T = list(input())
same = "SAME"
s = set()
for i in range(len(S)):
    if not(S[i] in s):
        s.add(S[i])
        S[i] = i
    else:
        S[i] = same
s = set()
for i in range(len(T)):
    if not(T[i] in s):
        s.add(T[i])
        T[i] = i

    else:
        T[i] = same

print("YES" if T == S  else "NO")


Failing test case input:
`djcoivj
dedodcsr

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):


S = list(input())
T = list(input())
s = {}
for i in range(len(S)):
    if not(S[i] in s):
        s[S[i]] = i
        S[i] = i
    else:
        S[i] = s[S[i]]
s = {}
for i in range(len(T)):
    if not(T[i] in s):
        s[T[i]] = i
        T[i] = i
    else:
        T[i] = s[T[i]]
print("Yes" if T == S  else "No")

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

convert = dict()

bl = True
for s,t in zip(S,T):
  if s in convert and convert[s] != t:
    bl = False
    break
  convert[s] = t

print('Yes' if bl else 'No')

Failing test case input:
dacuojhi
redncddr

Expected output:
No


Actual output:
Yes


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

convert = dict()

bl = True
for s,t in zip(S,T):
  if s in convert and convert[s] != t:
    bl = False
    break
  convert[s] = t


after = convert.values()
if len(after) != len(set(after)):
  bl = False

print('Yes' if bl else 'No')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
R_s = [-1] * 26
R_t = [-1] * 26
ans = True

for i in range(len(S)):
  tmpS = ord(S[i]) - 97
  tmpT = ord(T[i]) - 97
  if R_s[tmpS] < 0:
    R_s[tmpS] = tmpT
  elif R_s[tmpS] != tmpT:
    ans = False
  
  if R_t[tmpT] < 0:
    R_t[tmpT] = tmpS
  elif R_t[tmpT] != tmpS:
    ans = False

print(ans)

Failing test case input:
uajcodhj
dedndcrr

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
S = input()
T = input()
R_s = [-1] * 26
R_t = [-1] * 26
ans = 'Yes'

for i in range(len(S)):
  tmpS = ord(S[i]) - 97
  tmpT = ord(T[i]) - 97
  if R_s[tmpS] < 0:
    R_s[tmpS] = tmpT
  elif R_s[tmpS] != tmpT:
    ans = 'No'
  
  if R_t[tmpT] < 0:
    R_t[tmpT] = tmpS
  elif R_t[tmpT] != tmpS:
    ans = 'No'

print(ans)
Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections as col

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

c1 = col.Counter(s)
c2 = col.Counter(t)

if set(c1.values()) == set(c2.values()):
    print('Yes')
else:
    print('No')

Failing test case input:
eyxwvutsrqponmlkjiigfzdcba
xbyhqfuekavclikstdwgpznonr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import collections as col

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

c1 = col.Counter(s)
c2 = col.Counter(t)

cv1 = sorted(c1.values())
cv2 = sorted(c2.values())

if cv1 == cv2:
    print('Yes')
else:
    print('No')

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

l=[]
for i,j in zip(s,t):
    l.append(i+j)

if len(set(l)) == ss:
    print("Yes")
else:
    print("No")


Failing test case input:
abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclykstdwgpznonu

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=list(input())
t=list(input())
ss=len(set(s))
tt=len(set(t))

l=[]
for i,j in zip(s,t):
    l.append(i+j)

if len(set(l)) == ss == tt:
    print("Yes")
else:
    print("No")

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

from collections import defaultdict

td = defaultdict(set)
for i in range(len(s)):
    if s[i] != t[i]:
        td[t[i]].add(s[i])

for key, value in td.items():
    if len(value) >= 2:
        print("No")
        break
else:
    print('Yes')

Failing test case input:
zyxwvutsrqpnnmlkjihgfedcba
unomzpgwdtsjxlcvakerfqhybi

Expected output:
No


Actual output:
Yes


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

from collections import defaultdict

td = defaultdict(set)
sd = defaultdict(set)
for i in range(len(s)):
        td[t[i]].add(s[i])
        sd[s[i]].add(t[i])

for tv, sv in zip(td.values(), sd.values()):
    if (len(tv) > 1) or (len(sv) > 1):
        print("No")
        break
else:
    print('Yes')

Problem: p03252
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
def check(a,b):
  for c in a:
    if a.count(c) > 1:
      m = [i for i, x in enumerate(a) if x == c]
      w = b[m[0]]
      for i in range(1,len(m)):
        if b[i] != w:
          return "No" 
  return "Yes"
ans = check(s,t)
if ans == "Yes" : ans = check(t,s)
print(ans)

Failing test case input:
azzle
apqld

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()
def check(a,b):
  l = []
  for c in a:
    if c in l:
      continue
    l.append(c)
    if a.count(c) > 1:
      m = [i for i, x in enumerate(a) if x == c]
      for i in range(1,len(m)):
        if b[m[i]] != b[m[0]]:
          return "No" 
  return "Yes"
ans = check(s,t)
if ans == "Yes" : ans = check(t,s)
print(ans)