TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
one=list(input())
#print(one)
two=list(input())

for num,i in enumerate(one):
    if i not in z:
        z[i]=[num]
    else:
        z[i].append(num)
p={}
for num,i in enumerate(two):
    if i not in p:
        p[i]=[num]
    else:
        p[i].append(num)
w=[]
#print(p)
#print(z)
for k,v in z.items():
    w.append(v)
o=[]
for k,v in p.items():
    o.append(v)
print("Yes") if w==o else print("No")

one=list(map(int,input().split()))

one.sort()
print(10*one[2]+one[1]+one[0])

Verdicts: Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
a,b,c=map(int,input())
print(9*max(a,b,c)+a+b+c)

a,b,c=map(int,input().split())
print(9*max(a,b,c)+a+b+c)

Verdicts: Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
lst = list(map(int,input().split()))
lst_2 = []
for i in range(len(lst)):
    lstt = lst
    x = lstt[i]
    del lstt[i]
    num = x + int("".join(lstt))
    lst_2.append(num)
print(max(lst_2))

lst = list(map(int,input().split()))
lst_2 = []
for i in range(len(lst)):
    lstt = lst
    x = lstt[i]
    del lstt[i]
    num = int(x) + int("".join(lstt))
    lst_2.append(num)
print(int(max(lst_2)))

import itertools
lst = list(map(str,input().split()))
lst1 = list(itertools.permutations(lst))

ans_array = []
for i in range(len(lst1)):
    num1 = int(lst1[i][0]+lst1[i][1]) + int(lst1[i][2])
    num2 = int(lst1[i][0]) + int(lst1[i][1]+lst1[i][2])
    ans_array.append(num1)
    ans_array.append(num2)
print(max(ans_array))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]

x_max = max(num_list[0])
y_max = max(num_list[1])

if x_max >= y_max:
    print('War')
elif x_max < X or y_max > Y:
    print('War')
else:
    print('No war')


N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(M)]

Z = list(range(X+1,Y+1))

for z in Z:
    if max(num_list[0]) < z and min(num_list[1]) >= z:
        print('No War')
        break
    if z == Z[-1]:
        print('War')

A,B,C = map(int, input().split())

num = sorted([A,B,C],reverse=True)
print(eval(str(num[0])+str(num[1])+'+'+str(num[2])))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
a , b , c = soted(map(int, input().split()))
print(c * 10 + b + a)

a , b , c = soted(map(int, input().split()))
print(a * 10 + b + c)

A = list(map(int,input().split()))
print(sum(A) - max(A) + max(A) * 10)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
a, b, c = map(int, input().split())
a, b, c = sorted([a, b, c])
print(c * 10 + b + c)


a, b, c = map(int, input().split())
a, b, c = sorted([a, b, c])
print(c * 10 + b + a)

Verdicts: Wrong Answer

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
a, b, c = reversed(input().split())
ans = eval(a + b) + int(c)
print(ans)

a, b, c = map(int, input().split())
ans = max(a*10+b+c, a+b*10+c, a+b+c*10)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
a = [int(i) for i in input().split())]
a.sort()
print(a[2]*10+a[1]+a[0])

a = [int(i) for i in input().split()]
a.sort()
print(a[2]*10+a[1]+a[0])

Verdicts: Runtime Error

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
#coding: utf-8
l=list(map(int,input().split()))
l.sort()
A=l[0]
B=l[1]
C=l[2]
print(10*A+B+C)

#coding: utf-8
l=list(map(int,input().split()))
l.sort()
C=l[0]
B=l[1]
A=l[2]
print(10*A+B+C)


Verdicts: Wrong Answer

Accepted
Problem: You have decided to give an allowance to your child depending on the outcome of the game that he will play now.  The game is played as follows:    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.   * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)   * Then, the amount of the allowance will be equal to the resulting value of the formula.  Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Submission attempts (in order):
buf=[int(x) for x in input().split()]

buf.sort

print(max(buf)*10+buf[1]+buf[0])

buf=[int(x) for x in input().split()]

buf.sort()

print(max(buf)*10+buf[1]+buf[0])

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s=input()
t=input()
n=len(s)
sabc={}
tabc={}
al=list("abcdefghijklmnopqrstuvwxyz")
for i in range(26):
  sabc[al[i]]=0
  tabc[al[i]]=0 
