problem_id
stringlengths 6
6
| user_id
stringlengths 10
10
| time_limit
float64 1k
8k
| memory_limit
float64 262k
1.05M
| problem_description
stringlengths 48
1.55k
| codes
stringlengths 35
98.9k
| status
stringlengths 28
1.7k
| submission_ids
stringlengths 28
1.41k
| memories
stringlengths 13
808
| cpu_times
stringlengths 11
610
| code_sizes
stringlengths 7
505
|
---|---|---|---|---|---|---|---|---|---|---|
p03252 | u123756661 | 2,000 | 1,048,576 | 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. | ['s=input()\nt=input()\na,b={},{}\ncnt=1\n\nfor i in range(len(s)):\n if s[i] not in a and t[i] not in b:\n a[s[i]]=cnt\n b[t[i]]=cnt\n ant+=1\n elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):\n pass\n else\n print("No")\n exit()\nprint("Yes")', 's=input()\nt=input()\na,b={},{}\ncnt=1\n\nfor i in range(len(s)):\n if s[i] not in a and t[i] not in b:\n a[s[i]]=cnt\n b[t[i]]=cnt\n cnt+=1\n elif s[i] in a and t[i] in b and (a[s[i]]==b[t[i]]):\n pass\n else:\n print("No")\n exit()\nprint("Yes")'] | ['Runtime Error', 'Accepted'] | ['s800128589', 's412751064'] | [2940.0, 3632.0] | [17.0, 123.0] | [282, 283] |
p03252 | u124592621 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\n\nn = len(S)\nc1s = {}\nc2s = {}\nans = True\nfor i in range(n):\n if not ans:\n break\n\n if S[i] in c1s:\n if c1s[S[i]] != T[i]:\n ans = False\n break\n else:\n c1s[S[i]] = S[i]\n if T[i] in c2s:\n if c2s[T[i]] != S[i]:\n ans = False\n break\n else:\n c2s[T[i]] = T[i]\n\n\nprint('Yes' if ans else 'No')\n\n", "S = input()\nT = input()\n\nn = len(S)\nc1s = {}\nc2s = {}\nans = True\nfor i in range(n):\n if not ans:\n break\n\n if S[i] in c1s:\n if c1s[S[i]] != T[i]:\n ans = False\n break\n else:\n c1s[S[i]] = T[i]\n if T[i] in c2s:\n if c2s[T[i]] != S[i]:\n ans = False\n break\n else:\n c2s[T[i]] = S[i]\n\n\nprint('Yes' if ans else 'No')\n\n"] | ['Wrong Answer', 'Accepted'] | ['s740419653', 's118042635'] | [3632.0, 3632.0] | [18.0, 134.0] | [402, 402] |
p03252 | u127499732 | 2,000 | 1,048,576 | 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. | ['def main():\n import copy\n s, t = input(), input()\n a = [[] for _ in range(26)]\n b = copy.deepcopy(a)\n for i, j in zip(s, t):\n x, y = map(lambda x: ord(x) - 97, [i, j])\n a[x].append(y)\n b[y].append(x)\n\n f = all(len(set(i)) for i in a)\n g = all(len(set(i)) for i in a)\n print("Yes" if f and g else "No")\n\n\nif __name__ == \'__main__\':\n main()\n', "def main():\n s, t = input(), input()\n u = [chr(i) for i in range(97, 97 + 26)]\n v = [[] for _ in range(26)]\n\n for i in range(len(s)):\n a, b = s[i], t[i]\n k = u.index(a)\n v[k].append(b)\n\n f = all(len(set(i)) <= 1 and v.count(i) == 1 for i in v)\n print('Yes' if f else 'No')\n\n\nif __name__ == '__main__':\n main()\n", 'def main():\n from collections import defaultdict\n s, t = input(), input()\n d = defaultdict()\n\n for a, b in zip(s, t):\n if a == b:\n continue\n x, y = d.get(a), d.get(b)\n if (x, y) == (None, None):\n d[a], d[b] = b, a\n elif x is None or y is None:\n print("No")\n break\n else:\n if x != b or y != a:\n print("No")\n break\n else:\n print("Yes")\n print(d)\n\nif __name__ == \'__main__\':\n main()\n', 'def main():\n import copy\n s, t = input(), input()\n a = [[] for _ in range(26)]\n b = copy.deepcopy(a)\n for i, j in zip(s, t):\n x, y = map(lambda x: ord(x) - 97, [i, j])\n a[x].append(y)\n b[y].append(x)\n\n f = all(len(set(i)) <= 1 for i in a)\n g = all(len(set(i)) <= 1 for i in b)\n print("Yes" if f and g else "No")\n\n\nif __name__ == \'__main__\':\n main()\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s002028793', 's444914296', 's691148085', 's661789648'] | [8624.0, 5936.0, 4144.0, 8624.0] | [173.0, 137.0, 97.0, 177.0] | [387, 352, 528, 397] |
p03252 | u146575240 | 2,000 | 1,048,576 | 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. | ["# C - String Transformation\nimport collections\nS = str(input())\nT = str(input())\n\nS1 = sorted(collections.Counter(S).values())\nT1 = sorted(collections.Counter(T).values())\nprint(S1,T1)\n\nif S1 == T1:\n print('Yes')\nelse:\n print('No')", "# C - String Transformation\nimport collections\nS = str(input())\nT = str(input())\n\nS1 = sorted(collections.Counter(S).values())\nT1 = sorted(collections.Counter(T).values())\n\nif S1 == T1:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s216016874', 's784797260'] | [4016.0, 4016.0] | [42.0, 42.0] | [237, 224] |
p03252 | u152638361 | 2,000 | 1,048,576 | 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. | ['S = list(input())\nT = list(input())\nS.sort()\nT.sort()\nSKind = []\nTKind = []\ncnt = 1\nfor i in range(1,len(S)):\n\n if i == N-1:\n if S[i]==S[i-1]:\n cnt += 1\n SKind.append(cnt)\n else:\n SKind.append(cnt)\n SKind.append(1)\n elif S[i]==S[i-1]:\n cnt+=1\n elif S[i]!=S[i-1]:\n SKind.append(cnt)\n cnt = 1\ncnt = 1 \nfor i in range(1,len(T)):\n if i == N-1:\n if T[i]==T[i-1]:\n cnt += 1\n TKind.append(cnt)\n else:\n TKind.append(cnt)\n TKind.append(1)\n elif T[i]==T[i-1]:\n cnt+=1\n elif T[i]!=T[i-1]:\n TKind.append(cnt)\n cnt = 1\nSKind.sort()\nTKind.sort()\nif SKind == TKind:\n print("Yes")\nelse: print("No")', 'S = list(input())\nT = list(input())\nS.sort()\nT.sort()\nSKind = []\nTKind = []\ncnt = 1\nfor i in range(1,len(S)):\n if i == 0:\n cnt+=1\n elif i == N-1:\n if S[i]==S[i-1]:\n cnt += 1\n SKind.append(cnt)\n else:\n SKind.append(cnt)\n SKind.append(1)\n elif S[i]==S[i-1]:\n cnt+=1\n elif S[i]!=S[i-1]:\n SKind.append(cnt)\n cnt = 1\ncnt = 1 \nfor i in range(1,len(T)):\n if i == 0:\n cnt+=1\n elif i == N-1:\n if T[i]==T[i-1]:\n cnt += 1\n TKind.append(cnt)\n else:\n TKind.append(cnt)\n TKind.append(1)\n elif T[i]==T[i-1]:\n cnt+=1\n elif T[i]!=T[i-1]:\n TKind.append(cnt)\n cnt = 1\nSKind.sort()\nTKind.sort()\nif SKind == TKind:\n print("Yes")\nelse: print("No")', 'S = list(input())\nT = list(input())\nS.sort()\nT.sort()\nSKind = []\nTKind = []\ncnt = 1\nfor i in range(1,len(S)):\n if i == 0:\n cnt+=1\n elif i == N-1:\n if S[i]==S[i-1]:\n cnt += 1\n SKind.append(cnt)\n else:\n SKind.append(cnt)\n SKind.append(1)\n elif S[i]==S[i-1]:\n cnt+=1\n elif S[i]!=S[i-1]:\n SKind.append(cnt)\n cnt = 1\n# print(SKind)\ncnt = 1 \nfor i in range(1,len(T)):\n if i == 0:\n cnt+=1\n elif i == N-1:\n if T[i]==T[i-1]:\n cnt += 1\n TKind.append(cnt)\n else:\n TKind.append(cnt)\n TKind.append(1)\n elif T[i]==T[i-1]:\n cnt+=1\n elif T[i]!=T[i-1]:\n TKind.append(cnt)\n cnt = 1\n# print(TKind)\n#print(SKind,TKind)\nSKind.sort()\nTKind.sort()\nif SKind == TKind:\n print("Yes")\nelse: print("No")', 'S = list(input())\nT = list(input())\nS.sort()\nT.sort()\nSKind = []\nTKind = []\ncnt = 1\nfor i in range(1,len(S)):\n if i == len(S)-1:\n if S[i]==S[i-1]:\n cnt += 1\n SKind.append(cnt)\n else:\n SKind.append(cnt)\n SKind.append(1)\n elif S[i]==S[i-1]:\n cnt+=1\n elif S[i]!=S[i-1]:\n SKind.append(cnt)\n cnt = 1\ncnt = 1 \nfor i in range(1,len(T)):\n if i == len(T)-1:\n if T[i]==T[i-1]:\n cnt += 1\n TKind.append(cnt)\n else:\n TKind.append(cnt)\n TKind.append(1)\n elif T[i]==T[i-1]:\n cnt+=1\n elif T[i]!=T[i-1]:\n TKind.append(cnt)\n cnt = 1\nSKind.sort()\nTKind.sort()\nif SKind == TKind:\n print("Yes")\nelse: print("No")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s266521305', 's469889263', 's660766213', 's203931298'] | [7448.0, 7448.0, 7448.0, 7452.0] | [101.0, 100.0, 100.0, 262.0] | [768, 831, 887, 777] |
p03252 | u157850041 | 2,000 | 1,048,576 | 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. | ['a = input()\nb = input()\nflag = True\nfor i in range(len(a)):\n flag1 = False \n for j in range(len(b)):\n if a[i] == b[j]:\n flag1 = True\n break\n if flag1:print(i,":ok")\n if not flag1:\n flag2 = True\n for k in range(len(a)):\n if b[i] == a[k]:\n flag2 = False\n break\n if flag2:print(i,":ok")\n if not flag2:\n flag = False\n if not flag:break\nif flag:print("Yes")\nelse:print("No")', 'a = input()\nb = input()\nlist1 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],\n["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],\n["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]\nlist2 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],\n["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],\n["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]\nfor i in range(len(a)):\n for j in range(26):\n if a[i] == list1[j][0]:\n list1[j][1] += 1\n break\nfor i in range(len(b)):\n for j in range(26):\n if b[i] == list2[j][0]:\n list2[j][1] += 1\n break\nlist3 = [list1[i][1] for i in range(26)]\nlist3.sort()\nlist4 = [list2[i][1] for i in range(26)]\nlist4.sort()\nflag = True\nfor i in range(26):\n if list3[i] != list[4]:\n flag = False\nif flag:print("Yes")\nelse:print("No")', 'a = input()\nb = input()\nlist1 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],\n["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],\n["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]\nlist2 = [["a", 0 ],["b", 0 ],["c", 0 ],["d", 0 ],["e", 0 ],["f", 0 ],["g", 0 ],["h", 0 ],["i", 0 ],["j", 0 ],\n["k", 0 ],["l", 0 ],["m", 0 ],["n", 0 ],["o", 0 ],["p", 0 ],["q", 0 ],["r", 0 ],["s", 0 ],["t", 0 ],\n["u", 0 ],["v", 0 ],["w", 0 ],["x", 0 ],["y", 0 ],["z", 0 ]]\nfor i in range(len(a)):\n for j in range(26):\n if a[i] == list1[j][0]:\n list1[j][1] += 1\n break\nfor i in range(len(b)):\n for j in range(26):\n if b[i] == list2[j][0]:\n list2[j][1] += 1\n break\nlist3 = [list1[i][1] for i in range(26)]\nlist3.sort()\nlist4 = [list2[i][1] for i in range(26)]\nlist4.sort()\nflag = True\nfor i in range(26):\n if int(list3[i]) != int(list4[i]):\n flag = False\nif flag:print("Yes")\nelse:print("No")'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s378921771', 's625323415', 's084441260'] | [5740.0, 3904.0, 3888.0] | [2104.0, 1069.0, 1218.0] | [547, 1048, 1059] |
p03252 | u163320134 | 2,000 | 1,048,576 | 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. | ["s=input()\nt=inpur()\narr1=[0]*26\narr2=[0]*26\ncheck='abcdefghijklmnopqrstuvwxyz'\nfor i in range(26):\n arr1[i]=s.count(check[i])\n arr2[i]=s.count(check[i])\narr1=sorted(arr1)\narr2=sorted(arr2)\nfor i in range(26):\n if arr1[i]!=arr2[i]:\n print('No')\n break\nelse:\n print('Yes')", "s=input()\nt=input()\nds={}\ndt={}\nfor i in range(len(s)):\n ts=s[i]\n tt=t[i]\n if ts not in ds:\n ds[ts]=tt\n rs=tt\n else:\n rs=ds[ts]\n if tt not in dt:\n dt[tt]=ts\n rt=ts\n else:\n rt=dt[tt]\n if rs==tt and rt==ts:\n continue\n else:\n print('No')\n break\nelse:\n print('Yes')"] | ['Runtime Error', 'Accepted'] | ['s240939522', 's502161458'] | [3444.0, 3632.0] | [18.0, 118.0] | [280, 297] |
p03252 | u163449343 | 2,000 | 1,048,576 | 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. | ['from collections import Counter\n\nS = Counter(list(input()))\nT = Counter(list(input()))\ns,t = list(S.values()),list(T.values())\nprint(["No", "Yes"][(s.sort() == t.sort() or len(s) % 2 != 0])', 'S = list(input())\nT = list(input())\nslen = []\ntlen = []\nans = "Yes"\n\nwhile len(S) > 0:\n tempS = S[0]\n slen.append(S.count(tempS))\n while tempS in S:\n S.remove(tempS)\n \n \nwhile len(T) > 0:\n tempT = T[0]\n tlen.append(T.count(tempT))\n while tempT in T:\n T.remove(tempT)\n \nslen.sort()\ntlen.sort()\nprint(slen,tlen)\nprint(["No", "Yes"][slen == tlen])\n \n\n', 'from collections import Counter\n\nS = Counter(list(input()))\nT = Counter(list(input()))\ns,t = list(S.values()),list(T.values())\nprint(["No", "Yes"][(s.sort() == t.sort() or len(s) % 2 != 0]))', 'from collections import Counter\n\nS = Counter(list(input()))\nT = Counter(list(input()))\ns,t = list(S.values()), list(T.values())\nprint(["No", "Yes"][sorted(s) == sorted(t)])\n\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s306647455', 's363870929', 's586875378', 's779468846'] | [2940.0, 7216.0, 2940.0, 5396.0] | [18.0, 2108.0, 17.0, 46.0] | [190, 393, 191, 174] |
p03252 | u163703551 | 2,000 | 1,048,576 | 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. | ["import sys\nimport socket\n\nhostname = socket.gethostname()\n\nif hostname == 'F551C':\n sys.stdin = open('c1.in')\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(input())\n\n\ndef read_str():\n return input()\n\n\ndef main():\n S = read_str()\n T = read_str()\n n = len(S)\n res = 'Yes'\n A = [0] * n\n B = [0] * n\n vu = {}\n for i in range(n):\n if S[i] in vu:\n A[i] = vu[S[i]]\n else:\n vu[S[i]] = i\n A[i] = vu[S[i]]\n\n vu = {}\n for i in range(n):\n if T[i] in vu:\n T[i] = vu[T[i]]\n else:\n vu[T[i]] = i\n B[i] = vu[T[i]]\n\n if A != B:\n res = 'No'\n\n \n # for j in range(n):\n # if S[i] != S[j] and T[i] == T[j]:\n # res = 'No'\n # if S[i] == S[j] and T[i] != T[j]:\n # res = 'No'\n print(res)\n\n\nmain()\n", "import sys\nimport socket\n\nhostname = socket.gethostname()\n\nif hostname == 'F551C':\n sys.stdin = open('c1.in')\n\n\ndef read_int_list():\n return list(map(int, input().split()))\n\n\ndef read_str_list():\n return input().split()\n\n\ndef read_int():\n return int(input())\n\n\ndef read_str():\n return input()\n\n\ndef main():\n S = read_str()\n T = read_str()\n n = len(S)\n res = 'Yes'\n A = [0] * n\n B = [0] * n\n vu = {}\n for i in range(n):\n if S[i] not in vu:\n vu[S[i]] = i\n A[i] = vu[S[i]]\n\n vu = {}\n for i in range(n):\n if T[i] not in vu:\n vu[T[i]] = i\n B[i] = vu[T[i]]\n\n if A != B:\n res = 'No'\n\n \n # for j in range(n):\n # if S[i] != S[j] and T[i] == T[j]:\n # res = 'No'\n # if S[i] == S[j] and T[i] != T[j]:\n # res = 'No'\n print(res)\n\n\nmain()\n"] | ['Runtime Error', 'Accepted'] | ['s038216513', 's943409396'] | [7340.0, 7340.0] | [59.0, 89.0] | [998, 914] |
p03252 | u175590965 | 2,000 | 1,048,576 | 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. | ['c = []\nfor i in range(3):\n c.append(list(map(int,input().split())))\na = [0,0,0]\nb = [0,0,0]\nfor i in range(3):\n b[i] = c[i][0]-0\nfor i in range(3):\n a[i] = c[0][i]-b[0]\nfor i in range(3):\n for j in range(3):\n if a[j]+b[i] != c[i][j]:\n print("No")\n exit()\nprint("Yes")', "from collections import Counter\n \nS=input()\nT=input()\n \nS=list(Counter(S).values())\nT=list(Counter(T).values())\n \nS.sort()\nT.sort()\n \nif S==T:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s295777375', 's343889147'] | [3444.0, 4144.0] | [18.0, 41.0] | [308, 179] |
p03252 | u189575640 | 2,000 | 1,048,576 | 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. | ['# A,B,C = [int(n) for n in input().split()]\n# N = int(input())\nS = list(input())\nT = list(input())\nsame = "SAME"\ns = set()\nfor i in range(len(S)):\n if not(S[i] in s):\n s.add(S[i])\n S[i] = i\n else:\n S[i] = same\ns = set()\nfor i in range(len(T)):\n if not(T[i] in s):\n s.add(T[i])\n T[i] = i\n\n else:\n T[i] = same\n\nprint("YES" if T == S else "NO")\n', '# A,B,C = [int(n) for n in input().split()]\n# N = int(input())\nS = list(input())\nT = list(input())\ns = {}\nfor i in range(len(S)):\n if not(S[i] in s):\n s[S[i]] = i\n S[i] = i\n else:\n S[i] = s[S[i]]\ns = {}\nfor i in range(len(T)):\n if not(T[i] in s):\n s[T[i]] = i\n T[i] = i\n else:\n T[i] = s[T[i]]\nprint("Yes" if T == S else "No")\n'] | ['Wrong Answer', 'Accepted'] | ['s261785783', 's621416033'] | [6704.0, 6704.0] | [99.0, 140.0] | [397, 381] |
p03252 | u201234972 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\nA = [-1]*26\nB = [-1]*26\nL = len(S)\nans = 'Yes'\nfor i in range(L):\n ords = ord(S[i])-97\n ordt = ord(T[i])-97\n if A[ords] == -1 and B[ords] == -1:\n A[ords] = ordt\n B[ordt] = ords\n elif A[ords] == ordt and B[ordt] == ords:\n continue\n else:\n ans = 'No'\nprint(ans)", "S = input()\nT = input()\nA = [-1]*26\nB = [-1]*26\nL = len(S)\nans = 'Yes'\nfor i in range(L):\n ords = ord(S[i])-97\n ordt = ord(T[i])-97\n if A[ords] == -1 and B[ordt] == -1:\n A[ords] = ordt\n B[ordt] = ords\n elif A[ords] == ordt and B[ordt] == ords:\n continue\n else:\n ans = 'No'\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s857326744', 's956648972'] | [3632.0, 3632.0] | [127.0, 133.0] | [326, 326] |
p03252 | u210827208 | 2,000 | 1,048,576 | 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. | ["s=input()\nt=input()\nans='Yes'\n\nif set(s)==set(t):\n ans='Yes'\nelse:\n for i in range(len(s)):\n if s[i]!=t[i] and t[i] in s :\n ans='No'\n break\n\nprint(ans)", "s=[0 for _ in range(26)]\nt=[0 for _ in range(26)]\nS=input()\nT=input()\n\nfor i in range(len(S)):\n s[ord(S[i])-ord('a')]+=1\n t[ord(T[i])-ord('a')]+=1\n\ns.sort()\nt.sort()\nif s==t:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s775462186', 's193761594'] | [3632.0, 3632.0] | [1239.0, 135.0] | [186, 219] |
p03252 | u213854484 | 2,000 | 1,048,576 | 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. | ['S = list(input().split())\nT = list(input().split())\n\nSn = [ord(i)-ord("a") for i in S]\nTn = [ord(i)-ord("a") for i in T]\nsub1 = [-1]*26\nsub2 = [-1]*26\n\nfor i in range(len(S)):\n if sub1[Sn[i]] == -1 or sub2[Tn[i]] == -1:\n if sub1[Sn[i]] == -1:\n sub1[Sn[i]] = Tn[i]\n if sub2[Tn[i]] == -1:\n sub2[Tn[i]] = Sn[i]\n if sub1[Sn[i]] != Tn[i] or sub2[Tn[i]] != Sn[i]:\n print("No")\n break\nelse:\n print("Yes")', 'S = list(input())\nT = list(input())\n \nSn = [ord(i)-ord("a") for i in S]\nTn = [ord(i)-ord("a") for i in T]\nsub1 = [-1]*26\nsub2 = [-1]*26\n \nfor i in range(len(S)):\n if sub1[Sn[i]] == -1 or sub2[Tn[i]] == -1:\n if sub1[Sn[i]] == -1:\n sub1[Sn[i]] = Tn[i]\n if sub2[Tn[i]] == -1:\n sub2[Tn[i]] = Sn[i]\n if sub1[Sn[i]] != Tn[i] or sub2[Tn[i]] != Sn[i]:\n print("No")\n break\nelse:\n print("Yes")'] | ['Runtime Error', 'Accepted'] | ['s746907907', 's792801258'] | [3632.0, 9776.0] | [19.0, 170.0] | [464, 450] |
p03252 | u217086212 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\ndic1 = {}\ndic2 = {}\nfor i in range(len(s)):\n if dic1.get(s[i]) == None:\n dic1[s[i]] = t[i]\n elif dic1[s[i]] != t[i] \n print("No")\n exit()\n if dic2.get(t[i]) == None:\n dic2[t[i]] = s[i]\n elif dic2[t[i]] != s[i]:\n print("No")\n exit()\nprint("Yes")', 's = input()\nt = input()\ndone_salp = []\ndone_talp = []\ndic1 = {}\ndic2 = {}\nfor i in range(len(s)):\n if t[i] in done_talp:\n print("No")\n exit()\n\n if dic1.get(s[i]) == None and dic2.get(t[i]) == None:\n dic1[s[i]] = t[i]\n dic2[t[i]] = s[i]\n done_salp.append(s[i])\n done_talp.append(t[i])\n continue\n if dic1[s[i]] != t[i] or dic2[t[i]] != s[i]:\n print("No")\n exit()\nprint("Yes")', 's = input()\nt = input()\ndone_salp = []\ndone_talp = []\ndic1 = {}\ndic2 = {}\nfor i in range(len(s)):\n if t[i] in done_talp:\n print("No")\n exit()\n\n if dic1.get(s[i]) == None and dic2.get(t[i]) == None:\n dic1[s[i]] = t[i]\n dic2[t[i]] = s[i]\n done_salp.append(s[i])\n done_talp.append(t[i])\n continue\n if dic1[s[i]] != t[i] or dic2[t[i]] != s[i]:\n print("No")\n exit()\nprint("Yes")', 's = input()\nt = input()\ndic1 = {}\ndic2 = {}\nfor i in range(len(s)):\n if dic1.get(s[i]) == None:\n dic1[s[i]] = t[i]\n elif dic1[s[i]] != t[i]:\n print("No")\n exit()\n if dic2.get(t[i]) == None:\n dic2[t[i]] = s[i]\n elif dic2[t[i]] != s[i]:\n print("No")\n exit()\nprint("Yes")'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s067683638', 's486405621', 's878155222', 's832185601'] | [2940.0, 3632.0, 3632.0, 3632.0] | [17.0, 19.0, 18.0, 165.0] | [322, 445, 445, 322] |
p03252 | u217627525 | 2,000 | 1,048,576 | 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. | ['s=input()\nt=input()\nu=[]\nv=[]\ns_len=len(s)\nfor i in range(s_len):\n s_i=s[i]\n t_i=t[i]\n ts=t_i+s_i\n if s_i!=t_i:\n if ts not in u:\n u.append(ts)\n elif s_i not in v:\n v.append(s_i)\nu_len=len(u)\nans="Yes"\nif u_len!=0:\n u.sort()\n u.append("XX")\n u_len=len(u)\n for i in range(u_len):\n if u[i][0] in v or u[i][1] in v:\n ans="No"\n break\n elif u[i][0]==u[i+1][0] and u[i][1]!=u[i+1][1]:\n ans="No"\n break \nprint(ans)', 's=input()\nt=input()\nu=[]\nv=[]\ns_len=len(s)\nfor i in range(s_len):\n s_i=s[i]\n t_i=t[i]\n ts=t_i+s_i\n if s_i!=t_i:\n if ts not in u:\n u.append(ts)\n elif s_i not in v:\n v.append(s_i)\nu.sort()\nu.append("XX")\nans="Yes"\nu_len=len(u)\nfor i in range(u_len):\n if u[i][0] in v or u[i][1] in v:\n ans="No"\n break\n elif u[i][0]==u[i+1][0] and u[i][1]!=u[i+1][1]:\n ans="No"\n break \nprint(ans)', 'from operator import itemgetter\ns=input()\nt=input()\nu=[]\nv=[]\ns_len=len(s)\nfor i in range(s_len):\n s_i=s[i]\n t_i=t[i]\n ts=t_i+s_i\n if s_i!=t_i:\n if ts not in u:\n u.append(ts)\n elif s_i not in v:\n v.append(s_i)\nu_len=len(u)\nans="Yes"\nif u_len!=0:\n u1=sorted(u)\n u1.append("XX")\n for i in range(u_len):\n if u1[i][0] in v or u1[i][1] in v:\n ans="No"\n break\n elif u1[i][0]==u1[i+1][0] and u1[i][1]!=u1[i+1][1]:\n ans="No"\n break\n if ans=="Yes":\n u2=sorted(u,key=itemgetter(1))\n u2.append("XX")\n for i in range(u_len):\n if u2[i][0]!=u2[i+1][0] and u2[i][1]==u2[i+1][1]:\n ans="No"\n break\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s020574806', 's964735353', 's008824439'] | [3632.0, 3632.0, 3888.0] | [474.0, 478.0, 486.0] | [522, 456, 763] |
p03252 | u227082700 | 2,000 | 1,048,576 | 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. | ['s,t=input(),input()\nd={"a":0,"b":0,c"":0,"d":0,"e":0,"f":0,g"":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}\nfor i,j in s,t:\n if d[i]==0:d[i]=j\n elif d[i]!=j:print("No");exit()\n if d[j]==0:d[j]=i\n elif d[j]!=i:print("No");exit()\nprint("Yes")', 's,t=input(),input()\nd={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}\nfor i,j in s,t:\n if d[i]==0:d[i]=j\n elif d[i]!=j:print("No");exit()\n if d[j]==0:d[j]=i\n elif d[j]!=i:print("No");exit()\nprint("Yes")\n', 's,t=input(),input()\nrs=rt=[""for _ in range(26)]\ndef a(n):return [chr(ord(\'a\')+i)for i in range(26)].index(n)\nfor i in range(len(s)):\n if rs[a(s[i])]=="":rs[a(s[i])]=t[i]\n elif rs[a(s[i])]!=t[i]:print("No");exit()\n if rt[a(t[i])]=="":rt[a(t[i])]=s[i]\n elif rt[a(t[i])]!=s[i]:print("No");exit()\nrint("Yes")', 'a="abcdefghijklmnopqrstuvwxyz"\ns=input()\nt=input()\nds={}\ndt={}\nfor i in a:ds[i]=dt[i]=""\nfor i in range(len(s)):\n if ds[s[i]]=="":ds[s[i]]=t[i]\n elif ds[s[i]]!=t[i]:exit(print("No"))\n if dt[t[i]]=="":dt[t[i]]=s[i]\n elif dt[t[i]]!=s[i]:exit(print("No"))\nprint("Yes")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s162231275', 's645175622', 's709624163', 's410863216'] | [3064.0, 3632.0, 3632.0, 3632.0] | [17.0, 18.0, 2104.0, 137.0] | [316, 317, 309, 269] |
p03252 | u235210692 | 2,000 | 1,048,576 | 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. | ['s=list(input())\nt=list(input())\nn=len(s)\ndef get_count_list(s):\n alphabets="abcdefghijklmnopqrstuvwxyz"\n ans={}\n for alphabet in alphabets:\n ans[alphabet]=[]\n for i in range(n):\n ans[s[i]].append(i)\n return ans\n\n\ndef get_index2alpha(s):\n ans={}\n for i in range(n):\n ans[i]=s[i]\n return ans\n\ns_count=get_count_list(s)\nt_count=get_count_list(t)\ns_index=get_index2alpha(s)\nt_index=get_index2alpha(t)\n\n# ans=0\n\n# if not s_count[s_index[i]]==t_count[t_index[i]]:\n# ans+=1\n# \n# if ans==0:\n# print("Yes")\n# else:\n# print("No")', 's=list(input())\nt=list(input())\nn=len(s)\ndef get_count_list(s):\n alphabets="abcdefghijklmnopqrstuvwxyz"\n ans={}\n for alphabet in alphabets:\n ans[alphabet]=[]\n for i in range(n):\n ans[s[i]].append(i)\n return ans\n\n\ndef get_index2alpha(s):\n ans={}\n for i in range(n):\n ans[i]=s[i]\n return ans\n\ns_count=get_count_list(s)\nt_count=get_count_list(t)\ns_index=get_index2alpha(s)\nt_index=get_index2alpha(t)\n\nans=0\n\ns_set=set(s)\n\n\nfor i in range(n):\n s_alpha=s_index[i]\n t_alpha = t_index[i]\n if s_alpha in s_set:\n s_set.remove(s_alpha)\n if not s_count[s_alpha]==t_count[t_alpha]:\n ans+=1\n\nif ans==0:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s338029873', 's918610765'] | [72328.0, 72652.0] | [146.0, 191.0] | [609, 707] |
p03252 | u237362582 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\nflag = True\nflag2 = False\nl = ''\nfor i in range(len(S)):\n if S[i] != T[i]:\n if flag2 and S[i] in S[:i-1]:\n print(S[i])\n print(T[i])\n print(S)\n print(T)\n flag = False\n break\n s = S[i]\n for j in range(i,len(S)):\n if S[j] == s:\n S = S[:j]+T[i]+S[j+1:]\n elif S[j] == T[i]:\n S = S[:j]+s+S[j+1:]\n if not flag2:\n flag2 = True\nif flag:\n print('YES')\nelse:\n print('NO')", "S = input()\nT = input()\n\nflag = True\ntranslate = [-1 for i in range(26)]\n\nfor i in range(len(S)):\n s = ord(S[i])-97\n if translate[s] == -1:\n translate[s] = ord(T[i])\n else:\n if ord(T[i]) != translate[s]:\n flag = False\n break\n\n\nif flag:\n print('YES')\nelse:\n print('NO')\n", "S = input()\nT = input()\nflag = True\nflag2 = False\nl = ''\nfor i in range(len(S)):\n if S[i] != T[i]:\n if flag2 and (S[i] in S[:i-1] or T[i] in S[:i-1]):\n flag = False\n break\n s = S[i]\n for j in range(i,len(S)):\n if S[j] == s:\n S = S[:j]+T[i]+S[j+1:]\n elif S[j] == T[i]:\n S = S[:j]+s+S[j+1:]\n# print(S)\n if not flag2:\n flag2 = True\nif flag:\n print('YES')\nelse:\n print('NO')\n\n", "S = input()\nT = input()\n\nflag = True\ntranslate1 = [-1 for i in range(26)]\ntranslate2 = [-1 for i in range(26)]\nfor i in range(len(S)):\n s = ord(S[i])-97\n t = ord(T[i])-97\n\n if translate1[s] == -1:\n translate1[s] = t\n else:\n if translate1[s] != t:\n flag = False\n break \n\n if translate2[t] == -1:\n translate2[t] = s\n else:\n if translate2[t] != s:\n flag = False\n break\n\n\nif flag:\n print('YES')\nelse:\n print('NO')", "S = input()\nT = input()\nflag = True\nflag2 = False\nl = ''\nfor i in range(len(S)):\n if S[i] != T[i]:\n if flag2 and S[i] in S[:i-1]:\n print(S[i])\n print(T[i])\n print(S)\n print(T)\n flag = False\n break\n s = S[i]\n for j in range(i,len(S)):\n if S[j] == s:\n S = S[:j]+T[i]+S[j+1:]\n elif S[j] == T[i]:\n S = S[:j]+s+S[j+1:]\n flag2 = True\nif flag:\n print('YES')\nelse:\n print('NO')", "S = input()\nT = input()\nflag = True\nflag2 = False\nl = ''\nfor i in range(len(S)):\n if S[i] != T[i]:\n if flag2 and (S[i] in S[:i-1] or T[i] in T[:i-1]):\n flag = False\n break\n s = S[i]\n for j in range(i,len(S)):\n if S[j] == s:\n S = S[:j]+T[i]+S[j+1:]\n elif S[j] == T[i]:\n S = S[:j]+s+S[j+1:]\n if not flag2:\n flag2 = True\nif flag:\n print('YES')\nelse:\n print('NO')", "S = input()\nT = input()\n\nflag = True\ntranslate1 = [-1 for i in range(26)]\ntranslate2 = [-1 for i in range(26)]\nfor i in range(len(S)):\n s = ord(S[i])-97\n t = ord(T[i])-97\n\n if translate1[s] == -1:\n translate1[s] = t\n else:\n if translate1[s] != t:\n flag = False\n break \n\n if translate2[t] == -1:\n translate2[t] = s\n else:\n if translate2[t] != s:\n flag = False\n break\n\n\nif flag:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s247336015', 's345486306', 's440661490', 's635299597', 's669112794', 's904266367', 's045433813'] | [4052.0, 3632.0, 4060.0, 3632.0, 4040.0, 4064.0, 3760.0] | [2104.0, 102.0, 2104.0, 136.0, 2104.0, 2104.0, 140.0] | [542, 320, 493, 505, 524, 473, 505] |
p03252 | u242598232 | 2,000 | 1,048,576 | 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. | ['S=input()\nT=input()\nL=len(S)\nAZ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"\nj=0\nfor i in range(L):\n\tif S[i:i+1].islower()==True:\n\t\tS=S.replace(S[i],AZ[j])\n\t\tj=j+1\nprint(S)\nk=0\nfor i in range(L):\n\tif T[i:i+1].islower()==True:\n\t\tT=T.replace(T[i],AZ[k]) \n\t\tk=k+1\nprint(T)\nif S==T:\n\tprint("Yes")\nelse:\n\tprint("No")', 'S=input()\nT=input()\nL=len(S)\nAZ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"\nj=0\nfor i in range(L):\n\tif S[i:i+1].islower()==True:\n\t\tS=S.replace(S[i],AZ[j])\n\t\tj=j+1\nk=0\nfor i in range(L):\n\tif T[i:i+1].islower()==True:\n\t\tT=T.replace(T[i],AZ[k]) \n\t\tk=k+1\nif S==T:\n\tprint("Yes")\nelse:\n\tprint("No")'] | ['Wrong Answer', 'Accepted'] | ['s111360692', 's074841984'] | [4144.0, 3632.0] | [112.0, 117.0] | [296, 278] |
p03252 | u244423127 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\n\ngo = []\nback = []\ng = []\nb = []\ndef has_duplicates(seq):\n return len(seq) != len(set(seq))\n\n\nfor i in range(len(s)):\n go.append(s[i]+t[i])\n back.append(t[i]+s[i])\n\ngo_l = set(go)\nback_l = set(back)\ngo = list(go_l)\nback = list(back_l)\n\nprint(go)\nprint(back)\n\nfor i in range(len(go)):\n g.append(go[i][0])\n b.append(back[i][0])\n \nprint(g)\nprint(b)\n \nansg = has_duplicates(g)\nansb = has_duplicates(b)\n\nif ansg == True or ansb == True:\n print("No")\nelse:\n print("Yes")', 'a = list(map(int,input().split()))\nx = a[0]\ny = a[1]\n\nn = a[0]\ncount = 0\n\nwhile n <= y:\n n = n << 1\n count += 1\n \nprint(str(count))', 's = input()\nt = input()\n\ngo = []\nback = []\ndef has_duplicates(seq):\n return len(seq) != len(set(seq))\n\n\nfor i in range(len(s)):\n go.append(s[i])\n back.append(t[i])\n \nansg = has_duplicates(go)\nansb = has_duplicates(back)\n\nif ansg == True or ansb == True:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\n\ngo = []\nback = []\ng = []\nb = []\ndef has_duplicates(seq):\n return len(seq) != len(set(seq))\n\n\nfor i in range(len(s)):\n go.append(s[i]+t[i])\n back.append(t[i]+s[i])\n\ngo_l = set(go)\nback_l = set(back)\ngo = list(go_l)\nback = list(back_l)\n\n#print(go)\n#print(back)\n\nfor i in range(len(go)):\n g.append(go[i][0])\n b.append(back[i][0])\n \n#print(g)\n#print(b)\n \nansg = has_duplicates(g)\nansb = has_duplicates(b)\n\nif ansg == True or ansb == True:\n print("No")\nelse:\n print("Yes")'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s342530935', 's619485195', 's828744376', 's966922756'] | [29232.0, 3444.0, 6660.0, 29232.0] | [156.0, 19.0, 84.0, 154.0] | [499, 134, 294, 503] |
p03252 | u246820565 | 2,000 | 1,048,576 | 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. | ["S = str(input())\nT = str(input())\n\n\nfrom collections import defaultdict\ns = defaultdict(int)\nt = defaultdict(int)\n\n\nfor i in S:\n\ts[i] += 1\n\nfor j in T:\n\tt[j] += 1\n\t\nss = sorted(s.values())\ntt = sorted(t.values())\n\nprint(ss,tt)\n\nif ss == tt:\n\tprint('Yes')\nelse:\n\tprint('No')", "#coding:utf-8\n\n\n\n\n\n\nS = str(input())\nT = str(input())\n\n\nfrom collections import defaultdict\ns = defaultdict(int)\nt = defaultdict(int)\n\n\nfor i in S:\n\ts[i] += 1\n\nfor j in T:\n\tt[j] += 1\n\n\n\n\nss = sorted(s.values())\ntt = sorted(t.values())\n\nif ss == tt:\n\tprint('Yes')\nelse:\n\tprint('No')\n\t\t\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n"] | ['Wrong Answer', 'Accepted'] | ['s605062748', 's298167477'] | [3812.0, 4016.0] | [68.0, 74.0] | [273, 1107] |
p03252 | u255172538 | 2,000 | 1,048,576 | 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. | ['str1 = input()\nstr2 = input()\n\ndict = dict()\nans = "Yes"\n\nfor i in range(len(str1)):\n if(str1[i] in dict):\n if(dict[str[i]] != str2[i]):\n ans = "No"\n else:\n dict[str1[i]] = str2[i]\n\nprint(ans)\n', 'str1 = input()\nstr2 = input()\n\ndict1 = dict()\nans = "Yes"\n\nfor i in range(len(str1)):\n if(str1[i] in dict1.keys()):\n if(dict1[str1[i]] != str2[i]):\n ans = "No"\n else:\n if(str2[i] in dict1.values()):\n ans = "No"\n dict1[str1[i]] = str2[i]\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s245779495', 's484086559'] | [3632.0, 3632.0] | [17.0, 85.0] | [224, 298] |
p03252 | u256464928 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\ncnt = 0\nfor i in range(len(S)):\n if cnt > 30:\n break\n if S[i] != T[i]:\n X = S[i]\n S = S.replace(S[i],"X")\n S = S.replace(T[i],X)\n S = S.replace("X",T[i])\n cnt += 1\n print(S)\nprint("Yes" if S == T else "No")', 'S = input()\nT = input()\ncnt = 0\nfor i in range(len(S)):\n if cnt > 30:\n break\n if S[i] != T[i]:\n X = S[i]\n S = S.replace(S[i],"X")\n if T[i] in S:\n S = S.replace(T[i],X)\n S = S.replace("X",T[i])\n cnt += 1\nprint("Yes" if S == T else "No")'] | ['Runtime Error', 'Accepted'] | ['s243148998', 's584454365'] | [134884.0, 3632.0] | [179.0, 96.0] | [251, 260] |
p03252 | u281610856 | 2,000 | 1,048,576 | 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. | ["from collections import Counter\ns = input()\nt = input()\ns_cnt = sorted(Counter(s).values(), reverse=True)\nt_cnt = sorted(Counter(t).values(), reverse=True)\nprint(s_cnt)\nprint(t_cnt)\nif s_cnt == t_cnt:\n print('Yes')\nelse:\n print('No')\n", "from collections import Counter\ns = input()\nt = input()\ns_cnt = sorted(Counter(s).values(), reverse=True)\nt_cnt = sorted(Counter(t).values(), reverse=True)\nif s_cnt == t_cnt:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s570136005', 's319538186'] | [4144.0, 4016.0] | [41.0, 43.0] | [240, 213] |
p03252 | u286754585 | 2,000 | 1,048,576 | 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. | ['s=input()\nt=input()\ns=sorted(s)\nt=sorted(t)\nif (s==t):\n print("Yes")\nelse:\n print("No")', 's=input()\nt=input()\nn=len(s)\ns=sorted(s)\nt=sorted(t)\nLists={}\nnums=[]\nListt={}\nnumt=[]\n\nfor i in range(n):\n Lists.setdefault(s[i], 0)\n Listt.setdefault(t[i], 0)\n Lists[s[i]]+=1\n Listt[t[i]]+=1\n \nfor j in Lists.values():\n nums.append(j)\n \nfor j in Listt.values():\n numt.append(j)\n#print(nums)\n#print(numt)\n\n#numt=sorted(Listt.values)\n\nif (sorted(nums)==sorted(numt)):\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s776343729', 's757076314'] | [7580.0, 7580.0] | [101.0, 224.0] | [93, 455] |
p03252 | u298945776 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\n\nN = len(S)\nSlist = {}\nTlist = {}\nfor i in range(N):\n if S[i] in Slist:\n Slist[S[i]] += 1\n else:\n Slist[S[i]] = 1\n if T[i] in Tlist:\n Tlist[T[i]] += 1\n else:\n Tlist[T[i]] = 1\n\nM = len(Slist)\nL = len(Tlist)\nif M == L:\n skey = []\n tkey = []\n svalue = []\n tvalue = []\n for k, v in Slist.items():\n skey.append(k)\n svalue.append(v)\n skey.sort()\n svalue.sort()\n print(skey)\n print(svalue)\n for k, v in Tlist.items():\n tkey.append(k)\n tvalue.append(v)\n tkey.sort()\n tvalue.sort()\n print(tkey)\n print(tvalue)\n if svalue == tvalue:\n print('Yes')\n else:\n print('No')\n \nelse:\n print('No')", "S = input()\nT = input()\n\nN = len(S)\nSlist = {}\nTlist = {}\nfor i in range(N):\n if S[i] in Slist:\n Slist[S[i]] += 1\n else:\n Slist[S[i]] = 1\n if T[i] in Tlist:\n Tlist[T[i]] += 1\n else:\n Tlist[T[i]] = 1\n\nM = len(Slist)\nL = len(Tlist)\nif M == L:\n skey = []\n tkey = []\n svalue = []\n tvalue = []\n for k, v in Slist.items():\n skey.append(k)\n svalue.append(v)\n skey.sort()\n svalue.sort()\n \n for k, v in Tlist.items():\n tkey.append(k)\n tvalue.append(v)\n tkey.sort()\n tvalue.sort()\n \n if svalue == tvalue:\n print('Yes')\n else:\n print('No')\n \nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s413990203', 's393706246'] | [3632.0, 3632.0] | [127.0, 127.0] | [741, 683] |
p03252 | u305965165 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\n\n\ns_idx = []\nt_idx = []\n\ndef f(S):\n idx = []\n dic = []\n for s in S:\n if s in dic:\n idx.append(dic.index(s))\n else:\n idx.append(len(dic))\n dic.append(s)\n \n return idx\n\nfor i in range(len(S)):\n if S[i] != T[i]:\n print("No")\n exit()\n\nprint("Yes")', 'S = input()\nT = input()\n\ndef f(S):\n idx = []\n dic = []\n for s in S:\n if s in dic:\n idx.append(dic.index(s))\n else:\n idx.append(len(dic))\n dic.append(s)\n \n return idx\n\ns_idx = f(S)\nt_idx = f(T)\nfor i in range(len(S)):\n if s_idx[i] != t_idx[i]:\n print("No")\n exit()\n\nprint("Yes")'] | ['Wrong Answer', 'Accepted'] | ['s375210977', 's326172700'] | [3632.0, 6832.0] | [18.0, 204.0] | [346, 356] |
p03252 | u310678820 | 2,000 | 1,048,576 | 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. | ["s=input()\nt=input()\ndef C(a, b):\n d={}\n for i in range(len(a)):\n if a[i] in d:\n print(a[i])\n if d[a[i]]!=b[i]:\n return False\n else:\n d[a[i]]=b[i]\n return True\nif C(s, t)and C(t, s):\n print('Yes')\nelse:\n print('No')\n ", "s=input()\nt=input()\ndef C(a, b):\n d={}\n for i in range(len(a)):\n if a[i] in d:\n if d[a[i]]!=b[i]:\n return False\n else:\n d[a[i]]=b[i]\n return True\nif C(s, t)and C(t, s):\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s381132726', 's756442522'] | [4908.0, 3632.0] | [316.0, 88.0] | [300, 267] |
p03252 | u311379832 | 2,000 | 1,048,576 | 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. | ["import string\nimport sys\nS = input()\nT = input()\nsLst = [0] * 26\ntLst = [0] * 26\n\nfor i in range(26):\n sLst[i] = S.count(string.ascii_lowercase[i])\n tLst[i] = T.count(string.ascii_lowercase[i])\nsLst.sort(reverse=True)\ntLst.sort(reverse=True)\n\nfor i in range(26):\n if sLst[i] != tLst[i]:\n print('No')\n sys.exit()\n\nprint('YES')", "import string\nimport sys\nS = input()\nT = input()\nsLst = [0] * 26\ntLst = [0] * 26\n\nfor i in range(26):\n sLst[i] = S.count(string.ascii_lowercase[i])\n tLst[i] = T.count(string.ascii_lowercase[i])\nsLst.sort(reverse=True)\ntLst.sort(reverse=True)\n\nfor i in range(26):\n if sLst[i] != tLst[i]:\n print('No')\n sys.exit()\n\nprint('Yes')\n"] | ['Wrong Answer', 'Accepted'] | ['s806748968', 's023164138'] | [4156.0, 4272.0] | [36.0, 37.0] | [348, 349] |
p03252 | u314050667 | 2,000 | 1,048,576 | 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. | ['import collections as C\nimport sys\ns = input()\nt = input()\n\nif len(set(s)) != len(set(t)):\n print("NO")\n sys.exit()\n\nans = [0] * len(s)\nstock = C.Counter([])\nfor i in range(len(s)):\n if s[i] not in stock.keys():\n stock[s[i]] = t[i]\n ans[i] = stock[s[i]]\n\nss = "".join(ans)\n\nprint("YES") if ss == t else print("NO")\n', 'import collections as C\nimport sys\ns = input()\nt = input()\n\nif len(set(s)) != len(set(t)):\n print("No")\n sys.exit()\n\nans = [0] * len(s)\nstock = C.Counter([])\nfor i in range(len(s)):\n if s[i] not in stock.keys():\n stock[s[i]] = t[i]\n ans[i] = stock[s[i]]\n\nss = "".join(ans)\n\nprint("Yes") if ss == t and len(list(stock.keys())) == len(list(stock.values())) else print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s581793570', 's522430440'] | [5680.0, 5680.0] | [125.0, 120.0] | [334, 391] |
p03252 | u327532412 | 2,000 | 1,048,576 | 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. | ['S, T = input(), input()\nma, ima = {}, {}\nok = True\nfor i in range(len(S)):\n s, t = S[i], T[i]\n if s in ma and ma[s] != t:\n ok = False\n if t in ima and ima[t] != s:\n ok = False\n ma[s] = t, ima[t] = s\nif ok:\n print("Yes")\nelse:\n print("No")', 'S, T = input(), input()\nma, ima = {}, {}\nok = True\nfor i in range(len(S)):\n s, t = S[i], T[i]\n if s in ma and ma[s] != t:\n ok = False\n if t in ima and ima[t] != s:\n ok = False\n ma[s] = t\n ima[t] = s\nif ok:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s233215257', 's834877337'] | [3632.0, 3632.0] | [18.0, 163.0] | [270, 273] |
p03252 | u328755070 | 2,000 | 1,048,576 | 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. | ["from collctions import Counter\n\nS = list(input())\nT = list(input())\n\nScount = Counter(S).values()\nTcount = Counter(T).values()\n\n\n\nif sorted(Scount) == sorted(Tcount):\n ans = 'Yes' \nelse:\n ans = 'No'\n\nprint(ans)", "from collections import Counter\n\nS = list(input())\nT = list(input())\n\nScount = Counter(S).values()\nTcount = Counter(T).values()\n\n\n\nif sorted(Scount) == sorted(Tcount):\n ans = 'Yes' \nelse:\n ans = 'No'\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s463863597', 's165591310'] | [2940.0, 6960.0] | [18.0, 49.0] | [216, 217] |
p03252 | u333190709 | 2,000 | 1,048,576 | 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. | ["a = int('a', 36)\nS = list(input())\nT = list(input())\n\ns_index = [[] for i in range(28)]\nt_index = [[] for i in range(28)]\n\nfor i in range(len(S)):\n s_index[int(S[i], 36) - a].append(i)\n t_index[int(T[i], 36) - a].append(i)\n\ns_index = sorted(s_index)\nt_index = sorted(t_index)\n\nprint(s_index)\nprint(t_index)\n\nif s_index == t_index:\n print('Yes')\nelse:\n print('No')", "a = int('a', 36)\nS = list(input())\nT = list(input())\n\ns_index = [[] for i in range(28)]\nt_index = [[] for i in range(28)]\n\nfor i in range(len(S)):\n s_index[int(S[i], 36) - a].append(i)\n t_index[int(T[i], 36) - a].append(i)\n\ns_index = sorted(s_index)\nt_index = sorted(t_index)\n\nif s_index == t_index:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s030952305', 's047733364'] | [24448.0, 17256.0] | [222.0, 181.0] | [367, 336] |
p03252 | u340010271 | 2,000 | 1,048,576 | 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. | ["S=input()\nT=input()\nfrom collections import Counter\ns=list(S)\nt=list(T)\na=Counter(s)\nb=Counter(t)\nc=a.most_common()\nd=b.most_common()\nflag=True\nfor i in range(len(s)):\n if d[i][1]==1 and c[i][1]==1:\n break\n if d[i][1]>=2 and flag:\n e=[]\n for j in range(len(s)):\n if t[j]==d[i][0]:\n e.append(s[j])\n for j in range(len(e)-1):\n if e[j]!=e[j+1]:\n flag=False\n break\n if c[i][1]>=2 and flag:\n f=[]\n for j in range(len(s)):\n if s[j]==c[i][0]:\n f.append(t[j])\n print(f)\n for j in range(len(f)-1):\n if f[j]!=f[j+1]:\n flag=False\n break\nif flag:\n print('Yes')\nelse:\n print('No')", "from collections import Counter\nS=input()\nT=input()\ns=list(S)\nt=list(T)\na=Counter(s)\nb=Counter(t)\nc=a.most_common()\nd=b.most_common()\nflag=True\nif d[0][1]>=2:\n e=['']*d[0][1]\n for i in range(len(s)):\n if t[i]==d[0][0]:\n e.append(s[i])\n for i in range(len(e)-1):\n if e[i]!=e[i+1]:\n flag=False\nif c[0][1]>=2:\n e=['']*c[0][1]\n for i in range(len(s)):\n if s[i]==c[0][0]:\n e.append(t[i])\n for i in range(len(e)-1):\n if e[i]!=e[i+1]:\n flag=False\nif flag:\n print('Yes')\nelse:\n print('No')", "from collections import Counter\nS=input()\nT=input()\ns=list(S)\nt=list(T)\na=Counter(s)\nb=Counter(t)\nc=a.most_common()\nd=b.most_common()\nflag=True\nif d[0][1]>=2 or c[0][1]>=2:\n e=['']*d[0][1]\n f=['']*c[0][1]\n for i in range(len(s)):\n if t[i]==d[0][0]:\n e.append(s[i])\n for i in range(len(e)-1):\n if e[i]!=e[i+1]:\n flag=False\n for i in range(len(s)):\n if s[i]==c[0][0]:\n f.append(t[i])\n for i in range(len(f)-1):\n if f[i]!=f[i+1]:\n flag=False\nif flag:\n print('Yes')\nelse:\n print('No')", "from collections import Counter\nS=input()\nT=input()\ns=list(S)\nt=list(T)\na=Counter(s)\nb=Counter(t)\nc=a.most_common()\nd=b.most_common()\nflag=True\nfor i in range(min(len(d),len(c))):\n if d[i][1]==1 and c[i][1]==1:\n break\n if d[i][1]>=2 and flag:\n e=[]\n for j in range(len(s)):\n if t[j]==d[i][0]:\n e.append(s[j])\n for j in range(len(e)-1):\n if e[j]!=e[j+1]:\n flag=False\n break\n if c[i][1]>=2 and flag:\n f=[]\n for j in range(len(s)):\n if s[j]==c[i][0]:\n f.append(t[j])\n for j in range(len(f)-1):\n if f[j]!=f[j+1]:\n flag=False\n break\nif flag:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s638226392', 's865105354', 's978556722', 's249632406'] | [10804.0, 9392.0, 10288.0, 8752.0] | [763.0, 199.0, 207.0, 748.0] | [772, 577, 576, 767] |
p03252 | u344959886 | 2,000 | 1,048,576 | 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. | ['s=list(input())\nt=list(input())\nss=len(set(s))\ntt=len(set(t))\n\nl=[]\nfor i,j in zip(s,t):\n l.append(i+j)\nprint(l)\nif len(set(l)) == ss == tt:\n print("Yes")\nelse:\n print("No")\n', 's=list(input())\nt=list(input())\nss=len(set(s))\ntt=len(set(t))\n\nl=[]\nfor i,j in zip(s,t):\n l.append(i+j)\n\nif len(set(l)) == ss == tt:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s213861590', 's024415006'] | [22828.0, 19248.0] | [105.0, 87.0] | [183, 175] |
p03252 | u347640436 | 2,000 | 1,048,576 | 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. | ["from sys import exit\nS = input()\nT = input()\nfor i in range(26):\n c = chr(i + ord('a'))\n d[c] = '\\0'\nfor i in range(len(S)):\n if d[S[i]] != '\\0' or d[T[i]] != '\\0':\n if d[S[i]] != T[i] or d[T[i]] != S[i]:\n print('No')\n exit()\n d[S[i]] = T[i]\n d[T[i]] = S[i]\nprint('Yes')\n", "from sys import exit\nS = input()\nT = input()\nd = {}\nfor i in range(len(S)):\n if S[i] in d or T[i] in d:\n print('No')\n exit()\n d[S[i]] = T[i]\n d[T[i]] = S[i]\nprint('Yes')\n", "from sys import exit\nS = input()\nT = input()\nd = {}\nfor i in range(26):\n c = chr(i + ord('a'))\n d[c] = '\\0'\nfor i in range(len(S)):\n if S[i] != '\\0' or T[i] != '\\0':\n if d[S[i]] != T[i] or d[T[i]] != S[i]:\n print('No')\n exit()\n d[S[i]] = T[i]\n d[T[i]] = S[i]\nprint('Yes')\n", "from sys import exit\nS = input()\nT = input()\nstart = [-1] * 26\ngoal = [-1] * 26\nfor i in range(len(S)):\n a = ord(S[i]) - ord('a')\n b = ord(T[i]) - ord('a')\n\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n print('No')\n exit()\n else:\n start[a] = b\n goal[b] = a\nprint('Yes')\n"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s429522030', 's733503875', 's862710302', 's419484311'] | [3632.0, 3632.0, 3632.0, 3632.0] | [19.0, 18.0, 18.0, 156.0] | [289, 179, 290, 320] |
p03252 | u349091349 | 2,000 | 1,048,576 | 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. | ['import sys\ns=input()\nt=input()\nn=len(s)-1\nd=dict()\nfor i in range(n):\n if t[i] in d.keys():\n \tif d[t[i]] != s[i]:\n print("No")\n sys.exit()\n else:\n d[t[i]] = s[i]\nelse:\n print("Yes")', 'import sys\ns=input()\nt=input()\nn=len(s)\nd=dict()\nd2=dict()\nfor i in range(n):\n if t[i] in d.keys():\n if d[t[i]] != s[i]:\n print("No")\n sys.exit()\n else:\n d[t[i]] = s[i]\n \n if s[i] in d2.keys():\n if d2[s[i]] != t[i]:\n print("No")\n sys.exit()\n else:\n d2[s[i]] = t[i]\nelse:\n print("Yes")'] | ['Runtime Error', 'Accepted'] | ['s432918556', 's490123790'] | [2940.0, 3632.0] | [18.0, 155.0] | [198, 374] |
p03252 | u350248178 | 2,000 | 1,048,576 | 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. | ['import sys\ns=input()\nt=input()\n\ndef c(a,b,s,t):\n li=""\n j=0\n for i in s:\n if i==a:\n li+=b\n if t[j]!=b:\n print("No")\n sys.exit()\n elif i==b:\n li+=a\n else:\n li+=i\n j+=1\n return li\n \n\nfor i in range(len(t)):\n if s[i]!=t[i]:\n l.append(t[i])\n s=c(s[i],t[i],s,t)\n \n \n\nif s==t:\n print("Yes")\nelse:\n print("No")\n \n ', 'import sys\ns=input()\nt=input()\n\ndef c(a,b,s,t):\n li=""\n j=0\n for i in s:\n if i==a:\n li+=b\n if t[j]!=i:\n print("No")\n sys.exit()\n elif i==b:\n li+=a\n else:\n li+=i\n j+=1\n return li\n \nl=[]\n\nfor i in range(len(t)):\n if s[i]!=t[i]:\n for j in l:\n if s[i]==j:\n print("No")\n sys.exit()\n l.append(t[i])\n s=c(s[i],t[i],s,t)\n \n \n\nif s==t:\n print("Yes")\nelse:\n print("No")\n \n ', 's=input()\nt=input()\n\n\ndef f(s):\n l=[]\n a="abcdefghijklmnopqrstuvwxyz"\n r=""\n for i in range(len(s)):\n if s[i] in l:\n for j in range(len(l)):\n if s[i]==l[j]:\n r+=a[j]\n else:\n r+=a[len(l)]\n l.append(s[i])\n return r\n\nif f(s)==f(t):\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s038954519', 's432420011', 's174954264'] | [3632.0, 3632.0, 3820.0] | [18.0, 18.0, 709.0] | [467, 571, 364] |
p03252 | u350997995 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\nans = "Yes"\nstart = [-1]*26\ngoal = [-1]*26\nfor i in range(len(S)):\n s,t = ord(S[i])-96,ord(T[i])-96\n if start[s]!=-1 or goal[t]!=-1:\n if start[s]!=t or goal[t]!=s:\n ans = "No"\n else:\n start[s] = t\n goal[t] = s\nprint(ans)', 'S = input()\nT = input()\nans = "Yes"\nstart = [-1]*26\ngoal = [-1]*26\nfor i in range(len(S)):\n s,t = ord(S[i])-97,ord(T[i])-97\n if start[s]!=-1 or goal[t]!=-1:\n if start[s]!=t or goal[t]!=s:\n ans = "No"\n else:\n start[s] = t\n goal[t] = s\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s160904211', 's925656220'] | [3632.0, 3632.0] | [140.0, 144.0] | [285, 285] |
p03252 | u353241315 | 2,000 | 1,048,576 | 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. | ["from collections import defaultdict\nif __name__ == '__main__':\n S = str(input())\n T = str(input())\n \n count = defaultdict(str)\n \n flag = True\n for i in range(len(S)):\n s = S[i]\n t = T[i]\n if count[t] != '':\n if count[t] != s:\n flag = False\n else:\n count[t] = s\n if flag:\n print(1/0)\n print('Yes')\n else:\n print('No')", "from collections import defaultdict\nif __name__ == '__main__':\n S = str(input())\n T = str(input())\n \n count = defaultdict(str)\n count2 = defaultdict(str)\n flag = True\n for i in range(len(S)):\n s = S[i]\n t = T[i]\n if count[t] != '':\n if count[t] != s:\n flag = False\n else:\n if count2[s] != '':\n if count2[s] != t:\n flag = False\n else:\n count[t] = s\n count2[s] = t\n if flag:\n print('Yes')\n else:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s509111768', 's901998628'] | [4016.0, 4016.0] | [99.0, 91.0] | [429, 587] |
p03252 | u357949405 | 2,000 | 1,048,576 | 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. | ['from collections import Counter\n\nS = input()\nT = input()\nN = len(S)\n\n# counter_S = []\n# counter = 1\n# p = S[0]\n\n# if p != S[i]:\n# counter_S.append(counter)\n# p = S[i]\n# counter = 1\n# else:\n# counter += 1\n# counter_S.append(counter)\n#\n# counter_T = []\n# counter = 1\n# p = T[0]\n\n# if p != T[i]:\n# counter_T.append(counter)\n# p = T[i]\n# counter = 1\n# else:\n# counter += 1\n# counter_T.append(counter)\n\ncounter_S = []\ncounter_T = []\ncount_S = 1\ncount_T = 1\np_S = S[0]\np_T = T[0]\nfor i in range(1, N):\n if p_S != S[i]:\n counter_S.append(count_S)\n p_S = S[i]\n count_S = 1\n else:\n count_S += 1\n if p_T != T[i]:\n counter_T.append(count_T)\n p_T = T[i]\n count_T = 1\n else:\n count_T += 1\ncounter_S.append(count_S)\ncounter_T.append(count_T)\n\nprint(counter_S)\nprint(counter_T)\n\nlength_CS = len(counter_S)\nlength_CT = len(counter_T)\n\nif length_CS != length_CT:\n print("No")\nelse:\n flag = True\n for i in range(length_CS):\n if counter_S != counter_T:\n flag = False\n break\n if flag:\n print("Yes")\n else:\n print("No")\n', 'S = input()\nT = input()\nN = len(S)\n\ndict_S = {}\ndict_T = {}\n\nfor i in range(N):\n # print("dict_S: {}".format(dict_S))\n # print("dict_T: {}".format(dict_T))\n if S[i] in dict_S:\n if dict_S[S[i]] != T[i]:\n print("No")\n exit()\n if T[i] in dict_T:\n if dict_T[T[i]] != S[i]:\n print("No")\n exit()\n dict_S[S[i]] = T[i]\n dict_T[T[i]] = S[i]\nprint("Yes")\n'] | ['Wrong Answer', 'Accepted'] | ['s473678273', 's115373142'] | [9340.0, 3760.0] | [2104.0, 196.0] | [1251, 421] |
p03252 | u361381049 | 2,000 | 1,048,576 | 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. | ["s = list(input())\nt = list(input())\ndic = {}\nflg = 'Yes'\nfor i in range(len(s)):\n if s[i] in dic.keys():\n if t[i] != dic.values(s[i]):\n flg = 'No'\n else:\n dic[s[i]] = t[i]\nprint(flg)", "s = list(input())\nt = list(input())\ndic = {}\nflg = 'Yes'\nfor i in range(len(s)):\n if s[i] in dic.keys():\n if dic[s[i]] != t[i]:\n flg = 'No'\n else:\n dic[s[i]] = t[i]\ndic2 = {}\nfor i in range(len(s)):\n if t[i] in dic2.keys():\n if dic2[t[i]] != s[i]:\n flg = 'No'\n else:\n dic2[t[i]] = s[i]\n#print(dic)\nprint(flg)"] | ['Runtime Error', 'Accepted'] | ['s923484541', 's837949855'] | [6704.0, 6704.0] | [24.0, 159.0] | [214, 370] |
p03252 | u367130284 | 2,000 | 1,048,576 | 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. | ["from itertools import*;i=lambda:sorted([len(list(v))for k,v in groupby(input()]);print('YNeos'[i()!=i()::2])", 'from collections import*\ne=defaultdict(list)\nd=defaultdict(list)\nfor k,v in enumerate(input()):\n e[v].append(k)\nfor k,v in enumerate(input()):\n d[v].append(k)\nif set(map(tuple,e.values()))==set(map(tuple,d.values())):\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s613361971', 's523429155'] | [2940.0, 23472.0] | [17.0, 122.0] | [108, 262] |
p03252 | u371385198 | 2,000 | 1,048,576 | 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. | ['import sys\ninput = sys.stdin.readline\n\n\ndef readstr():\n return input().strip()\n\n\ndef readint():\n return int(input())\n\n\ndef readnums():\n return map(int, input().split())\n\n\ndef readstrs():\n return input().split()\n\n\ndef main():\n S = readstr()\n T = readstr()\n sl = dict()\n for i, s in enumerate(S):\n if s == T[i]:\n continue\n else:\n if s in sl.keys():\n if sl[s] != T[i]:\n print(\'No\')\n sys.exit()\n elif s in sl.values():\n print(\'No\')\n sys.exit()\n else:\n if T[i] in sl.values():\n print(\'No\')\n sys.exit()\n else:\n sl[s] = T[i]\n\n print(\'Yes\')\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\ninput = sys.stdin.readline\n\n\ndef readstr():\n return input().strip()\n\n\ndef readint():\n return int(input())\n\n\ndef readnums():\n return map(int, input().split())\n\n\ndef readstrs():\n return input().split()\n\n\ndef main():\n S = readstr()\n T = readstr()\n\n sl = dict()\n tl = dict()\n for s, t in zip(S, T):\n if s not in sl:\n sl[s] = t\n else:\n if sl[s] != t:\n print(\'No\')\n break\n\n if t not in tl:\n tl[t] = s\n else:\n if tl[t] != s:\n print(\'No\')\n break\n else:\n print(\'Yes\')\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s056933465', 's013366975'] | [3632.0, 3632.0] | [61.0, 52.0] | [828, 679] |
p03252 | u373047809 | 2,000 | 1,048,576 | 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. | ['from collections import*\nf=lambda:sorted(Counter(input()).values())\nprint("YNEOS"[f()!=f()::2])', 'from collections import*\nf=lambda:sorted(Counter(input()).values())\nprint("YNeos"[f()!=f()::2])'] | ['Wrong Answer', 'Accepted'] | ['s761595328', 's731937448'] | [9568.0, 9456.0] | [52.0, 52.0] | [95, 95] |
p03252 | u375616706 | 2,000 | 1,048,576 | 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. | ['mod = 10 ** 9 + 7\nn, m = map(int, input().split())\n\nf = []\np = 2\nwhile p * p <= m:\n if m % p != 0:\n p += 1\n continue\n c = 0\n while m % p == 0:\n c += 1\n m //= p\n f.append(c)\n p += 1\nif m != 1:\n f.append(1)\n\n\ndef comb(a, b):\n ret = 1\n r = min(b, a-b)\n for i in range(a-r+1, a+1):\n ret *= i\n for j in range(1, r+1):\n ret //= j\n return (int)(ret)\n\n\nans = 1\nfor i in f:\n c = 1\n for j in range(i):\n c = c * (n+j) // (j+1)\n ans *= c\nprint(ans % mod)\n', 'import collections\ns=(str)(input())\nt=(str)(input())\n\ns_c=collections.Counter(s)\ns_t=collections.Counter(t)\nfor i in range(len(s_c)):\n if s_c.get(s[i]) != s_t.get(t[i]):\n print("No")\n exit()\nprint("Yes")\n'] | ['Runtime Error', 'Accepted'] | ['s874971449', 's182893648'] | [3572.0, 4016.0] | [20.0, 41.0] | [534, 221] |
p03252 | u375695365 | 2,000 | 1,048,576 | 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. | ['import collections\n\n\ns=str(input())\nt=str(input())\n\nsa=list(s)\nta=list(t)\n\nasa=collections.Counter(sa)\nata=collections.Counter(ta)\n\ncasa=[i[0] for i in asa.items() if i[1] >= 2]\n\ncata=[i[0] for i in ata.items() if i[1] >= 2]\n#print(casa)\n#print(cata)\nif casa==[] and cata==[]:\n print("Yes")\n exit()\n\n\n ', "import collections \n\ns=input()\nt=input()\ns= collections.Counter(s)\nt= collections.Counter(t)\n#print(s)\nsans=[]\ntans=[]\n\nfor v in s.values():\n sans.append(v)\nfor v in t.values():\n tans.append(v)\nsans.sort()\ntans.sort()\n#print(sans,tans)\nif sans==tans:\n print('Yes')\nelse:\n print('No')\n"] | ['Wrong Answer', 'Accepted'] | ['s538863904', 's115184021'] | [7216.0, 4136.0] | [48.0, 40.0] | [336, 296] |
p03252 | u390694622 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\nf = [-1 for _ in range(130)]\ng = [-1 for _ in range(130)]\nans = "Yes"\nfor i in len(S):\n s = ord(S[i])\n t = ord(T[i])\n if f[s] == -1:\n f[s] = t\n else:\n if f[s] != t:\n ans = "No"\n if g[t] == -1:\n g[t] = s\n else:\n if g[t] != s:\n ans = "No"\nprint(ans)', 'S = input()\nT = input()\nf = [-1 for _ in range(130)]\ng = [-1 for _ in range(130)]\nans = "Yes"\nfor i in range(len(S)):\n s = ord(S[i])\n t = ord(T[i])\n if f[s] == -1:\n f[s] = t\n else:\n if f[s] != t:\n ans = "No"\n if g[t] == -1:\n g[t] = s\n else:\n if g[t] != s:\n ans = "No"\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s789742924', 's451051981'] | [3632.0, 3632.0] | [17.0, 138.0] | [299, 307] |
p03252 | u394853232 | 2,000 | 1,048,576 | 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. | ['s1 = input()\ns2 = input()\nif len(s1) != len(s2):\n print("No")\nelse:\n D1 = {}\n D2 = {}\n flag = True\n for x, y in zip(s1, s2):\n if x not in D1:\n D1[x] = y\n else:\n flag = (flag and (D1[x] == [y]))\n if y not in D2:\n D2[y] = x\n else:\n flag = (flag and (D2[y] == [x]))\n if not flag:\n break\n if flag:\n print("Yes")\n else:\n print("No")', 's1 = input()\ns2 = input()\nif len(s1) != len(s2):\n print("No")\nelse:\n D1 = {}\n D2 = {}\n flag = True\n for x, y in zip(s1, s2):\n if x not in D1:\n D1[x] = y\n else:\n flag = (flag and (D1[x] == y))\n if y not in D2:\n D2[y] = x\n else:\n flag = (flag and (D2[y] == x))\n if not flag:\n break\n if flag:\n print("Yes")\n else:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s109554099', 's275243299'] | [3632.0, 3632.0] | [18.0, 99.0] | [452, 448] |
p03252 | u395816772 | 2,000 | 1,048,576 | 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. | ["s = input()\nt = input()\nmemo = {}\nans = 'Yes'\nfor i in range(len(s)):\n if s[i] in memo:\n if t[i] != memo[s[i]]:\n ans = 'No'\n break\n else:\n memo[s[i]] = t[i]\na = memo.values()\nif set(a) != len(a):\n ans = 'No'\nprint(ans)", "s = input()\nt = input()\nmemo = {}\nans = 'Yes'\nfor i in range(len(s)):\n if s[i] in memo:\n if t[i] != memo[s[i]]:\n ans = 'No'\n break\n else:\n memo[s[i]] = t[i]\na = list(memo.values())\nb = list(set(a))\nif len(b) != len(a):\n ans = 'No'\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s969523740', 's669178645'] | [9348.0, 9416.0] | [74.0, 72.0] | [263, 286] |
p03252 | u403984573 | 2,000 | 1,048,576 | 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. | ['S=input()\nT=input()\nSkey=sorted(S,key=S.index)\nTkey=sorted(t,ket=T.index)\n\nfor index,i in enumerate(Skey):\n S=S.replace(i,str(index))\nfor index,i in enumerate(Tkey):\n T=T.replace(i,str(index))\n\nif S==T:\n print("Yes")\nelse:\n print("No")\n', 'S=input()\nT=input()\nSkey,Tkey=[],[]\nfor i in range(len(S)):\n Skey.append(S[i])\n Tkey.append(T[i])\n\nfor index,i in enumerate(Skey):\n S=S.replace(i,str(index))\nfor index,i in enumerate(Tkey):\n T=T.replace(i,str(index))\nprint(S,T)\n\nif S==T:\n print("Yes")\nelse:\n print("No")\n', 'S=input()\nT=input()\nSkey=sorted(set(S),key=S.index)\nTkey=sorted(set(T),key=T.index)\n\nfor index,i in enumerate(Skey):\n S=S.replace(i,str(index))\nfor index,i in enumerate(Tkey):\n T=T.replace(i,str(index))\n\nif S==T:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s011933698', 's724491113', 's026343014'] | [8688.0, 7136.0, 3992.0] | [79.0, 2104.0, 40.0] | [240, 277, 250] |
p03252 | u408620326 | 2,000 | 1,048,576 | 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. | ["import sys\nfrom collections import defaultdict\ninput = sys.stdin.readline\n\nS = input().strip()\nT = input().strip()\ndic = defaultdict(list)\n\ndef check(d):\n for k, i in d.items():\n if k != i:\n return False\n else:\n return True\n\nfor s, t in zip(S, T):\n if t not in dic[s]:\n dic[s].append(t)\n\nfor k, i in dic.items():\n if len(i) > 1:\n print('No')\n exit()\n else:\n dic[k] = i[0]\n\nfor k, i in dic.items():\n if i not in dic:\n dic[i] = i\n del dic[k]\n else:\n dic[k], dic[i] = k, i\nif check(dic):\n print('Yes')\nelse:\n print('No')", "import sys\ninput = sys.stdin.readline\n\nS = input().strip()\nT = input().strip()\n\ndic = defaultdict(list)\n\ndef check(d):\n for k, i in d.items():\n if k != i:\n return False\n else:\n return True\n\nfor s, t in zip(S, T):\n if s not in dic:\n dic[s] = t\n elif dic[s] != t:\n print('No')\n exit()\n\nif len(dic) != len(set(dic.values())):\n print('No')\nelse:\n print('Yes')", "import sys\nfrom collections import defaultdict\ninput = sys.stdin.readline\n\nS = input().strip()\nT = input().strip()\n\ndic = defaultdict(list)\n\ndef check(d):\n for k, i in d.items():\n if k != i:\n return False\n else:\n return True\n\nfor s, t in zip(S, T):\n if t not in dic[s]:\n dic[s].append(t)\n\nfor k, i in dic.items():\n if len(i) > 1:\n print('No')\n exit()\n else:\n dic[k] = i[0]\n\nc = 0\nwhile c <= 100:\n for k, i in dic.items():\n if i not in dic:\n dic[i] = i\n del dic[k]\n else:\n dic[k], dic[i] = k, i\n c += 1\n\nif check(dic):\n print('Yes')\nelse:\n print('No')", "import sys\ninput = sys.stdin.readline\n\nS = input().strip()\nT = input().strip()\ndic = {}\n\nfor s, t in zip(S, T):\n if s not in dic:\n dic[s] = t\n elif dic[s] != t:\n print('No')\n exit()\n\nif len(dic) != len(set(dic.values())):\n print('No')\nelse:\n print('Yes')"] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s297356865', 's698634359', 's894415788', 's807336840'] | [4144.0, 3632.0, 4144.0, 3632.0] | [75.0, 18.0, 73.0, 57.0] | [618, 419, 677, 287] |
p03252 | u416758623 | 2,000 | 1,048,576 | 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. | ['import sys\nfrom collections import defaultdict\ns = input()\nt = input()\nd1 = defaultdict(set)\nd2 = defaultdict(set)\n\nfor i in range(len(s)):\n d1[t[i]].add(s[i])\n d2[s[i]].add(t[i])\n print(d1,d2)\n if len(d1[t[i]])>1 or len(d2[s[i]])>1:\n print("No")\n sys.exit()\nprint("Yes")\n', 'import sys\nfrom collections import defaultdict\ns = input()\nt = input()\nd1 = defaultdict(set)\nd2 = defaultdict(set)\n\nfor i in range(len(s)):\n d1[t[i]].add(s[i])\n d2[s[i]].add(t[i])\n if len(d1[t[i]])>1 or len(d2[s[i]])>1:\n print("No")\n sys.exit()\nprint("Yes")\n'] | ['Wrong Answer', 'Accepted'] | ['s866173930', 's895917716'] | [36972.0, 3932.0] | [2104.0, 176.0] | [298, 281] |
p03252 | u417794477 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\n\nfor i in range(len(s)):\n if s[i] == t[i]:\n continue\n else:\n s = s.translate(str.maketrans({s[i]: t[i], t[i]: s[i]}))\nif s == t:\n print("yes")\nelse:\n print("no")', 'S = input()\nT = input()\nSdictionary = {}\nTdictionary = {}\nans = "Yes"\nfor i in range(len(S)):\n if T[i] in Tdictionary:\n if Tdictionary[T[i]] == S[i]:\n continue\n else:\n ans = "No"\n else:\n Tdictionary[T[i]] = S[i]\n if S[i] in Sdictionary:\n if Sdictionary[S[i]] == T[i]:\n continue\n else:\n ans = "No"\n else:\n Sdictionary[S[i]] = T[i]\n\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s192590310', 's858318726'] | [4400.0, 3632.0] | [2104.0, 124.0] | [211, 441] |
p03252 | u440161695 | 2,000 | 1,048,576 | 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. | ['S=input()\nT=input()\nA=[]\nB=[]\nc,d=0,0\nfor i in range(len(S)):\n if S[i]==S[i+1]:\n c+=1\n else:\n A.append(c)\n c=0\n\nfor i in range(len(T)):\n if T[i]==T[i+1]:\n d+=1\n else:\n B.append(d)\n d=0\nprint("Yes" if A==B else "No")', 'S=input()\nT=input()\nRs=[-1]*26\nRt=[-1]*26\nfor i in range(len(S)):\n a=ord(S[i])-ord("a")\n b=ord(T[i])-ord("a")\n if Rs[a]==-1:\n Rs[a]=b\n elif Rs[a]!=b:\n print("No")\n exit()\n if Rt[b]==-1:\n Rt[b]=a\n elif Rt[b]!=a:\n print("No")\n exit()\nprint("Yes")'] | ['Runtime Error', 'Accepted'] | ['s836728042', 's415410167'] | [5168.0, 3632.0] | [75.0, 169.0] | [237, 268] |
p03252 | u442581202 | 2,000 | 1,048,576 | 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. | ['str1 = list(input())\nstr2 = list(input())\n\nn = len(str1)\n\nfor i in range(n):\n if str1[i]==str2[i]:\n continue\n for j in range(i+1,n):\n if str1[j]==str1[i]:\n tmp = str2[i]\n str2[i] = str1[j]\n str1[j] = tmp\n break\n elif str2[j] == str1[i]:\n tmp = str2[j]\n str2[j] = str1[i+1]\n str1[i+1] = str2[i]\n str2[i] = tmp\n break\nstr1 = \'\'.join(str1)\nstr2 = \'\'.join(str2) \n\nif(str1 == str2):\n print("YES")\nelse:\n print("NO")\n', 'str1 = list(input())\nstr2 = list(input())\n\nn = len(str1)\n\nstr1 = \'\'.join(str1)\nstr2 = \'\'.join(str2) \nif (str1 == str2):\n print("No")\n exit(0)\nfor i in range(n):\n if str1[i]==str2[i]:\n continue\n for j in range(i+1,n):\n if str1[j]==str1[i]:\n tmp = str2[i]\n str2[i] = str1[j]\n str1[j] = tmp\n break\n elif str2[j] == str1[i]:\n tmp = str2[j]\n str2[j] = str1[i+1]\n str1[i+1] = str2[i]\n str2[i] = tmp\n break\nstr1 = \'\'.join(str1)\nstr2 = \'\'.join(str2) \n\nif(str1 == str2):\n print("Yes")\nelse:\n print("No")\n', 'str1 = input()\nstr2 = input()\n\nn = len(str1)\nd1 = dict()\nd2 = dict()\nfor i in range(26):\n d1[chr(97+i)] = \'\'\n d2[chr(97+i)] = \'\'\nres = "Yes"\nfor i in range(n):\n if d1[str1[i]] != \'\' and d1[str1[i]]!=str2[i]:\n res = "No"\n break\n if d2[str2[i]] != \'\' and d2[str2[i]]!=str1[i]:\n res = "No"\n break\n if d1[str1[i]] == \'\':\n d1[str1[i]] = str2[i]\n if d2[str2[i]] == \'\':\n d2[str2[i]] = str1[i]\nprint(res)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s264135184', 's670070195', 's169594361'] | [8488.0, 6704.0, 3632.0] | [616.0, 26.0, 183.0] | [543, 633, 457] |
p03252 | u442877951 | 2,000 | 1,048,576 | 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. | ['S = str(input())\nT = str(input())\nalp = "abcdefghijklmnopqrstuvwxyz"\nfor i in range(0,len(S)//2):\n if S[i] != T[i]:\n S = S.translate(str.maketrans({S[i]:T[i], T[i]:S[i]}))\n if S == T:\n print("Yes")\n exit()\nprint("No")', 'from collections import Counter\nS = str(input())\nT = str(input())\ns = Counter(S)\nt = Counter(T)\nif sorted(s.values()) == sorted(t.values()):\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s550371048', 's157873654'] | [4512.0, 4016.0] | [2104.0, 41.0] | [228, 175] |
p03252 | u444398697 | 2,000 | 1,048,576 | 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. | ["a=input()\nb=input()\n\nwhile (1):\n if a=='':\n break\n a=a.replace(a[0],'')\n b=b.replace(b[0],'')\n print(a,b)\n \n\n if len(a)!=len(b):\n print('No')\n exit()\n\nprint('Yes')\n", "a=input()\nb=input()\n\nwhile (1):\n if a=='':\n break\n a=a.replace(a[0],'')\n b=b.replace(b[0],'') \n\n if len(a)!=len(b):\n print('No')\n exit()\n\nprint('Yes')\n"] | ['Wrong Answer', 'Accepted'] | ['s307456737', 's813115417'] | [5484.0, 3632.0] | [32.0, 31.0] | [203, 187] |
p03252 | u445619807 | 2,000 | 1,048,576 | 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. | ['import numpy as np\nimport copy\n\ndef main():\n data0 = np.array(list(input()))\n data1 = np.array(list(input()))\n\n flag = True\n data_tmp = data0\n count = 0\n len_data = len(data0)\n while(count <= len_data):\n if not list(data0):\n break\n count += 1\n c0 = data0[0]\n c1 = data1[0]\n if np.allclose(data0 == c0, data1 == c1)\n data0 = data0[data0 != c0]\n data1 = data1[data1 != c1]\n else:\n flag = False\n\n if flag:\n print(\'Yes\')\n else:\n print(\'No\')\n\n\n\ndef swap(data, c0, c1):\n data_tmp = copy.copy(data)\n data_tmp[data == c0] = c1\n data_tmp[data == c1] = c0\n return data_tmp\n\nif __name__ == "__main__":\n main()\n', 'def main():\n data0 = input()\n data1 = input()\n\n flag = True\n data_tmp = data0\n count = 0\n len_data = len(data0)\n while True:\n if data0 == "":\n break\n\n data0 = data0.replace(data0[0], "")\n data1 = data1.replace(data1[0], "")\n\n if len(data0) != len(data1):\n print(\'No\')\n exit()\n\n print(\'Yes\')\n\nif __name__ == "__main__":\n main()\n'] | ['Runtime Error', 'Accepted'] | ['s421349972', 's051654786'] | [2940.0, 3760.0] | [17.0, 31.0] | [741, 415] |
p03252 | u445624660 | 2,000 | 1,048,576 | 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. | ['\ns = input()\nt = input()\nsd, td = {}, {}\nfor i in range(len(s)):\n if s[i] not in sd and t[i] not in td:\n sd[s[i]] = t[i]\n td[t[i]] = s[i]\n else:\n # if sd[s[i]] != t[i] or td[t[i]] != s[i]:\n if s[i] in sd and t[i] in td:\n pass\n else:\n print("No")\n exit()\n\nfor k in sd.keys():\n if k in sd.values():\n print("No")\n exit()\n\nprint("Yes")\n', '\n# c->r, r->c = rhokudai\n\n\n\n\n\ns, t = list(input()), list(input())\nsd, td = {}, {}\nfor sv in s:\n if sv not in sd:\n sd[sv] = 1\n else:\n sd[sv] += 1\nfor tv in t:\n if tv not in td:\n td[tv] = 1\n else:\n td[tv] += 1\nss, ts = sorted(sd.values()), sorted(td.values())\nif ss == ts:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s071753750', 's291239831'] | [3692.0, 12236.0] | [79.0, 87.0] | [488, 750] |
p03252 | u448747186 | 2,000 | 1,048,576 | 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. | ["import collections\nS = (input())\nT = (input())\n\ncount1 = collections.Counter(S)\ncount2 = collections.Counter(T)\n\ncount1=sorted(count1.items(), key=lambda x: x[1])\ncount2=sorted(count2.items(), key=lambda x: x[1])\n\nif len(S) == len(T):\n if len(count1) != len(count2):\n print('No')\n else:\n for k1, k2 in zip(count1, count2):\n if k1[1] > 1:\n indexes = [i for i, x in enumerate(S) if x == k1[0]]\n indexes2 = [i for i, x in enumerate(S) if x == k2[0]]\n if indexes != indexes2:\n print('No')\n else:\n print('Yes')\nelse:\n print('No')\n\n\n# if count1[k1] > 1:\n\n", "import collections\nS = (input())\nT = (input())\n\ncount1 = collections.Counter(S)\ncount2 = collections.Counter(T)\n\ncount1=sorted(count1.items(), key=lambda x: x[1])\ncount2=sorted(count2.items(), key=lambda x: x[1])\n\nif len(S) == len(T):\n if len(count1) != len(count2):\n print('No')\n else:\n for k1, k2 in zip(count1, count2):\n if k1[1] > 1:\n indexes = [i for i, x in enumerate(S) if x == k1[0]]\n indexes2 = [i for i, x in enumerate(S) if x == k1[0]]\n if indexes != indexes2:\n print('No')\n else:\n print('Yes')\nelse:\n print('No')\n\n\n# if count1[k1] > 1:\n\n", "import collections\nS = (input())\nT = (input())\n\ncount1 = collections.Counter(S)\ncount2 = collections.Counter(T)\n\ncount1=sorted(count1.items(), key=lambda x: x[1])\ncount2=sorted(count2.items(), key=lambda x: x[1])\n\nif len(S) == len(T):\n if len(count1) != len(count2):\n print('No')\n else:\n for k1, k2 in zip(count1, count2):\n if k1[1] > 1:\n indexes = [i for i, x in enumerate(S) if x == k1[0]]\n indexes2 = [i for i, x in enumerate(T) if x == k2[0]]\n if indexes != indexes2:\n print('No')\n else:\n print('Yes')\nelse:\n print('No')\n\n\n# if count1[k1] > 1:\n\n", "import collections\nS = (input())\nT = (input())\n\ncount1 = collections.Counter(S)\ncount2 = collections.Counter(T)\n\ncount1=sorted(count1.items(), key=lambda x: x[1])\ncount2=sorted(count2.items(), key=lambda x: x[1])\n\n\nindexes = []\nindexes2 = []\n\nif len(S) == len(T):\n if len(count1) != len(count2):\n print('No')\n else:\n for k1, k2 in zip(count1, count2):\n if k1[1] > 1:\n indexes.append((i for i, x in enumerate(S) if x == k1[0]))\n indexes2.append(i for i, x in enumerate(T) if x == k2[0])\n if set(indexes) == indexes2:\n print('Yes')\n else:\n print('No')\nelse:\n print('No')\n\n\n# if count1[k1] > 1:\n\n", "import collections\nS = (input())\nT = (input())\n\ncount1 = collections.Counter(S)\ncount2 = collections.Counter(T)\n\ncount1=sorted(count1.items(), key=lambda x: x[1])\ncount2=sorted(count2.items(), key=lambda x: x[1])\n\n\nindexes = []\nindexes2 = []\n\nif len(S) == len(T):\n if len(count1) != len(count2):\n print('No')\n else:\n for k1, k2 in zip(count1, count2):\n if k1[1] > 1:\n indexes.append(tuple([i for i, x in enumerate(S) if x == k1[0]]))\n indexes2.append(tuple([i for i, x in enumerate(T) if x == k2[0]]))\n if set(indexes) == set(indexes2):\n print('Yes')\n else:\n print('No')\nelse:\n print('No')\n\n\n# if count1[k1] > 1:\n\n"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s830584005', 's838011999', 's857649051', 's990336552', 's392324667'] | [15892.0, 15892.0, 15880.0, 3932.0, 20344.0] | [603.0, 647.0, 625.0, 42.0, 616.0] | [756, 756, 756, 776, 797] |
p03252 | u449863068 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\nd = {}\n\nfor s, t in zip(S, T):\n if s in d:\n \n if d[s] != t:\n print("No")\n exit()\n else:\n d[s] = t\n\nprint(d)\nprint(len(d))\nprint(len(set(d.values())))\n\n\nif len(d) != len(set(d.values())):\n print("No")\nelse:\n print("Yes")\n\n', 'S = input()\nT = input()\nd = {}\n\nfor s, t in zip(S, T):\n if s in d:\n \n if d[s] != t:\n print("No")\n exit()\n else:\n d[s] = t\n\n\nif len(d) != len(set(d.values())):\n print("No")\nelse:\n print("Yes")\n\n'] | ['Wrong Answer', 'Accepted'] | ['s977445758', 's472143570'] | [3632.0, 3632.0] | [58.0, 53.0] | [460, 408] |
p03252 | u451017206 | 2,000 | 1,048,576 | 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. | ['from math import sqrt, ceil, factorial\nfrom collections import Counter\n\nm = 10**9+7\ndef is_prime(n):\n if n == 1: return False\n if n == 2: return True\n for i in range(2, ceil(sqrt(n))+1):\n if n % i == 0: return False\n return True\n\ndef prime_factorization(n):\n if is_prime(n):return [n]\n factor = []\n f = 2\n while n > 1:\n if n % f == 0:\n factor.append(f)\n n /= f\n else:\n f += 1\n return factor\n\ndef comb(n, r):\n a = 1\n for i in range(n-r+1, n+1):\n a *= i\n return a//factorial(r)\n\nN, M = map(int, input().split())\np = prime_factorization(M)\nc = Counter(p)\nans = 1\nfor v in c.values():\n ans *= (comb(v + N - 1, v) % m)\nprint(ans%m)', "S = input()\nT = input()\nans ='Yes'\nd = {}\nd2 = {}\nfor s, t in zip(S, T):\n\n if d.get(s) is not None:\n if d[s] != t:\n ans = 'No'\n break\n else:\n d[s] = t\n\n if d2.get(t) is not None:\n if d2[t] != s:\n ans = 'No'\n break\n else:\n d2[t] = s\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s050355510', 's447585529'] | [3824.0, 3632.0] | [22.0, 124.0] | [726, 327] |
p03252 | u456353530 | 2,000 | 1,048,576 | 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. | ['Ga={}\nGb={}\nA=list(input())\nB=list(input())\nflag = True\nfor i in range(len(A)):\n if A[i] in Ga and Ga[A[i]] != B[i]:\n flag = False\n break\n else:\n Ga[A[i]] = B[i]\nfor i in range(len(B)):\n if B[i] in Gb and Gb[B[i]] != A[i]:\n flag = False\n break\n else:\n Gb[B[i]] = A[i]\nif flag:\n print("yes")\nelse:\n print("no")', 'import sys\nGa={}\nGb={}\nA=list(input())\nB=list(input())\nfor i in range(len(A)):\n if A[i] in Ga and Ga[A[i]] != B[i]:\n print("No")\n sys.exit()\n else:\n Ga[A[i]] = B[i]\nfor i in range(len(B)):\n if B[i] in Gb and Gb[B[i]] != A[i]:\n print("No")\n sys.exit()\n else:\n Gb[B[i]] = A[i]\nprint("Yes")'] | ['Wrong Answer', 'Accepted'] | ['s907982684', 's959228927'] | [6704.0, 6704.0] | [186.0, 203.0] | [333, 309] |
p03252 | u463655976 | 2,000 | 1,048,576 | 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. | ['S = input()\nT = input()\n\nU = set()\nfor s, t in sorted(zip(S, T)):\n U.add((s, t))\n\nfor x, y in zip(U[0:-1], U[1:]):\n if x == y:\n print("No")\n break\nelse:\n print("Yes")\n\n \n\n', 'S = input()\nT = input()\n\nU = set()\nfor s, t in sorted(zip(S, T)):\n U.add((s, t))\n\nU = sorted(U)\nprint(U)\nfor x, y in zip(U[0:-1], U[1:]):\n if x[0] == y[0]:\n print("No")\n break\nelse:\n print("Yes")\n', 'S = input()\nT = input()\nTS = list(zip(T, S))\n\nTS_set = set()\nfor t,s in TS:\n TS_set.add((t,s))\n\nS_set = set()\nfor x in TS_set:\n S_set.add(x[1])\n\nT_set = set()\nfor x in TS_set:\n T_set.add(x[0])\n\nprint("Yes" if S == T or len(TS_set) == len(S_set) == len(T_set) else "No")\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s274552922', 's536303485', 's370177929'] | [18728.0, 18728.0, 17968.0] | [196.0, 206.0, 81.0] | [181, 205, 273] |
p03252 | u465691148 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\n\ni = 0\nhis = []\nlength = len(s)\nflag = True\nfor i in range(0, length-1):\n\tss = s[i:i+1]\n\ttt = t[i:i+1]\n\tif ss != tt:\n\t\tif tt in his:\n\t\t\tflag = False\n\t\t\tbreak\n\t\telse:\n\t\t\this.append(tt)\n\t\t\tit1 = re.finditer(ss, s)\n\t\t\tit2 = re.finditer(tt, s)\n\t\t\tfor match in it1:\n\t\t\t\ts = s[:match.start()] + tt + s[match.end():]\n\t\t\tfor match in it2:\n\t\t\t\ts = s[:match.start()] + ss + s[match.end():]\n\nif flag:\n\tprint("Yes")\nelse:\n\tprint("No")\n', 's = input()\nt = input()\n\nstart = [-1] * 26\ngoal = [-1] * 26\nflag = True\nlength = len(s)\ndict = { chr(97 + i):i for i in range(26) }\nfor i in range(0, length):\n\ta = dict[s[i]]\n\tb = dict[t[i]]\n\n\tif start[a] != -1 or goal[b] != -1:\n\t\tif start[a] != b or goal[b] != a:\n\t\t\tflag = False\n\t\t\tbreak\n\telse:\n\t\tstart[a] = b;\n\t\tgoal[b] = a;\nif flag:\n\tprint("Yes")\nelse:\n\tprint("No")'] | ['Runtime Error', 'Accepted'] | ['s376803572', 's163024660'] | [3632.0, 3632.0] | [19.0, 118.0] | [447, 369] |
p03252 | u466331465 | 2,000 | 1,048,576 | 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. | ['S = list(input())\nT = list(input())\ndics ={}\ndic ={}\nfor i in range(len(S)):\n if S[i] in dics:\n \tdics[S[i]]=[dics[S[i]],i]\n else :\n dics[S[i]]=[i]\n if T[i] in dic:\n dic[T[i]]=[dic[T[i]],i]\n else:\n dic[T[i]]=[i]\nprint(dic)\nfor i in range(len(S)):\n if dics[S[i]]!=dic[T[i]] and (T[i] in dics and dics[T[i]]!=dic[S[i]]):\n print("No")\n exit()\nprint("Yes")\n ', 'S = list(input())\nT = list(input())\ndics ={}\ndic ={}\nfor i in range(len(S)):\n if S[i] in dics:\n \tdics[S[i]].append(i)\n else :\n dics[S[i]]=i\n if T[i] in dic:\n \tdic[T[i]].append(i)\n else:\n dic[T[i]]=i\nfor i in range(len(S)):\n if dics[S[i]]!=dic[T[i]] and (T[i] in dics and dics[T[i]]!=dic[S[i]]):\n print("No")\n exit()\nprint("Yes")\n\n ', 'S=input()\nT=input()\nconvert = {}\nflag=1\nfor s,t in zip(S,T):\n if s in convert and convert[s]!=t:\n flag=0\n break\n convert[s] = t\nafter = convert.values()\nif len(after)!= len(set(after)):\n flag = 0\n\nprint("Yes" if flag else "No")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s092768492', 's261302387', 's032610820'] | [50480.0, 6704.0, 3632.0] | [692.0, 25.0, 75.0] | [375, 351, 236] |
p03252 | u480200603 | 2,000 | 1,048,576 | 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. | ['s = list(input())\nt = list(input())\ns = list(set(s))\nt = list(set(t))\nif len(s) == len(t):\n for i in range(len(s)):\n if s[i] == t[i]:\n print("No")\n exit()\n else:\n print("Yes")\nelse:\n print("No")\n', 's = list(input())\nt = list(input())\nx = list(set(s))\ny = list(set(t))\na = []\nb = []\n\nfor i in range(len(set(s))):\n a.append(s.count(x[i]))\n \nfor j in range(len(set(t))):\n b.append(t.count(y[j]))\n \na.sort()\nb.sort()\n\nif a == b:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s109008905', 's837343232'] | [6704.0, 6704.0] | [30.0, 134.0] | [248, 278] |
p03252 | u485716382 | 2,000 | 1,048,576 | 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. | ["def solve(S, T):\n StoT = {}\n TtoS = {}\n for s, t in zip(S, T):\n print('----------------')\n print(s, t)\n if s not in StoT:\n StoT[s] = t\n if t not in TtoS:\n TtoS[t] = s\n \n if StoT[s] != t or TtoS[t] != s:\n return False\n print(StoT)\n print(TtoS)\n\n return True\n \n\n\nS = list(input())\nT = list(input())\n\nbool = solve(S, T)\nif bool:\n print('Yes')\nelse:\n print('No')\n", "def solve(S, T):\n StoT = {}\n TtoS = {}\n for s, t in zip(S, T):\n if s not in StoT:\n StoT[s] = t\n if t not in TtoS:\n TtoS[t] = s\n \n if StoT[s] != t or TtoS[t] != s:\n return False\n\n return True\n \n\n\nS = list(input())\nT = list(input())\n\nbool = solve(S, T)\nif bool:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s621670542', 's999775289'] | [49960.0, 6704.0] | [1217.0, 62.0] | [473, 378] |
p03252 | u492447501 | 2,000 | 1,048,576 | 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. | ['import sys\n\nS = input()\nT = input()\n\nd = {}\n\nfor i in range(len(S)):\n if T[i] in d and d[T[i]]!=S[i]:\n print("NO")\n sys.exit()\n d[T[i]] = S[i]\nprint("YES")', 'import sys\n\nS = input()\nT = input()\n\nd_T = {}\nd_S = {}\n\nfor i in range(len(S)):\n if T[i] in d_T and d_T[T[i]]!=S[i]:\n print("No")\n sys.exit()\n d_T[T[i]] = S[i]\n\nfor i in range(len(T)):\n if S[i] in d_S and d_S[S[i]]!=T[i]:\n print("No")\n sys.exit()\n d_S[S[i]] = T[i]\n\n\nprint("Yes")'] | ['Wrong Answer', 'Accepted'] | ['s620409478', 's339231981'] | [3632.0, 3632.0] | [105.0, 194.0] | [175, 319] |
p03252 | u501750652 | 2,000 | 1,048,576 | 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. | ["from collections import Counter\n\nS = list(input())\nT = list(input())\n\ncs = sorted(Counter(S).values())\nct = sorted(Counter(T).values())\n\nprint(cs)\nprint(ct)\n\nif cs == ct:\n print('Yes')\nelse:\n print('No')", 'import numpy as np\nS = str(input())\nT = str(input())\n\nS_and_T = list(set(S) & set(T))\n#S_T = list(set(S)-set(S_and_T))\n#T_S = list(set(T)-set(S_and_T))\nif len(S) != len(T):\n print("NO")\n\nelif len(S_and_T) == 0:\n print("YES")\n exit()\n\nelif len(set(S)) != len(set(T)):\n print("NO")\n\nelse:\n print("YES")\n', "from collections import Counter\n\nS = list(input())\nT = list(input())\n\ncs = sorted(Counter(S).values())\nct = sorted(Counter(T).values())\n\nif cs == ct:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s084350987', 's890902953', 's882757571'] | [6960.0, 20392.0, 6960.0] | [49.0, 288.0, 48.0] | [209, 316, 188] |
p03252 | u506689504 | 2,000 | 1,048,576 | 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. | ['S=input()\nT=input()\n\nRs = {}\nRt = {}\nfor i in range(len(S)):\n if S[i] in Rs.keys:\n if Rs[S[i]] != T[i]:\n print("No")\n exit()\n else:\n Rs[S[i]] = T[i]\n\n if T[i] in Rt.keys:\n if Rt[T[i]] != S[i]:\n print("No")\n exit()\n else:\n Rt[T[i]] = S[i]\nprint("Yes")\n', 'S=input()\nT=input()\n\nRs = {}\nRt = {}\nfor i in range(len(S)):\n if S[i] in Rs.keys():\n if Rs[S[i]] != T[i]:\n print("No")\n exit()\n else:\n Rs[S[i]] = T[i]\n\n if T[i] in Rt.keys():\n if Rt[T[i]] != S[i]:\n print("No")\n exit()\n else:\n Rt[T[i]] = S[i]\nprint("Yes")\n'] | ['Runtime Error', 'Accepted'] | ['s343219452', 's443125990'] | [3632.0, 3632.0] | [18.0, 149.0] | [337, 341] |
p03252 | u509368316 | 2,000 | 1,048,576 | 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. | ["S=input()\nT=input()\nd=[[] for i in range(26)]\nfor i,c in enumerate(S):\n d[ord(c)-ord('a')].append(i)\nd2=[[] for i in range(26)]\nfor i,c in enumerate(T):\n d2[ord(c)-ord('a')].append(i)\nd.sort(key=lambda x:x[0])\nd2.sort(key=lambda x:x[0])\nf=1\nfor i in range(26):\n if len(d[i])!=len(d2[i]):\n f=0\n else:\n for j in range(len(d[i])):\n if d[i]!=d2[i]:\n f=0\nprint(['No','Yes'][f])", "S=input()\nT=input()\nd=[[] for i in range(26)]\nfor i,c in enumerate(S):\n d[ord(c)-ord('a')].append(i)\nd2=[[]for i in range(26)]\nfor i,c in enumerate(T):\n d2[ord(c)-ord('a')].append(i)\nprint(['No','Yes'][set((tuple(x) for x in d))==set((tuple(x) for x in d2))])"] | ['Runtime Error', 'Accepted'] | ['s737860732', 's650868292'] | [26688.0, 29680.0] | [159.0, 182.0] | [424, 265] |
p03252 | u511379665 | 2,000 | 1,048,576 | 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. | ['S=input()\nT=input()\nL=len(S)\n\ndds=defaultdict(int)\nddt=defaultdict(int)\n\nfor i in range(L):\n s=S[i]\n t=T[i]\n if dds[s]==0:\n dds[s]=t\n else:\n if dds[s]!=t:\n print("No")\n exit()\n if ddt[t]==0:\n ddt[t]=s\n else:\n if ddt[t]!=s:\n print("No")\n exit()\nprint("Yes")', 'from collections import defaultdict\n\nS=input()\nT=input()\nL=len(S)\n\ndds=defaultdict(int)\nddt=defaultdict(int)\n\nfor i in range(L):\n s=S[i]\n t=T[i]\n if dds[s]==0:\n dds[s]=t\n else:\n if dds[s]!=t:\n print("No")\n exit()\n if ddt[t]==0:\n ddt[t]=s\n else:\n if ddt[t]!=s:\n print("No")\n exit()\nprint("Yes")'] | ['Runtime Error', 'Accepted'] | ['s860856376', 's431228661'] | [3632.0, 4144.0] | [18.0, 135.0] | [346, 383] |
p03252 | u513081876 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\nfor i in range(len(S)):\n kensa1 = [index for index, word in enumerate(S) if S[i] == word]\n kensa2 = [index for index, word in enumerate(S) if T[i] == word]\n if kensa1 != kensa2:\n print('No')\n break\nelse:\n print('Yes')", "S = input()\nT = input()\ncnt = []\nans = 1\nfis1 = [index for index, word in enumerate(S) if S[i] == S[0]]\nfis2 = [index for index, word in enumerate(T) if T[i] == T[0]]\n\nif fis1 != fis2:\n ans = 0\nelse:\n for i in range(len(S)):\n if i not in fis1:\n kensa1 = [index for index, word in enumerate(S) if S[i] == word]\n kensa2 = [index for index, word in enumerate(T) if T[i] == word]\n if kensa1 != kensa2:\n ans = 0\n break\n else:\n fis1.append(kensa1)\n \nprint('Yes' if ans == 1 else 'No')", "import sys\nfrom collections import defaultdict\n\nS = input()\nT = input()\nL = len(S)\n\ndcts = defaultdict(int)\ndctt = defaultdict(int)\nfor i in range(L):\n s = S[i]\n t = T[i]\n if dcts[s] == 0:\n dcts[s] = t\n else:\n if dcts[s] != t:\n print('No')\n sys.exit()\n if dctt[t] == 0:\n dctt[t] = s\n else:\n if dctt[t] != s:\n print('No')\n sys.exit()\nprint('Yes')"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s873515717', 's890705153', 's537079097'] | [15540.0, 3632.0, 3888.0] | [113.0, 18.0, 121.0] | [267, 583, 435] |
p03252 | u517447467 | 2,000 | 1,048,576 | 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. | ['A = input()\nB = input()\n\nflag = True\nif len(A) != len(B):\n flag = False \n\npair_dict = dict()\nreverse_dict = dict()\nfor i in range(len(A)):\n if A[i] not in pair_dict:\n pair_dict[A[i]] = B[i]\n elif pair_dict[A[i]] != B[i]:\n flag = False\n break\n if B[i] not in reverse_dict:\n reverse_dict[B[i]] = A[i]\n elif reverse_dict[B[i]] != A[i]:\n flag = False\n break\nif flag:\n print("YES")\nelse:\n print("NO")\n', 'A = input()\nB = input()\n\nflag = True\nif len(A) != len(B):\n flag = False \n\npair_dict = dict()\nreverse_dict = dict()\nfor i in range(len(A)):\n if A[i] not in pair_dict:\n pair_dict[A[i]] = B[i]\n elif pair_dict[A[i]] != B[i]:\n flag = False\n break\n if B[i] not in reverse_dict:\n reverse_dict[B[i]] = A[i]\n elif reverse_dict[B[i]] != A[i]:\n flag = False\n break\nif flag:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s760878746', 's011689526'] | [3632.0, 3632.0] | [126.0, 127.0] | [421, 421] |
p03252 | u518042385 | 2,000 | 1,048,576 | 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. | ['d={}\nw1=input()\nw2=input()\nnum=len(w1)\nb=True\nfor i in list("qwertyuiopasdfghjklzxcvbnm"):\n d[i]=""\nfor i in range(num):\n if d[w1[i]]=="":\n d[w1[i]]=w2[i]\n elif d[w1[i]]==w2[i]:\n pass\n elif d[w1[i]]!=w2[i]:\n b=False\n break\nif b:\n print("No")\nelse:\n l=[]\n for i in d:\n if d[i] in l:\n b=False\n break\n else:\n if d[i]!="":\n l.append(d[i])\n if b:\n print("Yes")\n else:\n print("No")\n \n', 'd={}\nw1=input()\nw2=input()\nnum=len(w1)\nb=True\nfor i in list("qwertyuiopasdfghjklzxcvbnm"):\n d[i]=""\nfor i in range(num):\n if d[w1[i]]=="":\n d[w1[i]]=w2[i]\n elif d[w1[i]]==w2[i]:\n pass\n elif d[w1[i]]!=w2[i]:\n b=False\n break\nif not b:\n print("No")\nelse:\n l=[]\n for i in d:\n if d[i] in l:\n b=False\n break\n else:\n if d[i]!="":\n l.append(d[i])\n if b:\n print("Yes")\n else:\n print("No")\n \n\n'] | ['Wrong Answer', 'Accepted'] | ['s688432107', 's805002529'] | [3632.0, 3632.0] | [82.0, 81.0] | [436, 441] |
p03252 | u519452411 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\nfor i in range(len(s)):\n if s[i] == t[i]:\n else:\n s = s.translate(str.maketrans(s[i]+t[i],t[i]+s[i]))\n\nif s == t:\n print("Yes")\nelse:\n print("No")', 's = input()\nt = input()\nused_str = []\nfor i in range(len(s)):\n if s[i] != t[i] and not s[i] in used_str and not t[i] in used_str:\n s = s.translate(str.maketrans(s[i]+t[i],t[i]+s[i]))\n used_str.append(s[i])\n used_str.append(t[i])\n\nif s == t:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s789169183', 's598207359'] | [2940.0, 4400.0] | [17.0, 266.0] | [177, 285] |
p03252 | u527261492 | 2,000 | 1,048,576 | 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. | ["import sys\ns=input()\nt=input()\ndef hanten(*S,c1,c2):\n for i range(len(S)):\n if S[i]==c1:\n S[i]=c2\n if S[i]==c2:\n S[i]=c1\nfor j,k in s:\n if hanten(s,j,k)==t:\n print('Yes')\n sys.exit()\nprint('No')", "import collections\ns=input()\nt=input()\ncnt1=1\ncnt2=1\nlst1=[]\nlst2=[]\nfor i in range(len(s)-1):\n if s[i]==s[i+1]:\n cnt1+=1\n else:\n lst1.append(cnt1)\nfor j in range(len(t)-1):\n if t[j]==t[j+1]:\n cnt2+=1\n else:\n lst2.append(cnt2)\nS=collections.Counter(s)\nT=collections.Counter(t)\nS_=list(S.values())\nT_=list(T.values())\nS_.sort()\nT_.sort()\nif S_==T_ and lst1==lst2:\n print('Yes')\nelse:\n print('No')\n\n "] | ['Runtime Error', 'Accepted'] | ['s810271071', 's565312050'] | [2940.0, 9112.0] | [17.0, 154.0] | [218, 419] |
p03252 | u543173665 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\ncount = 0\nfor i in range(26):\n start[i] = -1\n goal[i] = -1\nfor i in range(0,len(s)):\n a = s[i]\n b = t[i]\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\ncount = 0\nfor i in range(26):\n start[i] = -1\n goal[i] = -1\nfor i in range(0,len(s)):\n a = s[i]-\'a\'\n b = t[i]-\'a\'\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\nstart = [-1]*30\ngoal = [-1]*30\nfor i in range(0,len(s)):\n a = ord(s[i])-ord("a")\n b = ord(t[i])-ord("a")\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\nstart = [-1]*26\ngoal = [-1]*26\nfor i in range(0,len(s)):\n a = ord(s[i])-ord("a")\n b = ord(t[i])-ord("a")\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\ncount = 0\nfor i in range(26):\n start[i] = -1\n goal[i] = -1\nfor i in range(0,len(s)):\n a = oad(s[i])-oad("a")\n b = oad(t[i])-oad("a")\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\ncount = 0\nfor i in range(oad(\'a\'),oad(\'z\')+1):\n start[i] = -1\n goal[i] = -1\nfor i in range(0,len(s)):\n a = s[i]\n b = t[i]\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = list(str(input()))\nt = list(str(input()))\ncount = 0\nfor i in range(26):\n start[i] = -1\n goal[i] = -1\nfor i in range(0,len(s)):\n a = s[i]-\'a\'\n b = t[i]-\'a\'\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelse:\n print("Yes")', 's = input()\nt = input()\nstart = [-1]*30\ngoal = [-1]*30\ncount = 0\nfor i in range(0,len(s)):\n a = ord(s[i])-ord("a")\n b = ord(t[i])-ord("a")\n if start[a] != -1 or goal[b] != -1:\n if start[a] != b or goal[b] != a:\n count = 1\n break\n else:\n start[a] = b\n goal[b] = a\nif count == 1:\n print("No")\nelif count == 0:\n print("Yes")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s267860403', 's416347154', 's566859424', 's688274345', 's789214508', 's801437892', 's887656122', 's039860275'] | [3632.0, 3632.0, 3632.0, 3632.0, 3632.0, 3632.0, 6704.0, 3632.0] | [18.0, 18.0, 156.0, 154.0, 18.0, 18.0, 25.0, 157.0] | [367, 375, 361, 361, 395, 384, 397, 382] |
p03252 | u543411290 | 2,000 | 1,048,576 | 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. | ["a=input()\nb=input()\nc={}\nstate=True\nfor i in range(len(a)):\n if b[i] not in c:\n c[b[i]]=a[i]\n if b[i] in c:\n if c[b[i]]!=a[i]:\n state=False\n else:\n state=False\nif state:\n print('Yes')\nelse:\n print('No')", "a=input()\nb=input()\nc={}\nstate=True\nfor i in range(len(a)):\n b[i] not in c:\n c[b[i]]=a[i]\n c[a[i]]=b[i]\n if c[b[i]]!=a[i]:\n state=False\nif state:\n print('Yes')\nelse:\n print('No')\n \n ", "a=input()\nb=input()\nc={}\nstate=True\nfor i in range(len(a)):\n if b[i] not in c and a[i] not in c.values():\n c[b[i]]=a[i]\n if b[i] in c:\n if c[b[i]]!=a[i]:\n state=False\n else:\n state=False\nif state:\n print('Yes')\nelse:\n print('No')\n"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s020431884', 's285207983', 's566690955'] | [2940.0, 2940.0, 3632.0] | [17.0, 17.0, 93.0] | [219, 199, 249] |
p03252 | u547167033 | 2,000 | 1,048,576 | 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. | ["from collections import Counter\ns=input()\nt=input()\nc1=Counter(s)\nc2=Counter(t)\nc1.sort()\nc2.sort()\nprint('Yes' if c1==c2 else 'No')", "from collections import Counter\ns=input()\nt=input()\nc1=list(Counter(s).values())\nc2=list(Counter(t).values())\nc1.sort()\nc2.sort()\nprint('Yes' if c1==c2 else 'No')\n"] | ['Runtime Error', 'Accepted'] | ['s641947167', 's837358574'] | [4016.0, 4144.0] | [42.0, 41.0] | [132, 163] |
p03252 | u556672233 | 2,000 | 1,048,576 | 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. | ["s_to_t = {}\nt_to_s = {}\n\nfor i in range(len(s)):\n if s[i] not in s_to_t:\n if t[i] not in t_to_s:\n s_to_t[s[i]] = t[i]\n t_to_s[t[i]] = s[i]\n continue\n else:\n print('No')\n exit(0)\n elif s_to_t[s[i]] == t[i] and t_to_s[t[i]] == s[i]:\n continue\n else:\n print('No')\n exit(0)\n \nprint('Yes') \n", "s = input()\nt = input()\n\n\ns_to_t = {}\nt_to_s = {}\n\nfor i in range(len(s)):\n if s[i] not in s_to_t:\n if t[i] not in t_to_s:\n s_to_t[s[i]] = t[i]\n t_to_s[t[i]] = s[i]\n continue\n else:\n print('No')\n exit(0)\n elif s_to_t[s[i]] == t[i] and t_to_s[t[i]] == s[i]:\n continue\n else:\n print('No')\n exit(0)\n \nprint('Yes') \n \n"] | ['Runtime Error', 'Accepted'] | ['s743543755', 's885537317'] | [3064.0, 3632.0] | [18.0, 100.0] | [403, 434] |
p03252 | u558720836 | 2,000 | 1,048,576 | 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. | ['s_str = [ord(i) for i in input()]\nt_str = [ord(i) for i in input()]\n\ns = sorted(s_str)\nt = sorted(t_str)\n\ncnt_s = 1\ncnt_t = 1\ns_num = []\nt_num = []\n\nfor i in range(len(s)-1):\n if s[i] == s[i+1]:\n cnt_s += 1\n if i == len(s)-2:\n s_num.append(cnt_s)\n else:\n s_num.append(cnt_s)\n cnt_s = 1\n if t[i] == t[i+1]:\n cnt_t += 1\n if i == len(s)-2:\n t_num.append(cnt_t)\n else:\n t_num.append(cnt_t)\n cnt_t = 1\n\ns_num = sorted(s_num)\nt_num = sorted(t_num)\nprint(s_num)\nprint(t_num)\n\nif s_num == t_num:\n print("Yes")\nelse:\n print("No")\n\n', 's_str = [ord(i) for i in input()]\nt_str = [ord(i) for i in input()]\n\ns = sorted(s_str)\nt = sorted(t_str)\n\ncnt_s = 1\ncnt_t = 1\ns_num = []\nt_num = []\n\nfor i in range(len(s)-1):\n if s[i] == s[i+1]:\n cnt_s += 1\n if i == len(s)-2:\n s_num.append(cnt_s)\n else:\n s_num.append(cnt_s)\n cnt_s = 1\n if t[i] == t[i+1]:\n cnt_t += 1\n if i == len(s)-2:\n t_num.append(cnt_t)\n else:\n t_num.append(cnt_t)\n cnt_t = 1\n\ns_num = sorted(s_num)\nt_num = sorted(t_num)\n\nif s_num == t_num:\n print("Yes")\nelse:\n print("No")\n\n'] | ['Wrong Answer', 'Accepted'] | ['s408705780', 's543347824'] | [10572.0, 10508.0] | [246.0, 248.0] | [618, 592] |
p03252 | u562015767 | 2,000 | 1,048,576 | 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. | ['import sys\nimport collections\n\ns = list(map(str,input()))\nt = list(map(str,input()))\ncnts = collections.Counter(s)\ncntt = collections.Counter(t)\ncs = sorted(cnts.values())\nct = sorted(cntt.values())\n\nprint(cs)\nprint(ct)\n\nif len(s) != len(t):\n print("No")\n sys.exit()\n\nfor i,j in zip(cs,ct):\n if i != j:\n print("No")\n sys.exit()\n\nprint("Yes")', 'import sys\nimport collections\n\ns = list(map(str,input()))\nt = list(map(str,input()))\ncnts = collections.Counter(s)\ncntt = collections.Counter(t)\ncs = sorted(cnts.values())\nct = sorted(cntt.values())\n\nprint(cnts)\nprint(cntt)\n\nif len(s) != len(t):\n print("No")\n sys.exit()\n\nfor i,j in zip(cnts.values(),cntt.values()):\n if i != j:\n print("No")\n sys.exit()\n\nprint("Yes")', 'import sys\nimport collections\n\ns = list(map(str,input()))\nt = list(map(str,input()))\ncnts = collections.Counter(s)\ncntt = collections.Counter(t)\ncs = sorted(cnts.values())\nct = sorted(cntt.values())\n\nif len(s) != len(t):\n print("No")\n sys.exit()\n\nfor i,j in zip(cs,ct):\n if i != j:\n print("No")\n sys.exit()\n\nprint("Yes")'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s280573840', 's694861061', 's042193543'] | [7056.0, 6972.0, 7056.0] | [75.0, 76.0, 75.0] | [364, 390, 343] |
p03252 | u575431498 | 2,000 | 1,048,576 | 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. | ["S = input()\nT = input()\n\ndic = {}\ndic_rev = {}\n\n\ndef solve():\n for s, t in zip(S, T):\n if t in dic.keys():\n if s != dic[t]:\n print('No')\n return\n else:\n dic[t] = s\n for s, t in zip(S, T):\n if t in dic_rev.keys():\n if t != dic_rev[s]:\n print('No')\n return\n else:\n dic_rev[s] = t\n print('Yes')\n return\n\n\nsolve()\n", "S = input()\nT = input()\n\ndic = {}\ndic_rev = {}\n\n\ndef solve():\n for s, t in zip(S, T):\n if t in dic.keys():\n if s != dic[t]:\n print('No')\n return\n else:\n dic[t] = s\n for s, t in zip(S, T):\n if s in dic_rev.keys():\n if t != dic_rev[s]:\n print('No')\n return\n else:\n dic_rev[s] = t\n print('Yes')\n return\n\n\nsolve()"] | ['Runtime Error', 'Accepted'] | ['s641749726', 's622769742'] | [3632.0, 3632.0] | [80.0, 88.0] | [454, 453] |
p03252 | u580327099 | 2,000 | 1,048,576 | 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. | ['#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\n\ninput = sys.stdin.readline\n\ndef main():\n T2 = T[:]\n for i in range(len(S)):\n if S[i] == T2[i]:\n continue\n from_c = T2[i]\n to_c = S[i]\n T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))\n\n if S != T2:\n print("No")\n else:\n print("Yes")\n\nmain()\n', '#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\n\ninput = sys.stdin.readline\n\ndef main():\n S = input().strip()\n T = input().strip()\n m = {}\n for i in range(len(T)):\n if T[i] in m:\n if m[T[i]] != S[i]:\n print("No")\n return\n m[T[i]] = S[i]\n\n T2 = T[:]\n for i in range(len(S)):\n if S[i] == T2[i]:\n continue\n from_c = T2[i]\n to_c = S[i]\n T2 = T2.translate(str.maketrans({from_c: to_c, to_c: from_c}))\n\n if S != T2:\n print("No")\n else:\n print("Yes")\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s510226433', 's360736657'] | [3056.0, 4640.0] | [18.0, 191.0] | [379, 595] |
p03252 | u581403769 | 2,000 | 1,048,576 | 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. | ["s = list(input())\nt = list(input())\nn = len(s)\n\ns_par = [i for i in range(n + 1)]\nt_par = [i for i in range(n + 1)]\n\ndef operation(x, par):\n for i in range(n):\n for j in range(i):\n if x[i] == x[j]:\n par[i] = par[j]\n return par\n\nif operation(s, s_par) == operation(t, t_par):\n print('yes')\nelse:\n print('No')", "s = list(input())\nt = list(input())\nn = len(s)\n\ns_par = [i for i in range(n + 1)]\nt_par = [i for i in range(n + 1)]\n\ndef operation(x, par):\n for i in range(n):\n for j in range(i):\n if x[i] == x[j]:\n par[i] = par[j]\n break\n return par\n\nif operation(s, s_par) == operation(t, t_par):\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s345420690', 's251257639'] | [28004.0, 28052.0] | [70.0, 537.0] | [364, 374] |
p03252 | u597374218 | 2,000 | 1,048,576 | 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. | ['s=sorted(map(list(input()).count,set(s)))\nt=sorted(map(list(input()).count,set(t)))\nprint("Yes" if s==t else "No")', 'from collections import Counter\ns=Counter(input())\nt=Counter(input())\nS=sorted(s.values())\nT=sorted(t.values())\nprint("Yes" if S==T else "No")'] | ['Runtime Error', 'Accepted'] | ['s670434060', 's436315715'] | [4784.0, 3828.0] | [20.0, 41.0] | [114, 142] |
p03252 | u597455618 | 2,000 | 1,048,576 | 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. | ['import sys\nfrom collections import Counter\n\n\ndef main():\n s = input()\n t = input()\n s_count = [0]*26\n t_count = [0]*26\n for i in range(ord("a"), ord("z")+1):\n s_count[i-97] = s.count(chr(i))\n t_count[i-97] = t.count(chr(i))\n print(s_count[i-97], t_count[i-97])\n s_count.sort()\n t_count.sort()\n if s_count == t_count:\n print("Yes")\n else:\n print("No")\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nfrom collections import Counter\n\n\ndef main():\n s = input()\n t = input()\n s_count = [0]*26\n t_count = [0]*26\n for i in range(ord("a"), ord("z")+1):\n s_count[i-97] = s.count(chr(i))\n t_count[i-97] = t.count(chr(i))\n s_count.sort()\n t_count.sort()\n if s_count == t_count:\n print("Yes")\n else:\n print("No")\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s944848426', 's574612503'] | [9528.0, 9660.0] | [38.0, 36.0] | [453, 409] |
p03252 | u598229387 | 2,000 | 1,048,576 | 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. | ["s=input()\nt=input()\nn=len(s)\n\ndic={}\nans='Yes'\nfor i in range(n):\n if s[i] in dic:\n if dic[t[i]]==t[i]:\n continue\n else:\n ans='No'\n break\n \n if t[i] not in dic:\n dic[t[i]]=s[i]\n else:\n if dic[t[i]]==s[i]:\n continue\n else dic[t[i]] !=s[i]:\n ans='No'\n break\n\nprint(ans)", "s=input()\nt=input()\n\ndic={}\n\nans=True\nfor i in range(len(s)):\n if s[i]==t[i]:\n continue\n else:\n if s[i] not in dic:\n dic[s[i]]=t[i]\n else:\n if dic[s[i]]!=t[i]:\n ans=False\n break\nprint(ans)\nse=set()\nfor key,value in dic.items():\n se.add(value)\nif len(se)!=len(dic):\n ans=False\n \nprint('Yes' if ans else 'No')\n", "s=input()\nt=input()\nn=len(s)\n\ndic={}\nans='Yes'\nfor i in range(n):\n if s[i]==t[i] and s[i] in dic:\n ans='No'\n break\n \n if t[i] not in dic:\n dic[t[i]]=s[i]\n else:\n if dic[s[i]]==t[i]:\n continue\n else:\n ans='No'\n break\n\nprint(ans)", "s=input()\nt=input()\nn=len(s)\n\ndic={}\nans='Yes'\nfor i in range(n):\n if t[i] not in dic:\n dic[t[i]]=s[i]\n \n else:\n if dic[t[i]]==s[i]:\n continue\n else :\n ans='No'\n break\n \nif len(dic)!len(set(dic.values())):\n ans='No'\nprint(ans)", "s=input()\nt=input()\nn=len(s)\n\ndic={}\nans='Yes'\nfor i in range(n):\n if s[i] in dic:\n if dic[t[i]]==t[i]:\n continue\n else:\n ans='No'\n break\n \n if t[i] not in dic:\n dic[t[i]]=s[i]\n else:\n if dic[t[i]]==s[i]:\n continue\n else :\n ans='No'\n break\n\nprint(ans)", "\ns=input()\nt=input()\nn=len(s)\ndic={}\nse=set()\nans='Yes'\nfor i in range(n):\n if s[i] not in dic:\n dic[s[i]]=t[i]\n if t[i] in se:\n ans='No'\n se.add(t[i])\n else:\n if dic[s[i]]!=t[i]:\n ans='No'\nprint(ans)\n \n"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s195505403', 's228687810', 's405316811', 's423109228', 's765154547', 's805041830'] | [2940.0, 3632.0, 3632.0, 2940.0, 3632.0, 3632.0] | [17.0, 103.0, 18.0, 17.0, 99.0, 81.0] | [380, 396, 307, 295, 364, 274] |
p03252 | u603958124 | 2,000 | 1,048,576 | 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. | ['from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf\nfrom itertools import accumulate,permutations,combinations,product,combinations_with_replacement\nfrom collections import deque,defaultdict,Counter\nfrom bisect import bisect_left,bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify,heappop,heappush\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\nsys.setrecursionlimit(10 ** 7)\ndef input() : return sys.stdin.readline().strip()\ndef INT() : return int(input())\ndef MAP() : return map(int,input().split())\ndef LIST() : return list(MAP())\n\ns = input()\nt = input()\na = [0]*(ord(\'z\')+1)\nb = [0]*(ord(\'z\')+1)\n\nfor i in range(len(s)):\n x = ord(s[i])\n y = ord(t[i])\n if x != y and a[x] != y:\n if a[x] == 0:\n a[x] = y\n b[x] = 1\n else:\n print("No")\n exit()\nif sum(b) % 2 == 1:\n print("No")\nelse:\n print("Yes")', 'from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf\nfrom itertools import accumulate,permutations,combinations,product,combinations_with_replacement\nfrom collections import deque,defaultdict,Counter\nfrom bisect import bisect_left,bisect_right\nfrom operator import itemgetter\nfrom heapq import heapify,heappop,heappush\nfrom copy import deepcopy\nfrom time import time\nimport string\nimport sys\nsys.setrecursionlimit(10 ** 7)\ndef input() : return sys.stdin.readline().strip()\ndef INT() : return int(input())\ndef MAP() : return map(int,input().split())\ndef LIST() : return list(MAP())\n\ns = input()\nt = input()\na = [0]*26\nb = [0]*26\n\nfor i in range(len(s)):\n x = ord(s[i])-ord(\'a\')\n y = ord(t[i])-ord(\'a\')\n a[x] += 1\n b[y] += 1\n\nif sorted(a) == sorted(b):\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s749612466', 's117297911'] | [10588.0, 10276.0] | [101.0, 149.0] | [980, 864] |
p03252 | u604398799 | 2,000 | 1,048,576 | 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. | ["import sys\n\nS = input()\nT = input()\n\nlen_S = len(S)\nS_Converted = S\nfor i in range (len(S)):\n tmp_S = S_Converted[i]\n tmp_T = T[i]\n if tmp_S == tmp_T:\n continue\n S_Converted = list(S_Converted) \n list_indexT = [j for j, tmp_SC in enumerate(S_Converted) if tmp_SC == tmp_T]\n if (not list_indexT == []) and (list_indexT[0] < i):\n print('No')\n sys.exit()\n S_Converted = ''.join(S_Converted)\n S_Converted = S_Converted.replace(tmp_S, tmp_T)\n S_Converted = list(S_Converted) \n for li in list_indexT:\n if li == i:\n continue\n else:\n S_Converted[li] = tmp_S\n print(''.join(S_Converted))\n \nS_Converted = ''.join(S_Converted)\n\nif S_Converted == T:\n print('Yes')\nelse:\n print('No')\n\n ", "import sys\n\nS = input()\nT = input()\n\nlen_S = len(S)\nS_Converted = S\nfor i in range (len(S)):\n tmp_S = S_Converted[i]\n tmp_T = T[i]\n if tmp_S == tmp_T:\n continue\n S_Converted = list(S_Converted) \n list_indexT = [j for j, tmp_SC in enumerate(S_Converted) if tmp_SC == tmp_T]\n if (not list_indexT == []) and (list_indexT[0] < i):\n print('No')\n sys.exit()\n S_Converted = ''.join(S_Converted)\n S_Converted = S_Converted.replace(tmp_S, tmp_T)\n S_Converted = list(S_Converted) \n for li in list_indexT:\n if li == i:\n continue\n else:\n S_Converted[li] = tmp_S\n #print(''.join(S_Converted))\n \nS_Converted = ''.join(S_Converted)\n\nif S_Converted == T:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s022607659', 's506926512'] | [10496.0, 10112.0] | [349.0, 325.0] | [775, 770] |
p03252 | u606045429 | 2,000 | 1,048,576 | 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. | ['S, T = [input() for _ in range(2)]\nsmemo, tmemo = {}, {}\nfor si, ti in zip(S, T):\n if si in smemo and smemo[si] != ti or ti in tmemo and tmemo[ti] != si:\n print("NO")\n quit()\n smemo[si], tmemo[ti] = ti, si\nprint("YES")\n', 'S, T = [input() for _ in range(2)]\nsmemo, tmemo = {}, {}\nfor si, ti in zip(S, T):\n if si in smemo and smemo[si] != ti or ti in tmemo and tmemo[ti] != si:\n print("No")\n quit()\n smemo[si], tmemo[ti] = ti, si\nprint("Yes")\n'] | ['Wrong Answer', 'Accepted'] | ['s039767854', 's640913693'] | [3632.0, 3632.0] | [121.0, 119.0] | [239, 239] |
p03252 | u620846115 | 2,000 | 1,048,576 | 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. | ['import collections\na = list(input())\nb = list(input())\nA = collections.Counter(a)\nB = collections.Counter(b)\nAsort = sorted(A.values())\nBsort = sorted(B.values())\nif list(Asort.values()) == list(Bsort.values()):\n print("Yes")\nelse:\n print("No")', 'import collections\na = list(str(input()))\nb = list(str(input()))\nA = collections.Counter(a)\nB = collections.Counter(b)\nAsort = sorted(A.values())\nBsort = sorted(B.values())\nif list(Asort.values()) == list(Bsort.values()):\n print("Yes")\nelse:\n print("No")', 'import collections\na = list(map(str,input().split()))\nb = list(map(str,input().split()))\nA = collections.Counter(a)\nB = collections.Counter(b)\nAsort = sorted(A.values())\nBsort = sorted(B.values())\nif Asort.values() == Bsort.values():\n print("Yes")\nelse:\n print("NO")', 'import collections\na = list(str(input()))\nb = list(str(input()))\nA = collections.Counter(a)\nB = collections.Counter(b)\nAsort = sorted(A.values())\nBsort = sorted(B.values())\nif Asort.values() == Bsort.values():\n print("Yes")\nelse:\n print("No")', 'import collections\na = list(input())\nb = list(input())\nA = collections.Counter(a)\nB = collections.Counter(b)\nAsort = sorted(A.values())\nBsort = sorted(B.values())\nif Asort.values() == Bsort.values():\n print("Yes")\nelse:\n print("NO")', 'import collections\na = list(input())\nb = list(input())\nA = collections.Counter(a)\nB = collections.Counter(b)\nAlist = list(A.values())\nBlist = list(B.values())\nAsort = sorted(Alist)\nBsort = sorted(Blist)\nif Asort == Bsort:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s408417034', 's423689385', 's426982397', 's520791976', 's982545799', 's077301689'] | [12556.0, 12580.0, 9992.0, 12404.0, 12520.0, 12428.0] | [55.0, 54.0, 28.0, 56.0, 51.0, 56.0] | [246, 256, 268, 244, 234, 256] |
p03252 | u623814058 | 2,000 | 1,048,576 | 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. | ["S=input()\nT=input()\n\nD={}\n\nans=1\nfor s,t in zip(S,T):\n x=D.get(t, '')\n print(s,t,x)\n if x=='':\n D[t]=s\n else:\n print(s,t,x)\n if x!=s:\n ans=0\n break\n \n\nprint('Yes' if ans else 'No')", "S=input()\nT=input()\n\nD1={}\nD2={}\n\nans=1\nfor s,t in zip(S,T):\n x=D1.get(t, '')\n if x=='':\n D1[t]=s\n else:\n if x!=s:\n ans=0\n break\n \n x=D2.get(s, '')\n if x=='':\n D2[s]=t\n else:\n if x!=t:\n ans=0\n break\n\nprint('Yes' if ans else 'No')"] | ['Wrong Answer', 'Accepted'] | ['s600518344', 's977256108'] | [9456.0, 9380.0] | [285.0, 93.0] | [246, 330] |
p03252 | u628538573 | 2,000 | 1,048,576 | 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. | ['s = input()\nt = input()\na = "abcdefghijklmnopqrstuvwxyz"\n\nflag = 0\ni = 0 \nwhile i < len(s):\n\tif s[i] != t[i]:\n\t\tif t[i] in a:\n\t\t\tc = s[i]\n\t\t\ts = s.replace(c, "1")\n\t\t\ts = s.replace(t[i], c)\n\t\t\ts = s.replace("1", t[i])\n\t\t\ta = a.replace(t[i], "1")\n\t\telse:\n\t\t\tbreak\n\ti += 1\nif s == t:\n\tprint("True")\nelse:\n\tprint("False")', 's = input()\nt = input()\na = "abcdefghijklmnopqrstuvwxyz"\n\nflag = 0\ni = 0 \nwhile i < len(s):\n\tif s[i] != t[i]:\n\t\tif t[i] in a:\n\t\t\tc = s[i]\n\t\t\ts = s.replace(c, "1")\n\t\t\ts = s.replace(t[i], c)\n\t\t\ts = s.replace("1", t[i])\n\t\t\ta = a.replace(t[i], "1")\n\t\telse:\n\t\t\tbreak\n\ti += 1\nif s == t:\n\tprint("Yes")\nelse:\n\tprint("No")'] | ['Wrong Answer', 'Accepted'] | ['s528663679', 's192879188'] | [3632.0, 3632.0] | [77.0, 90.0] | [317, 313] |
p03252 | u629350026 | 2,000 | 1,048,576 | 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. | ['s=str(input())\nt=str(input())\ntemp=["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"]\ns=list(set(s))\nt=list(set(t))\ntemps=[0]*len(temp)\ntempt=[0]*len(temp)\nfor i in range(0,len(temp)):\n temps[i]=s.count(temp[i])\n tempt[i]=t.count(temp[i])\nif temps==tempt:\n print("Yes")\nelse:\n print("No")', 's=str(input())\nt=str(input())\ntemps=list(set(s))\ntempt=list(set(t))\ntemps=sorted(temps)\ntempt=sorted(tempt)\nfor i in range(0,len(temps)):\n temps1[i]=s.count(temps[i])\nfor i in range(0,len(tempt)):\n tempt1[i]=t.count(tempt[i])\nif temps1==tempt1:\n print("Yes")\nelse:\n print("No")', 's=str(input())\nt=str(input())\ns=sorted(list(s))\nt=sorted(list(t))\ntemps=list(set(s))\ntempt=list(set(t))\nfor i in range(0,len(temps)):\n temps[i]=s.count(temps[i])\nfor i in range(0,len(tempt)):\n tempt[i]=t.count(tempt[i])\nif temps==tempt:\n print("Yes")\nelse:\n print("No")', 's=str(input())\nt=str(input())\ns=sorted(list(s))\nt=sorted(list(t))\ntemps=list(set(s))\ntempt=list(set(t))\nfor i in range(0,len(temps)):\n temps[i]=s.count(temps[i])\nfor i in range(0,len(tempt)):\n tempt[i]=s.count(tempt[i])\nif temps==tempt:\n print("Yes")\nelse:\n print("No")', 's=str(input())\nt=str(input())\ntemp=["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"]\ns=list(s)\nt=list(t)\ntemps=[0]*len(temp)\ntempt=[0]*len(temp)\nfor i in range(0,len(temp)):\n temps[i]=s.count(temp[i])\n tempt[i]=t.count(temp[i])\ntemps.sort()\ntempt.sort()\nif temps==tempt:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s193005763', 's299990905', 's585283959', 's982860592', 's508188995'] | [3632.0, 3632.0, 8832.0, 8832.0, 6704.0] | [28.0, 27.0, 201.0, 201.0, 187.0] | [347, 281, 273, 273, 363] |
p03252 | u637824361 | 2,000 | 1,048,576 | 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. | ['ch_S = input()\nch_T = input()\n\nind_S = []\nind_T = []\nfor i in list("abcdefghijklmnopqrstuvwxyz"):\n L = [ch_S.find(i)]\n ind_S.append(L, )\n R = [ch_T.find(i)]\n ind_T.append(R,)\n\nif set(ind_S) == set(ind_T):\n print("Yes")\nelse:\n print("No")\n', 'S = input()\nT = input()\nls = [0]*26\nlt = [0]*26\nal = [chr(ord(\'a\')+i) for i in range(26)]\nfor i in range(S.__len__()):\n si = al.index(S[i])\n ti = al.index(T[i])\n ls[si] += 1\n lt[ti] += 1\nls.sort()\nlt.sort()\nif ls == lt:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Accepted'] | ['s461485349', 's194656661'] | [3632.0, 3632.0] | [18.0, 254.0] | [256, 271] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.