s=list(s)
t=list(t)
s.sort()
t.sort()
count=1
for i in range(n-1):
  if s[i]==s[i+1]:
    count+=1
  else:
    sabc[s[i]]=count
    count=1
    syu+=1
sabc[s[-1]]=count
count=1
syu=0
for i in range(n-1):
  if t[i]==t[i+1]:
    count+=1
  else:
    tabc[t[i]]=count
    count=1
    syu+=1
tabc[t[-1]]=count

for i in al:
  if tabc[i]!=0 and sabc!=0:
    if tabc[i]!=sabc[i]:
      print("No")
      count=-1
      break
if count!=-1:
  print("Yes")

s=input()
t=input()
d=dict()
flag=True
ds=set()
for i in range(len(s)):

  if not(t[i] in d):
    if s[i] in ds:
      flag=False
      break
    d[t[i]]=s[i]
    ds.add(s[i])
  else:
    if d[t[i]]!=s[i]:
      flag=False
      break
if flag:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s = np.array(list(input()))
t = np.array(list(input()))
num = 0
for i in set(t):
  if np.sum(s==i) == np.sum(t==i):
    num += 1
    continue
  if len(set(s[t==i])) == 1:
    num += 1
    continue
if num == len(set(t)):
  print("Yes")
else:
  print("No")

from collections import Counter
s = input()
t = input()

sc = Counter(s)
tc = Counter(t)

if sorted(sc.values()) == sorted(tc.values()):
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s = input()
target = input()
for index in xrange(len(s)):
    ss = s[index]
    tt = target[index]
	
    if s[:index] != target[:index]:
        break
    if ss == tt:
        continue
    else: 
        s = s.replace(ss,"0").replace(tt,ss).replace("0",tt)

if s == target:
    print("Yes")
else:
    print("No")

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

t_set = [tt for tt in set(t) if t.count(tt)>1]
for tt in list(t_set):
  index_num = [n for n, v in enumerate(s) if v == tt]
  
  s_id = []
  for index in index_num:
    s_id.append(s[index])
  
  if len(set(s_id)) == 1:
    continue
  else:
    print("No")
    break
else:
  print("Yes")


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

t_set = [tt for tt in set(t) if t.count(tt)>1]
for tt in list(t_set):
  index_num = [n for n, v in enumerate(s) if v == tt]
  
  s_id = []
  for index in index_num:
    if t[index] != s[index]:
      s_id.append(s[index])
  
  if len(set(s_id)) == 1:
    continue
  else:
    print("No")
    break
else:
  print("Yes")


#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str, T: str):
    table = {}
    for i in range(len(T)):
        if table.get(S[i]) == None:
            table[S[i]] = T[i]
        else:
            if table[S[i]] == T[i]:
                continue
            else:
                
                print(NO)
                return

    value_list = []
    for value in table.values():
        value_list.append(value)
        
    
    if len(set(value_list)) == len(table):
        print(YES)
    else:
        print(NO)

    return

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

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):

import collections
import copy
a=collections.Counter([x for x in input()])
b=collections.Counter([x for x in input()])
c=sorted(list(a.values()))
d=sorted(list(b.values()))
x=[]
x.append(c)
def join(c):
    for i in range(0,len(c)):
        for j in range(0,i):
            if i != j :
                l= copy.copy(c)
                l.remove(c[i])
                l.remove(c[j])
                l.append(c[i]+c[j])
                x.append(sorted(l))
                if len(l)!=1:
                    join(l)
join(c)
arr = list(map(list,set(map(tuple, x))))
print(arr)
for k in arr:
    if k == d:
        print("Yes")
        exit()
print("No")


S = list(input())
T = list(input())
L = []
M = []
al = list('abcdefghijklmnopqrstuvwxyz')

for i in range(len(al)):
    l = []
    for j in range(len(S)):
        if al[i] == S[j]:
            l.append(j)
        else:
            pass
    L.append(l)
i = 0
for i in range(len(al)):
    l = []
    for j in range(len(T)):
        if al[i] == T[j]:
            l.append(j)
        else:
            pass
    M.append(l)
if sorted(L)==sorted(M):
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
import sys

s = input()
t = input()

def replacement(word, a, b):
    return word.replace(a, "0").replace(b, a).replace("0", b)

yet_list = []
for i in range(len(s)):
    if s[i] in yet_list:
        print("No")
        sys.exit()
    if s[i] != t[i]:
        if not s[i] in yet_list:
            s = replacement(s, s[i], t[i])
            yet_list.append(s[i])
            yet_list.append(t[i])
if s == t:
    print("Yes")
else:
    print("No")

import sys
s = input()
t = input()
yetlist = {}
yetlist2 = {}
for i in range(len(s)):
    if s[i] in yetlist:
        if t[i] != yetlist[s[i]]:
            print("No")
            sys.exit()
    else:
        yetlist[s[i]] = t[i]
    if t[i] in yetlist2:
        if s[i] != yetlist2[t[i]]:
            print("No")
            sys.exit()
    else:
        yetlist2[t[i]] = s[i]   
            
print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
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')


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]
#    print(can)
    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]
#    print(can)
    if len(can) > 1:
        d = [t[i] for i in can]
        if len(set(d)) != 1:
            print('No')
            exit()
print('Yes')


Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
def main():
    S = input()
    T = input()

    DICT = {}

    for ch_s, ch_t in zip(S, T):
        #print(ch_s, ch_t)
        if ch_s in DICT.keys():
            #print('swap')
            ch_s = DICT[ch_s]

        if ch_t in DICT.values():
            #print(DICT)
            print(ch_s, ch_t, DICT[ch_t])
            if DICT[ch_t] != ch_t:
                print('No')
                return
        DICT[ch_s] = ch_t
    print('Yes')
    return


main()

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

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

    DICT = {}

    for ch_s, ch_t in zip(S, T):
        #print(DICT)
        if ch_t in DICT.keys():
            #print(ch_t)
            if DICT[ch_t] != ch_t:
                print('No')
                return
        DICT[ch_t] = ch_s
    print('Yes')
    return


main()

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

    DICT = {}

    for ch_s, ch_t in zip(S, T):
        #print(DICT)
        if ch_t in DICT.values():
            print('No')
            return
        DICT[ch_s] = ch_t
    print('Yes')
    return


main()

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

    DICT = {}

    for ch_s, ch_t in zip(S, T):
        print(DICT)
        if ch_t in DICT.keys():
            print(ch_t)
            if DICT[ch_t] != ch_t:
                print('No')
                return
        DICT[ch_t] = ch_s
    print('Yes')
    return


main()

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("s",s_dict)
        #print("t",t_dict)

    print('Yes')
    return


main()

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
S = input()
T = input()

x = defaultdict(list)

for i, t in enumerate(T):
    x[t].append(S[i])

ok = True
for k, v in x.items():
    a = v[0]
    for c in v:
        if c != a:
            ok = False
            break
if ok:
    print("Yes")
else:
    print("No")


import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

S = input()
T = input()

x = defaultdict(list)
y = defaultdict(list)

for i, t in enumerate(T):
    x[t].append(S[i])

for i, s in enumerate(S):
    y[s].append(T[i])

ok = True
for k, v in x.items():
    a = v[0]
    for c in v:
        if c != a:
            ok = False
            break

for k, v in y.items():
    a = v[0]
    for c in v:
        if c != a:
            ok = False
            break

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


Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
# coding:utf-8



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

Sdic = [0 for _ in range(26)]
Tdic = [0 for _ in range(26)]

alphabet = ['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']

Able = True

for i in range(len(S)):
    si = S[i]
    ti = T[i]
    if Sdic[alphabet.index(si)] == 0:
        Sdic[alphabet.index(si)] = ti
    elif Sdic[alphabet.index(si)] != 0:
        if Sdic[alphabet.index(si)] == ti:
            pass
        else:
            Able = False
            break
    elif Tdic[alphabet.index(ti)] == 0:
        Tdic[alphabet.index(ti)] = si
    elif Tdic[alphabet.index(ti)] != 0:
        if Tdic[alphabet.index(ti)] == si:
            pass
        else:
            Able = False
            break

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



# coding:utf-8



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

Sdic = [0 for _ in range(26)]
Tdic = [0 for _ in range(26)]

alphabet = ["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"]

Able = True

for i in range(len(S)):
    si = S[i]
    ti = T[i]
    if Sdic[alphabet.index(si)] == 0:
        Sdic[alphabet.index(si)] = ti
    elif Sdic[alphabet.index(si)] != ti:
        Able = False
        break
    if Tdic[alphabet.index(ti)] == 0:
        Tdic[alphabet.index(ti)] = si
    elif Tdic[alphabet.index(ti)] != si:
        Able = False
        break
        
print("Yes" if Able else "No")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
import collections

s = input()
t = input()
c1 = collections.Counter(s)
c2 = collections.Counter(t)
s_values = sorted(list(c1.values()))
t_values = sorted(list(c2.values()))

if len(s) == len(t):
  if len(list(set(s))) == len(list(set(t))):
    if s_values == v_values():
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

import collections

s = input()
t = input()
c1 = collections.Counter(s)
c2 = collections.Counter(t)
s_values = sorted(list(c1.values()))
t_values = sorted(list(c2.values()))

if len(s) == len(t):
  if len(list(set(s))) == len(list(set(t))):
    if s_values == t_values:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=[0]*26
for i in range(len(s)):
  if a[ord(s[i])]==0:
    a[ord(s[i])]=ord(t[i])
  elif a[ord(s[i])]==ord(t[i]):
    continue
  else:
    print("No")
    exit()
print("Yes")

s=list(map(int,input().split()))
t=list(map(int,input().split()))
a=[0]*26
for i in range(len(s)):
  if a[ord(s[i])]==0:
    a[ord(s[i])]=ord(t[i])
  elif a[ord(s[i])]==ord(t[i]):
    continue
  else:
    print("No")
    exit()

list(input())
t=list(input())
a=[0]*27
for i in range(len(s)):
  if a[ord(s[i])-96]==0:
    a[ord(s[i])-96]=ord(t[i])-96
  elif a[ord(s[i])-96]==ord(t[i])-96:
    continue
  else:
    print("No")
    exit()
print("Yes")


a=list(input())
b=list(input())
from collections import Counter
def f(s):
    return sorted(Counter(s).values())
if f(a)==f(b):
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
import collections

s = input()
t = input()
S = collections.Counter(s)
T = collections.Counter(t)

if S.values()==T.values():
	print("Yes")
else:
	print("No")

import collections

s = input()
t = input()
S = collections.Counter(s)
T = collections.Counter(t)

if sorted(S.values())==sorted(T.values()):
	print("Yes")
else:
	print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
# -*- coding: utf-8 -*-

S = input()
T = input()

N = len(S)

ST = [None] * N

for i in range(N):
    ST[i] = [S[i], T[i]]

ST.sort(key=lambda a_i: a_i[0])

# for st in ST:
#     print(st)

dic = {}
for i, st in enumerate(ST):
    if st[0] in dic.keys():
        if i < dic[st[0]]:
            dic[st[0]] = i
    else:
        dic[st[0]] = i

i = 0
while i < N:
    ST_copy = ST
    dic_copy = dic
    if ST[i][0] != ST[i][1]:
        for j in range(i, N):
            if ST[j][0] != ST[i][0]:
                break
            ST_copy[j][0] = ST[i][1]
            if ST[i][1] in dic_copy.keys():
                if j < dic_copy[ST[i][1]]:
                    dic_copy[ST[i][1]] = j
            else:
                dic_copy[ST[i][1]] = j
        if ST[i][0] in dic_copy.keys():
            del dic_copy[ST[i][0]]
        if ST[i][1] in dic.keys():
            k = dic[ST[i][1]]
            while k < N:
                if ST[k][0] != ST[i][1]:
                    break
                ST_copy[k][0] = ST[i][0]
                if ST[i][0] in dic_copy.keys():
                    if k < dic_copy[ST[i][0]]:
                        dic_copy[ST[i][0]] = k
                else:
                    dic_copy[ST[i][0]] = k
                k += 1
            if ST[i][1] in dic_copy.keys():
                del dic_copy[ST[i][1]]
    ST = ST_copy
    dic = dic_copy
    i += 1

for st in ST:
    print(st)

equal = True
for st in ST:
    if st[0] != st[1]:
        equal = False
        break

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


# coding: utf-8




def main():
    S = input()
    T = input()
    N = len(S)

    memo1 = {}
    memo2 = {}
    for i in range(N):
        if S[i] not in memo1:
            memo1[S[i]] = T[i]
        else:
            if memo1[S[i]] != T[i]:
                return "No"
        if T[i] not in memo2:
            memo2[T[i]] = S[i]
        else:
            if memo2[T[i]] != S[i]:
                return "No"

    return "Yes"


print(main())


Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
ss = str(input())
t  = str(input())

for i in range(len(ss)):

    if ss == t :
        print("Yes")
        exit(0)

    s  = list(ss)

    if s[i] != t[i]:
        c1 = s[i]
        c2 = t[i]
       
        ss = ss.replace(c1 ,"-")
        ss = ss.replace(c2 ,c1 )
        ss = ss.replace("-",c2 )
        print(ss)

print("No")

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

sd = {}
td = {}

for k in range(ord('a'),ord('z')+1):   
    sd[chr(k)] = 0
    td[chr(k)] = 0

for i in range(len(s)) :
    if s[i] in sd :
        sd[s[i]] = sd[s[i]] + 1

    if t[i] in td :
        td[t[i]] = td[t[i]] + 1
""" 
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in sd :
        print(str(sd[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print()
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in td :
        print(str(td[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print() """

ta = []
sa = []
for k in range(ord('a'),ord('z')+1):
    if td[chr(k)] != sd[chr(k)] : 
        if td[chr(k)] > 0 :
            ta.append(td[chr(k)])
        if sd[chr(k)] > 0 :    
            sa.append(sd[chr(k)])
#print(ta)
#print(sa)

ta.sort()
sa.sort()

if ta == sa :
    print("Yes")
else :
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
chokudai
redcoder

s=input()
t=input()

d={}
for i in range(len(s)):
  if s[i]!=t[i]:
    if s[i] in d:
      if d[s[i]]!=t[i]
        print('No')
        exit()
      else:
       pass
    else:
      d[s[i]]=t[i]
  else:
    if s[i] in d and d[s[i]]!=t[i]:
      print('No')
      exit()
print('Yes')

from collections import Counter

s=input()
t=input()

cs=Counter(s)
ct=Counter(t)

print('Yes' if sorted(cs.values())==sorted(ct.values()) else 'No')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
S=list(input())
T=list(input())
def bSort(a):
    for i in range(len(a)):
        for j in range(len(a)-1, i, -1):
            if a[j] < a[j-1]:
                a[j], a[j-1] = a[j-1], a[j]

    return a
if bSort(S)==bSort(T):
    print('Yes')
else:
    print('No')

S=list(input())
T=list(input())
SS=list(set(S))
ST=list(set(T))
Scounter=[]
Tcounter=[]
for i in range(len(SS)):
    Scounter.append(S.count(SS[i]))
for j in range(len(ST)):
    Tcounter.append(T.count(ST[j]))
if Scounter==Tcounter:
    print('Yes')
else:
    print('No')

S=input()
T=input()
start=[-1]*26
goal=[-1]*26
ans='Yes'
for i in range(len(S)):
    a=ord(S[i])-ord('a')
    b=ord(T[i])-ord('a')
    if start[a]!=-1 or goal[b]!=-1:
        if start[a]!=b or goal[b]!=a:
            ans='No'
    else:
        start[a]=b;
        goal[b]=a;
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
from operator import itemgetter
s = input()
t = input()
a = []
for i in range(len(s)-1):
  b = [s[i],t[i]]
  a.append(b)
a.sort()
print(a)
for i in range(len(s)-2):
  if a[i][0] == a[i+1][0]:
    if a[i][1] != a[i+1][1]:
      print("No")
      exit()
a.sort(key=itemgetter(1))
for i in range(len(s)-2):
  if a[i][0] == a[i+1][0]:
    if a[i][1] != a[i+1][1]:
      print("No")
      exit()
print("Yes")

def isOK(s,t):
  m = [None] * 26
  for i,j in zip(s,t):
    num = ord(i) - ord("a")
    if m[num] == None:
      m[num] = j
    else:
      if m[num] != j:
        return False
  return True

s = input()
t = input()
if isOK(s,t) and isOK(t,s):
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s = input()
t = input()

table = [[0 for i in range(26)] for j in range(26)]
for i in range(len(s)):
  table[ord(t[i])-ord('a')][ord(s[i])-ord('a')] += 1
for t_row in table:
  counter = 0
  for v in t_row:
    if v != 0:
      counter += 1
  if counter >= 2:
    break
#else:
#  print('Yes')
#  exit(0)
print('No')
  

s = input()
t = input()

table = [[0 for i in range(26)] for j in range(26)]
for i in range(len(s)):
  table[ord(t[i])-ord('a')][ord(s[i])-ord('a')] += 1
for t_row in table:
  counter = 0
  for v in t_row:
    if v != 0:
      counter += 1
  if counter >= 2:
    break
else:
  for i in range(26):
    counter = 0
    for j in range(26):
      if table[j][i] != 0:
        counter += 1
    if counter >= 2:
      break
  else:
    print('Yes')
    exit(0)
print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
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()

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

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
S = input()
T = input()
alphabets = "abcdefghijklmnopqrstuvwxyz"

S_list=[]
T_list=[]
for c in alphabets:
    Scnt = S.count(c)
    Tcnt = T.count(c)
    if Scnt > 0:
        S_list.append(Scnt)
    if Tcnt > 0:
        T_list.append(Tcnt)

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

S = input()
T = input()
alphabets = "abcdefghijklmnopqrstuvwxyz"

S_list=[]
T_list=[]
for c in alphabets:
    Scnt = S.count(c)
    Tcnt = T.count(c)
    if Scnt > 0:
        S_list.append(Scnt)
    if Tcnt > 0:
        T_list.append(Tcnt)

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

Verdicts: Wrong Answer

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
S=str(input())
T=str(input())
dic={}
for s,t in zip(S,T):
    if s in dic:
        if dic[s]!=t:
            print("No")
            exit()
    else:
        dic[s]=t

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


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



Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
import collections
s = input()
t = input()
s = collections.Counter(s)
t = collections.Counter(t)
if sorted(s.values()) == sorted(t.values):
  print("Yes")
else:
  print("No")

s = input()
t = input()

dict_st = {}
dict_st = {}

for x, y in zip(s, t):
    if x not in dict_st:
        dict_st[x] = y 
    else:
        if dict_st[x] != y:
            print("No")
            break

    if y not in dict_ts:
        dict_ts[y]=x
    else:
        if dict_ts[y]!=x:
            print("No")
            break
else:
    print("Yes")

s = input()
t = input()

dict_st = {}
dict_ts = {}

for x, y in zip(s, t):
    if x not in dict_st:
        dict_st[x] = y 
    else:
        if dict_st[x] != y:
            print("No")
            exit()

    if y not in dict_ts:
        dict_ts[y]=x
    else:
        if dict_ts[y]!=x:
            print("No")
            exit()

print("Yes")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
l=input()
m=input()
ll=set(l)-sei(m)
lll=set(m)-set(l)
print(["No","Yes"][len(ll)==len(lll)])

a=input()
b=input()
dic_a={}
dic_b={}
for i in a:
    if i not in dic_a:
        dic_a[i]=1
    else:
        dic_a[i] += 1
for i in b:
    if i not in dic_b:
        dic_b[i]=1
    else:
        dic_b[i] += 1


print("Yes" if (sorted(dic_a.values())==sorted(dic_b.values())) else "No" )

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
s=input()
t=input()
a,b={},{}
cnt=1

for i in range(len(s)):
    if s[i] not in a and t[i] not in b:
        a[s[i]]=cnt
        b[t[i]]=cnt
        ant+=1
    elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):
        pass
    else
        print("No")
        exit()
print("Yes")

s=input()
t=input()
a,b={},{}
cnt=1

for i in range(len(s)):
    if s[i] not in a and t[i] not in b:
        a[s[i]]=cnt
        b[t[i]]=cnt
        cnt+=1
    elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):
        pass
    else:
        print("No")
        exit()
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: You are given strings S and T consisting of lowercase English letters.  You can perform the following operation on S any number of times:  Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.  Determine if S and T can be made equal by performing the operation zero or more times.

Submission attempts (in order):
S = input()
T = input()

n = len(S)
c1s = {}
c2s = {}
ans = True
for i in range(n):
    if not ans:
        break

    if S[i] in c1s:
        if c1s[S[i]] != T[i]:
            ans = False
            break
    else:
        c1s[S[i]] = S[i]
    if T[i] in c2s:
        if c2s[T[i]] != S[i]:
            ans = False
            break
    else:
        c2s[T[i]] = T[i]


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



S = input()
T = input()

n = len(S)
c1s = {}
c2s = {}
ans = True
for i in range(n):
    if not ans:
        break

    if S[i] in c1s:
        if c1s[S[i]] != T[i]:
            ans = False
            break
    else:
        c1s[S[i]] = T[i]
    if T[i] in c2s:
        if c2s[T[i]] != S[i]:
            ans = False
            break
    else:
        c2s[T[i]] = S[i]


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



Verdicts: Wrong Answer

Accepted