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
u638795007
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 examA():\n A = LI()\n A.sort()\n ans = A[2]*10+A[1]+A[0]\n print(ans)\n return\n\ndef examB():\n N, M, x, y = LI()\n X = LI()\n Y = LI()\n X.sort(); Y.sort()\n if max(X[-1],x)<min(Y[0],y):\n print("No War")\n else:\n print("War")\n return\n\ndef examC():\n S = SI()\n T = SI()\n N = len(S)\n Ds = defaultdict(str)\n Dt = defaultdict(str)\n for i in range(N):\n s = S[i]; t = T[i]\n if Ds[s]!="" and Ds[s]!=t:\n print("No")\n return\n Ds[s] = t\n if Dt[t] != "" and Dt[t] != s:\n print("No")\n return\n Dt[s] = s\n print("Yes")\n return\n\ndef examD():\n ans = 0\n print(ans)\n return\n\nimport sys,bisect,itertools,heapq,math,random\nfrom copy import deepcopy\nfrom heapq import heappop,heappush,heapify\nfrom collections import Counter,defaultdict,deque\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\ndef I(): return int(input())\ndef LI(): return list(map(int,sys.stdin.readline().split()))\ndef LSI(): return list(map(str,sys.stdin.readline().split()))\ndef LS(): return sys.stdin.readline().split()\ndef SI(): return sys.stdin.readline().strip()\nglobal mod,mod2,inf,alphabet,_ep\nmod = 10**9 + 7\nmod2 = 998244353\ninf = 10**18\n_ep = 10**(-12)\nalphabet = [chr(ord(\'a\') + i) for i in range(26)]\n\nsys.setrecursionlimit(10**7)\n\nif __name__ == \'__main__\':\n examC()\n\n', 'def examA():\n A = LI()\n A.sort()\n ans = A[2]*10+A[1]+A[0]\n print(ans)\n return\n\ndef examB():\n N, M, x, y = LI()\n X = LI()\n Y = LI()\n X.sort(); Y.sort()\n if max(X[-1],x)<min(Y[0],y):\n print("No War")\n else:\n print("War")\n return\n\ndef examC():\n S = SI()\n T = SI()\n N = len(S)\n Ds = defaultdict(str)\n Dt = defaultdict(str)\n for i in range(N):\n s = S[i]; t = T[i]\n if Ds[s]!="" and Ds[s]!=t:\n print("No")\n return\n Ds[s] = t\n if Dt[t] != "" and Dt[t] != s:\n print("No")\n return\n Dt[t] = s\n print("Yes")\n return\n\ndef examD():\n ans = 0\n print(ans)\n return\n\nimport sys,bisect,itertools,heapq,math,random\nfrom copy import deepcopy\nfrom heapq import heappop,heappush,heapify\nfrom collections import Counter,defaultdict,deque\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\ndef I(): return int(input())\ndef LI(): return list(map(int,sys.stdin.readline().split()))\ndef LSI(): return list(map(str,sys.stdin.readline().split()))\ndef LS(): return sys.stdin.readline().split()\ndef SI(): return sys.stdin.readline().strip()\nglobal mod,mod2,inf,alphabet,_ep\nmod = 10**9 + 7\nmod2 = 998244353\ninf = 10**18\n_ep = 10**(-12)\nalphabet = [chr(ord(\'a\') + i) for i in range(26)]\n\nsys.setrecursionlimit(10**7)\n\nif __name__ == \'__main__\':\n examC()\n\n']
['Wrong Answer', 'Accepted']
['s400178850', 's761768115']
[5600.0, 5864.0]
[81.0, 97.0]
[1486, 1486]
p03252
u642528832
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'\nfor i in T:\n if i in S:\n continue\n else:\n ans = 'No'\n break\n\nprint(ans)", "S = input()\nT = input()\nans = 'Yes'\ndic1,dic2 = {},{}\n\nfor i,j in zip(S,T):\n if i in dic1:\n if dic1[i] != j:\n ans = 'No'\n else:\n dic1[i] = j\n \n if j in dic2:\n if dic2[j] != i:\n ans = 'No'\n else:\n dic2[j] = i\n\n#print(dic1)\n#print(dic2)\nprint(ans)"]
['Wrong Answer', 'Accepted']
['s570186674', 's493309710']
[9376.0, 9348.0]
[41.0, 83.0]
[134, 314]
p03252
u651879504
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\nS1 = sorted(S)\nT1 = sorted(T)\n\ncount1 = 0\ncount2 = 0\n\nfor j in range(26):\n for i in range(len(S1)):\n if string.ascii_lowercase[j] == S1[i]:\n count1 += 1\n break\n for i in range(len(T1)):\n if string.ascii_lowercase[j] == T1[i]:\n count2 += 1\n break\n\nif count1 == count2:\n print("Yes")\nelse:\n print("N0")', 'import string\n\nS = input()\nT = input()\n\ncount1 = [0] * 26\ncount2 = [0] * 26\n\n\nfor j in range(25):\n count1[j] = S.count(string.ascii_lowercase[j])\n count2[j] = T.count(string.ascii_lowercase[j])\n\nhantei = 1\n\nfor i in range(1,len(S)+1):\n count_tmp1 = 0\n count_tmp2 = 0\n for j in range(25):\n if i == count1[j] :\n count_tmp1 += 1\n elif i == count2[j] :\n count_tmp2 += 1\n if count_tmp1 != count_tmp2:\n hantei = 0\n break\n\nif hantei == 0:\n print("No")\nelse:\n print("Yes")', 'import string\n\nS = input()\nT = input()\n\ncount1 = [0] * 26\ncount2 = [0] * 26\n\n\nfor j in range(26):\n count1[j] = S.count(string.ascii_lowercase[j])\n count2[j] = T.count(string.ascii_lowercase[j])\n\nhantei = 1\n\nfor i in range(0,len(S)+1):\n count_tmp1 = 0\n count_tmp2 = 0\n for j in range(26):\n if i == count1[j] :\n count_tmp1 += 1\n for j in range(26):\n if i == count2[j] :\n count_tmp2 += 1\n if count_tmp1 != count_tmp2:\n hantei = 0\n break\n\nif hantei == 0:\n print("No")\nelse:\n print("Yes")\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s451639663', 's776931785', 's807655553']
[7580.0, 4160.0, 4200.0]
[99.0, 962.0, 1200.0]
[395, 538, 561]
p03252
u652656291
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(input())\nt = sorted(input())\nif s == t:\n print('Yes')\nelse:\n print('No')\n", "s = int(input())\nt = int(input())\n\nfrom collections import Counter\nSC = Counter(s)\nTC = Counter(s)\n\nSCV = SC.values()\nTCV = TC.values()\n\nSCV.sort()\nTCV.sort()\n\nif SCV == TCV:\n print('Yes')\nelse:\n print('No')\n", "s = int(input())\nt = int(input())\n\nfrom collections import Counter\nSC = Counter(s)\nTC = Counter(t)\n\nSCV = SC.values()\nTCV = TC.values()\n\nSCV.sort()\nTCV.sort()\nans = 1\nfor i in range(len(s)):\n if SCV[i] != TCV[i]:\n ans = 0\n\nif ans == 1:\n print('Yes')\nelse:\n print('No')\n \n \n", "S,T = input(),input()\n\nconvert = dict()\n\nbl = True\nfor s,t in zip(S,T):\n if s in convert and convert[s] != t:\n bl = False\n break\n convert[s] = t\n\n\nafter = convert.values()\nif len(after) != len(set(after)):\n bl = False\n\nprint('Yes' if bl else 'No')\n"]
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s642240691', 's700777819', 's978017260', 's942700004']
[7436.0, 3444.0, 3444.0, 3632.0]
[101.0, 19.0, 19.0, 81.0]
[86, 210, 285, 289]
p03252
u655975843
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()\nif s == t:\n\tpritn('Yes')\n\texit()\nif len(s) == 1:\n\tif s != t:\n\t\tprint('No')\n exit(\nfor i in range(len(t)):\n\tfor j in range(len(t)):\n\t\tif t[i] == t[j] and s[i] != s[j]:\n\t\t\tprint('No')\n\t\t\texit()\nprint('Yes')\n", "s = input()\nt = input()\n\nstart = [-1]*26\ngoal = [-1]*26\nfor i in range(len(s)):\n\ta = ord(s[i]) - ord('a')\n\tb = ord(t[i]) - ord('a')\n\tif start[a] != -1 or goal[b] != -1:\n\t\tif start[a] != b or goal[b] != a:\n\t\t\tprint('No')\n\t\t\texit()\n\tstart[a] = b\n\tgoal[b] = a\nprint('Yes')"]
['Runtime Error', 'Accepted']
['s462241923', 's583722224']
[2940.0, 3632.0]
[18.0, 187.0]
[236, 269]
p03252
u656995812
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_list = []\nt_list = []\n\nfor i in range(26):\n s_list.append(s.count(chr(97+i)))\n t_list.append(t.count(chr(97+i)))\n\ns_list.sort()\nt_list.sort()\ntrue = 0\nfor i in range(26):\n if s_list[i] != t_list[i]:\n print('no')\n break\n else:\n true += 1\nif true == 26:\n print('yes')\n", "s = input()\nt = input()\ns_list = []\nt_list = []\n\nfor i in range(26):\n s_list.append(s.count(chr(97+i)))\n t_list.append(t.count(chr(97+i)))\n\ns_list.sort()\nt_list.sort()\ntrue = 0\nfor i in range(26):\n if s_list[i] != t_list[i]:\n print('No')\n break\n else:\n true += 1\nif true == 26:\n print('Yes')\n"]
['Wrong Answer', 'Accepted']
['s469177018', 's367888538']
[3632.0, 3632.0]
[28.0, 28.0]
[328, 328]
p03252
u666476759
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\nchanges = {}\nfor i in range(len(T)):\n print(changes)\n if S[i] != T[i]:\n if S[i] in changes:\n if changes[S[i]] != T[i]:\n print('No')\n sys.exit(0)\n if T[i] in changes:\n if changes[T[i]] != S[i]:\n print('No')\n sys.exit(0)\n\n changes[S[i]] = T[i]\n changes[T[i]] = S[i]\n\nprint('Yes')", "import sys\n\nS = input()\nT = input()\n\nchanges = {}\nchanges_reverse = {}\nfor i in range(len(T)):\n #print(changes)\n if S[i] != T[i]:\n if S[i] in changes:\n if changes[S[i]] != T[i]:\n print('No')\n sys.exit(0)\n if T[i] in changes_reverse:\n if changes_reverse[T[i]] != S[i]:\n print('No')\n sys.exit(0)\n\n changes[S[i]] = T[i]\n changes_reverse[T[i]] = S[i]\n else:\n changes[S[i]] = T[i]\n changes_reverse[T[i]] = S[i]\n \n\nprint('Yes')\n# print(changes)\n"]
['Wrong Answer', 'Accepted']
['s720025510', 's997209436']
[11568.0, 3632.0]
[535.0, 204.0]
[430, 579]
p03252
u669696235
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\nc1=[[] for i in abc]\nc2=[[] for i in abc]\nfor i in range(0,len(S)):\n c1[ord(S[i])-ord("a")].append(i)\n\nfor i in range(0,len(T)):\n c2[ord(T[i])-ord("a")].append(i)\n\nans="Yes"\nfor i in c1:\n if(i not in c2):\n ans="No"\n break\n \nprint(ans)', 'abc=list("abcdefghijklmnopqrstuvwxyz")\nS=input()\nT=input()\n\nc1=[[] for i in abc]\nc2=[[] for i in abc]\nfor i in range(0,len(S)):\n c1[ord(S[i])-ord("a")].append(i)\n\nfor i in range(0,len(T)):\n c2[ord(T[i])-ord("a")].append(i)\n\nans="Yes"\nfor i in c1:\n if(i not in c2):\n ans="No"\n break\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s098089872', 's698377463']
[3632.0, 20528.0]
[19.0, 166.0]
[281, 320]
p03252
u686036872
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()\nSS = {}\nTT = {}\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if s not in SS:\n SS[s] = t\n elif SS[s] != t:\n print("No")\n break\n if if t not in TT:\n TT[t] = s\n elif TT[t] != s:\n print("No")\n break\nelse:\n print("Yes")', 'S= input()\nT= input()\nSS = {}\nTT = {}\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if s not in SS:\n SS[s] = t\n elif SS[s] != t:\n print("No")\n break\n if t not in TT:\n TT[t] = s\n elif TT[t] != s:\n print("No")\n break\nelse:\n print("Yes")']
['Runtime Error', 'Accepted']
['s695812627', 's709170481']
[2940.0, 3632.0]
[17.0, 115.0]
[299, 296]
p03252
u698064859
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 itertools\nimport math\n\n\nS = input()\nT = input()\n\npairs = itertools.combinations(set(S + T), 2)\ndepth_max = math.floor(len(set(S + T)) / 2)\n\nfor depth in range(1, depth_max + 1):\n mid_S = S\n for i in range(depth):\n new_S = mid_S\n for c1, c2 in pairs:\n new_S = new_S.replace(c1, c2.upper())\n new_S = new_S.replace(c2, c1.upper())\n new_S = new_S.lower()\n if new_S == T:\n print('Yes')\n exit()\n\nprint('No')\n", "import collections\n\nS = input()\nT = input()\n\nS_count = [v for v in collections.Counter(S).values()]\nS_count.sort()\nT_count = [v for v in collections.Counter(T).values()]\nT_count.sort()\n\nif S_count == T_count:\n print('Yes')\nelse:\n print('No')\n"]
['Wrong Answer', 'Accepted']
['s250471041', 's617838176']
[4016.0, 4144.0]
[146.0, 41.0]
[503, 248]
p03252
u698176039
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())\n\ndic = {}\nsets = set()\nflag = True\nfor s,t in S,T:\n if s in sets:\n if dic[s] != t:\n flag = False\n break\n else:\n sets.add(s)\n dic[s] = t\n \nif flag:\n print('Yes')\nelse:\n print('No')", "#from collections import Counter\n\nS = list(input())\nT = list(input())\n\ndics = {}\ndicst= {}\nsets = set()\nsett = set()\nflag = True\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if s in sets and t in sett:\n if dics[s] != t or dicst[t] != s:\n flag = False\n break\n elif s in sets and not(t in sett):\n flag = False\n break\n elif t in sett and not(s in sets):\n flag = False\n break\n else:\n sets.add(s)\n sett.add(t)\n dics[s] = t\n dicst[t] = s\n \nprint('Yes') if flag else print('No')"]
['Runtime Error', 'Accepted']
['s586213056', 's927053963']
[6704.0, 6704.0]
[25.0, 115.0]
[241, 577]
p03252
u713830790
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.
["if __name__ == '__main__':\n S = list(input())\n T = list(input())\n\n letter = []\n for i in range(len(S)):\n letter.append(T[i]) if S[i] == T[i]:\n continue\n else:\n if S[i] in letter:\n break\n else:\n s = S[i]\n for j in range(len(S)):\n if S[j] == s:\n S[j] = T[i]\n elif S[j] == T[i]:\n S[j] = s\n\n if S == T:\n print('Yes')\n else:\n print('No')", "if __name__ == '__main__':\n S = list(input())\n T = list(input())\n\n letter = []\n for i in range(len(S)):\n letter.append(T[i]) if S[i] == T[i]:\n continue\n else:\n if S[i] in letter:\n break\n else:\n s = S[i]\n for j in range(len(S)):\n if S[j] == s:\n S[j] = T[i]\n elif S[j] == T[i]:\n S[j] = s\n\n if S == T:\n print('Yes')\n else:\n print('No')", "if __name__ == '__main__':\n S = list(input())\n T = list(input())\n\n start = [-1 for i in range(26)]\n stop = [-1 for i in range(26)]\n\n fail = False\n for 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 stop[b] != -1:\n if start[a] != b or stop[b] != a:\n print('No')\n fail = True\n break\n else:\n start[a] = b\n stop[b] = a\n\n if not fail:\n print('Yes')"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s648775487', 's684216533', 's356386935']
[2940.0, 2940.0, 6704.0]
[17.0, 17.0, 158.0]
[688, 688, 525]
p03252
u729133443
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*;C=Counter;print('YNeos'[eval('!=C(C(input()).values())'*2[2:])::2])", "s,t=[sorted(t.count(i)for i in set(t))for t in open(0)]\nprint('YNeos'[s!=t::2])"]
['Runtime Error', 'Accepted']
['s213557901', 's375797952']
[3316.0, 3620.0]
[20.0, 34.0]
[92, 79]
p03252
u731368968
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\n# for c in range(ord('a'), ord('z') + 1):\n# snum.append([i for i, x in enumerate(s) if x == chr(c)])\n# for c in range(ord('a'), ord('z') + 1):\n# tnum.append([i for i, x in enumerate(t) if x == chr(c)])\n# snum.sort()\n# tnum.sort()\n\n\n\nsn=[0 for i in range(26)]\ntn=[0 for i in range(26)]\nfor i in range(len(s)):\n sn[ord(s[i])]+=1\n tn[ord(t[i])]+=1\nprint('Yes' if sorted(sn) == sorted(tn) else 'No')\n\n", "s = input()\nt = input()\nsn=[0 for i in range(26)]\ntn=[0 for i in range(26)]\nfor i in range(len(s)):\n sn[ord(s[i])-ord('a')]+=1\n tn[ord(t[i])-ord('a')]+=1\nprint('Yes' if sorted(sn) == sorted(tn) else 'No')"]
['Runtime Error', 'Accepted']
['s660334875', 's730750066']
[3632.0, 3632.0]
[18.0, 132.0]
[499, 210]
p03252
u731702557
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.
['\n----:---F1 *scratch* All L1 (Fundamental)-----------------------------\nLoading subst-jis...done\nS = input()\nT = input()\n\nS_list = []\nT_list = []\nprint(S_list)\nprint(T_list)\nalpha = "abcdefghijklmnopqrstuvwxyz"\n\nfor i in alpha:\n SS = S.count(i)\n TT = T.count(i)\n if SS and TT > 0:\n S_list.append(SS)\n T_list.append(TT)\n\nif sorted(S_list) != sorted(T_list):\n print(\'No\')\nelse:\n print(\'Yes\')', 'S = input()\nT = input()\n\nS_list = []\nT_list = []\nprint(S_list)\nprint(T_list)\nalpha = "abcdefghijklmnopqrstuvwxyz"\n\nfor i in alpha:\n SS = S.count(i)\n TT = T.count(i)\n if SS > 0:\n S_list.append(SS)\n if TT > 0:\n T_list.append(TT)\n\nif sorted(S_list) != sorted(T_list):\n print(\'No\')\nelse:\n print(\'Yes\')', 'S = input()\nT = input()\n\nS_list = []\nT_list = []\nalpha = "abcdefghijklmnopqrstuvwxyz"\n\nfor i in alpha:\n SS = S.count(i)\n TT = T.count(i)\n if SS > 0:\n S_list.append(SS)\n if TT > 0:\n T_list.append(TT)\n\nif sorted(S_list) != sorted(T_list):\n print(\'No\')\nelse:\n print(\'Yes\')']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s529132957', 's974376081', 's877111552']
[2940.0, 3632.0, 3632.0]
[17.0, 28.0, 28.0]
[428, 329, 301]
p03252
u736729525
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(S, T):\n cs = dict()\n\n for i, s in enumerate(S):\n t = T[i]\n if s != t:\n if t not in cs:\n cs[t] = s\n elif cs[t] == s:\n continue\n else:\n return "No"\n return "Yes"\n\nif __name__ == "__main__":\n \n \n \n S = input()\n T = input()\n print(main())\n', 'def main(S, T):\n cs = dict()\n\n for i, s in enumerate(S):\n t = T[i]\n if s != t:\n if t not in cs:\n cs[t] = s\n elif cs[t] == s:\n continue\n else:\n return "No"\n return "Yes"\n\nif __name__ == "__main__":\n\n S = input()\n T = input()\n print(main())\n', 'def main():\n S = input()\n T = input()\n cs = dict()\n to = set()\n for i, s in enumerate(S):\n t = T[i]\n if s != t:\n if s not in cs:\n if t in to:\n print("NO")\n return\n to.add(t)\n cs[s] = t\n elif cs[s] == t:\n continue\n else:\n print("NO")\n return\n print("YES")\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nimport collections\n\ndef main(S, T):\n print(S, file=sys.stderr)\n print(T, file=sys.stderr)\n\n m = dict()\n for s, t in zip(S, T):\n if s in m and m[s] != t:\n return "No"\n m[s] = t\n print(" ".join(m), file=sys.stderr)\n print(" ".join(m.values()), file=sys.stderr)\n c = set()\n for t in m.values():\n if t in c:\n return "No"\n c.add(t)\n return "Yes" \n\nassert main("chokudai", "redcoder") == "No"\nassert main("azzel", "apple") == "Yes"\nassert main("abcdefghijklmnopqrstuvwxyz", "ibyhqfrekavclxjstdwgpzmonu") == "Yes"\nS = input()\nT = input()\nprint(main(S, T))\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s019881001', 's543248609', 's647375788', 's197546814']
[3632.0, 3632.0, 3632.0, 4272.0]
[18.0, 18.0, 48.0, 46.0]
[527, 349, 488, 639]
p03252
u758411830
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.
['\n# chokudai\n# redkuoai\n\n\n\n# iaucoder\n\nS = list(input())\nT = list(input())\n\nfrom collections import defaultdict\ns_dic = defaultdict(set)\nt_dic = defaultdict(set)\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if len(s_dic[s]) > 0 and t not in s_dic[s]:\n print(False)\n exit()\n if len(t_dic[t]) > 0 and s not in t_dic[t]:\n print(False)\n exit()\n s_dic[s].add(t)\n t_dic[t].add(s)\n\nprint(True)\n', "\n# chokudai\n# redkuoai\n\n\n\n# iaucoder\n\nS = list(input())\nT = list(input())\n\nfrom collections import defaultdict\ns_dic = defaultdict(set)\nt_dic = defaultdict(set)\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if len(s_dic[s]) > 0 and t not in s_dic[s]:\n print('No')\n exit()\n if len(t_dic[t]) > 0 and s not in t_dic[t]:\n print('No')\n exit()\n s_dic[s].add(t)\n t_dic[t].add(s)\n\nprint('Yes')\n"]
['Wrong Answer', 'Accepted']
['s353047900', 's879529516']
[12284.0, 12452.0]
[152.0, 147.0]
[617, 616]
p03252
u768896740
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\nalphabet_list = [[]for i in range(26)]\n\nfor i in range(len(s)):\n if s[i] == t[i]:\n continue\n if t[i] not in alphabet_list[ord(s[i])-97]:\n alphabet_list[ord(s[i])-97].append(t[i])\n elif t[i] in alphabet_list[ord(s[i])-97]:\n continue\n else:\n print('No')\n exit()\n\nfor i in range(25):\n for j in range(i, 26):\n if alphabet_list[i] == alphabet_list[j]:\n print('No')\n exit()\n\nprint('Yes')\n", "s = input()\nt = input()\n\nalphabet_1 = [[] for _ in range(26)]\nalphabet_2 = [[] for _ in range(26)]\n\nfor i in range(len(s)):\n if alphabet_1[ord(s[i])-97] == []:\n alphabet_1[ord(s[i])-97] = t[i]\n else:\n if alphabet_1[ord(s[i])-97] == t[i]:\n continue\n else:\n print('No')\n exit()\n\n if alphabet_2[ord(t[i])-97] == []:\n alphabet_2[ord(t[i])-97] = s[i]\n else:\n if alphabet_2[ord(t[i])-97] == s[i]:\n continue\n else:\n print('No')\n exit()\n\nprint('Yes')"]
['Wrong Answer', 'Accepted']
['s231037576', 's591830603']
[3632.0, 3632.0]
[173.0, 101.0]
[486, 562]
p03252
u770009793
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\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nif len(sset) != len(tset):\n print("No")\nelse:\n for i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n s.replace(s[i], i)\n for i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n t.replace(t[i], i)\n if s != t:\n print("No")\n else:\n print("Yes")\n\n', 's = input()\nt = input()\n\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nif len(sset) != len(tset):\n print("No")\nelse:\n for i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n si = string(i)\n s.replace(s[i], si)\n for i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n ti = string(i)\n t.replace(t[i], ti)\n if s != t:\n print("No")\n else:\n print("Yes")\n\n', 'S = input()\nT = input()\n\ni = 0\nj = 0\nss = list()\ntt = list()\nslist = list()\ntlist = list()\n\nif len(S) == len(T):\n for s in S:\n if s in slist:\n ss.append(slist[s])\n else:\n ss.append(i)\n slist.append(s)\n i += 1\n\n for t in T:\n if t in tlist:\n tt.append(tlist[t])\n else:\n tt.append(j)\n tlist.append(t)\n j += 1\n\n if ss == tt:\n print("Yes")\n else:\n print("No")\nelse:\n print("No")\n \n \n \n', 's = input()\nt = input()\n\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nif len(sset) != len(tset):\n print("No")\nelse:\n for i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n si = string(i)\n ss = s.replace(s[i], si)\n for i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n ti = string(i)\n ts = t.replace(t[i], ti)\n if ss != ts:\n print("No")\n else:\n print("Yes")\n\n', 's = input()\nt = input()\n\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nfor i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n si = string(i)\n ss = s.replace(s[i], si)\nfor i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n ti = string(i)\n ts = t.replace(t[i], ti)\n\nif len(sset) != len(tset):\n print("No")\nelse:\n if ss != ts:\n print("No")\n else:\n print("Yes")\n\n', 's = input()\nt = input()\n\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nfor i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n si = string(i)\n ss = s.replace(s[i], si)\nfor i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n ti = string(i)\n ts = t.replace(t[i], ti)\n\nif len(sset) != len(tset):\n print("No")\nelse:\n if ss != ts:\n print("No")\n else:\n print("Yes")\n\n', 'S = input()\nT = input()\n\ni = 0\nj = 0\nss = list()\ntt = list()\nslist = list()\ntlist = list()\n\nif len(s) == len(t):\n for s in S:\n if s in slist:\n ss.append(slist[s])\n else:\n ss.append(i)\n slist.append(s)\n i += 1\n\n for t in T:\n if t in tlist:\n tt.append(tlist[t])\n else:\n tt.append(j)\n tlist.append(t)\n j += 1\n\n if ss == tt:\n print("Yes")\n else:\n print("No")\nelse:\n print("No")\n \n \n \n', 'S = input()\nT = input()\n\ni = 0\nj = 0\nss = list()\ntt = list()\nslist = list()\ntlist = list()\n\nfor s in S:\n if s in slist:\n ss.append(slist[s])\n else:\n ss.append(i)\n slist.append(s)\n i += 1\n\nfor t in T:\n if t in tlist:\n tt.append(tlist[t])\n else:\n tt.append(j)\n tlist.append(t)\n j += 1\n\nif ss == tt:\n print("Yes")\nelse:\n print("No")\n\n \n \n ', 's = input()\nt = input()\n\nsset = set(s)\ntset = set(t)\nslist = list()\ntlist = list()\n\nfor i in range(len(s)):\n smoji = s[i]\n if s[i] in slist:\n continue\n else:\n si = string(i)\n s.replace(s[i], si)\nfor i in range(len(t)):\n tmoji = t[i]\n if t[i] in tlist:\n continue\n else:\n ti = string(i)\n t.replace(t[i], ti)\n\n \nif len(sset) != len(tset):\n print("No")\nelse:\n if s != t:\n print("No")\n else:\n print("Yes")\n\n', 'S = input()\nT = input()\n\ni = 0\nj = 0\nss = list()\ntt = list()\nslist = list()\ntlist = list()\n\nif len(S) == len(T):\n for s in S:\n if s in slist:\n ss.append(slist.index(s))\n else:\n ss.append(i)\n slist.append(s)\n i += 1\n\n for t in T:\n if t in tlist:\n tt.append(tlist.index(t))\n else:\n tt.append(j)\n tlist.append(t)\n j += 1\n\n if ss == tt:\n print("Yes")\n else:\n print("No")\nelse:\n print("No")\n \n \n \n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s172054729', 's278659315', 's343203383', 's377108920', 's539734014', 's687682048', 's871885529', 's873618011', 's975031005', 's341556018']
[3632.0, 3632.0, 3632.0, 3632.0, 2940.0, 3632.0, 3632.0, 3632.0, 2940.0, 6832.0]
[26.0, 27.0, 19.0, 27.0, 17.0, 26.0, 18.0, 18.0, 17.0, 235.0]
[449, 499, 502, 511, 480, 475, 502, 406, 467, 514]
p03252
u770077083
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\ns2 = []\nt2 = []\n\nsdic = {}\ntdic = {}\n\ncnt = 0\nfor c in s:\n if c in sdic:\n s2.append(sdic[c])\n else:\n s2.append(cnt)\n sdic[c] = cnt\n cnt += 1\n\ncnt = 0\nfor c in t:\n if c in tdic:\n t2.append(tdic[c])\n else:\n t2.append(cnt)\n tdic[c] = cnt\n cnt += 1\n \nprint(s2)\nprint(t2)\n\nprint("Yes" if s2 == t2 else "No")\n', 's = input()\nt = input()\n\ns2 = []\nt2 = []\n\nsdic = {}\ntdic = {}\n\ncnt = 0\nfor c in s:\n if c in sdic:\n s2.append(sdic[c])\n else:\n s2.append(cnt)\n sdic[c] = cnt\n cnt += 1\n\ncnt = 0\nfor c in t:\n if c in tdic:\n t2.append(tdic[c])\n else:\n t2.append(cnt)\n tdic[c] = cnt\n cnt += 1\n\nprint("Yes" if s2 == t2 else "No")\n']
['Wrong Answer', 'Accepted']
['s508485385', 's745454091']
[9856.0, 6832.0]
[128.0, 107.0]
[403, 374]
p03252
u777923818
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.
['print(["No", "Yes"][Counter(Counter(input()).values()) == Counter(Counter(input()).values())])', 'from bisect import bisect, bisect_left\nfrom collections import Counter, defaultdict\nfrom functools import reduce\nfrom itertools import accumulate\nfrom operator import itemgetter, xor, mul\n\nimport sys\n#input = sys.stdin.readline\n\ndef inpl(): return list(map(int, input().split()))\nS = input()\nT = input()\nP = defaultdict(set)\n\nfor i in range(len(S)):\n P[S[i]].add(T[i])\n \n\nfor v in P.values():\n if len(v) >= 2:\n print("No")\n break\nelse:\n if Counter(Counter(S).values()) == Counter(Counter(T).values()):\n print("Yes")\n else:\n print("No")']
['Runtime Error', 'Accepted']
['s850348525', 's480634697']
[2940.0, 4392.0]
[17.0, 92.0]
[94, 578]
p03252
u781262926
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\nS, T = map(lambda x: x.strip(), open(0).read().split())\n\nds, dt = defaultdict(str), defaultdict(str)\nans = 'Yes'\nfor s, t in zip(S, T):\n if ds[s] or ds[s] == t:\n ds[s] = t\n else:\n ans = 'No'\n break\n if dt[t] or dt[t] == s:\n dt[t] = s\n else:\n ans = 'No'\n break\nprint(ans)", "from collections import defaultdict\nS, T = map(lambda x: x.strip(), open(0).read().split())\n\nfrom collections import defaultdict\nS, T = map(lambda x: x.strip(), open(0).read().split())\n\nds, dt = defaultdict(str), defaultdict(str)\nans = 'Yes'\nfor s, t in zip(S, T):\n if not ds[s] or ds[s] == t:\n ds[s] = t\n else:\n ans = 'No'\n break\n if not dt[t] or dt[t] == s:\n dt[t] = s\n else:\n ans = 'No'\n break\nprint(ans)", "S = input().strip()\nT = input().strip()\n\nds = {}\ndt = {}\nans = 'Yes'\nfor s, t in zip(S, T):\n if s not in ds or ds[s] == t:\n ds[s] = t\n else:\n ans = 'No'\n break\n if t not in dt or dt[s] == s:\n dt[t] = s\n else:\n ans = 'No'\n break\nprint(ans)", "S, T = input().strip(), input().strip()\nds, dt = {}, {}\n\nfor s, t in zip(S, T):\n if s not in ds or ds[s] == t:\n ds[s] = t\n else:\n print('No')\n exit()\n if t not in dt or dt[t] == s:\n dt[t] = s\n else:\n print('No')\n exit()\nprint('Yes')"]
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s337097182', 's811892868', 's921058843', 's447795297']
[4084.0, 4084.0, 3632.0, 3632.0]
[21.0, 21.0, 19.0, 120.0]
[360, 461, 292, 286]
p03252
u785505707
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().strip()\nt=input().strip()\ns_list=[]\nt_list=[]\nfor char in s:\n s_list.append(char)\nfor char in t:\n t_list.append(char)\ns_collection=collections.Counter(s_list)\nt_collection=collections.Counter(t_list)\ns_countlist=[]\nt_countlist=[]\nfor entry in s_collection.values():\n s_countlist.append(entry)\nfor entry in t_collection.values():\n t_countlist.append(entry)\ns_countlist.sort()\nt_countlist.sort()\nif s_countlist == t_countlist:\n print("Yes")\nelse:\n print("No")', 'import collections\ns=input().strip()\nt=input().strip()\ns_list=[]\nt_list=[]\nfor char in s:\n s_list.append(char)\nfor char in t:\n t_list.append(char)\ns_collection=collections.Counter(s_list)\nt_collection=collections.Counter(t_list)\ns_countlist=[]\nt_countlist=[]\nfor entry in s_collection.values():\n s_countlist.append(entry)\nfor entry in t_collection.values():\n t_countlist.append(entry)\ns_countlist.sort()\nt_countlist.sort()\nif s_countlist == t_countlist:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s284303180', 's753358012']
[6832.0, 7088.0]
[63.0, 83.0]
[485, 504]
p03252
u785578220
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.
['\ndef get_input(inp):\n li = inp.split("\\n")\n\n def inner():\n return li.pop(0)\n return inner\n\nINPUT = \ninput = get_input(INPUT)\n\n#######################################################\na = input()\nb = input()\nk = []\nl = []\nnp=0\nnq=0\nfor i in range(0,len(a)):\n if a[i] not in k:\n k.append(a[i])\n np+=1\n if b[i] not in l:\n l.append(b[i])\n nq+=1\n if i != 0:\n if not (k.index(a[i])==l.index(b[i]) and ((a[i-1]==a[i] and b[i-1] == b[i]) or ( a[i-1] != a[i] and b[i-1]!= b[i]))):\n np*=0\nif np == nq:\n print("Yes")\nelse:\n print("No")', 'a = input()\nb = input()\nk = []\nl = []\nnp=0\nnq=0\nfor i in range(0,len(a)):\n if a[i] not in k:\n k.append(a[i])\n np+=1\n if b[i] not in l:\n l.append(b[i])\n nq+=1\n if i != 0:\n if not (k.index(a[i])==l.index(b[i]) and ((a[i-1]==a[i] and b[i-1] == b[i]) or ( a[i-1] != a[i] and b[i-1]!= b[i]))):\n np*=0\nif np == nq:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s852614302', 's798766589']
[3064.0, 3632.0]
[19.0, 310.0]
[618, 402]
p03252
u797740860
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\nsc = ["" for i in range(0, 26)]\ntc = ["" for i in range(0, 26)]\nscf = False\ntcf = False\nfor i in range(0, len(s)):\n sci = sc[ord(s[i]) - ord(\'a\')]\n if sci != "" and t[i] != sci:\n print("NO")\n scf = True\n break\n else:\n sc[ord(s[i]) - ord(\'a\')] = t[i]\n\nif not scf:\n for i in range(0, len(t)):\n tci = tc[ord(t[i]) - ord(\'a\')]\n if tci != "":\n if t[i] == tci or t[i] == s[i]:\n print("NO")\n tcf = True\n break\n else:\n tc[ord(t[i]) - ord(\'a\')] = s[i]\n\n if not tcf:\n print("YES")', 's = input()\nt = input()\n\nsc = ["" for i in range(0, 26)]\ntc = ["" for i in range(0, 26)]\nscf = False\ntcf = False\nfor i in range(0, len(s)):\n sci = sc[ord(s[i]) - ord(\'a\')]\n if sci != "" and t[i] != sci:\n print("No")\n scf = True\n break\n else:\n sc[ord(s[i]) - ord(\'a\')] = t[i]\n\nif not scf:\n for i in range(0, len(t)):\n tci = tc[ord(t[i]) - ord(\'a\')]\n if tci != "" and s[i] != tci:\n print("No")\n tcf = True\n break\n else:\n tc[ord(t[i]) - ord(\'a\')] = s[i]\n if not tcf:\n print("Yes")']
['Wrong Answer', 'Accepted']
['s968396734', 's696051901']
[3632.0, 3760.0]
[255.0, 293.0]
[633, 592]
p03252
u803848678
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\nif set(list(s)) != set(list(t)):\n print("No")\n exit()\n\n\nd = dict()\nfor si, ti in zip(s, t):\n if si not in d:\n d[si] = ti\n else:\n if d[si] != ti:\n print("No")\n exit()\nprint("Yes")', 's = input()\nt = input()\n\n\nif len(set(list(s))) != len(set(list(t))):\n print("No")\n exit()\n\n\nd = dict()\nfor si, ti in zip(s, t):\n if si not in d:\n d[si] = ti\n else:\n if d[si] != ti:\n print("No")\n exit()\nprint("Yes")']
['Wrong Answer', 'Accepted']
['s462754162', 's500804825']
[5168.0, 5168.0]
[31.0, 70.0]
[319, 329]
p03252
u807772568
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 = list(input())\nb = list(input())\nc = len(a)\np = 0\nd = [0 for i in range(27)]\nl = [[]for i in range(27)]\nh = [[]for i in range(27)]\nll = [0 for i in range(27)]\nif a == b:\n\tprint("Yes")\nelse:\n\tfor i in range(c):\n\t\tk = ord(b[i])-97\n\t\tif a[i] in l[k]:\n\t\t\tp = 0\n\t\telse:\n\t\t\tif len(l[k]) == 0:\n\t\t\t\tl[k].append(a[i])\n\t\t\telse:\n\t\t\t\tp = 1\n\t\t\t\tbreak\n\t\tk = ord(a[i])-97\n\t\tif b[i] in h[k]:\n\t\t\tp = 0\n\t\telse:\n\t\t\tif len(h[k]) == 0:\n\t\t\t\th[k].append(a[i])\n\t\t\telse:\n\t\t\t\tp = 1\n\t\t\t\tbreak\n\tif p == 1:\n\t\tprint("No")\n\telse:\n\t\tprint("Yes")\n', 'a = list(input())\nb = list(input())\nc = len(a)\np = 0\nd = [0 for i in range(27)]\nl = [[]for i in range(27)]\nh = [[]for i in range(27)]\nll = [0 for i in range(27)]\nif a == b:\n\tprint("Yes")\nelse:\n\tfor i in range(c):\n\t\tk = ord(b[i])-97\n\t\tif a[i] in l[k]:\n\t\t\tp = 0\n\t\telse:\n\t\t\tif len(l[k]) == 0:\n\t\t\t\tl[k].append(a[i])\n\t\t\telse:\n\t\t\t\tp = 1\n\t\t\t\tbreak\n\t\tk = ord(a[i])-97\n\t\tif b[i] in h[k]:\n\t\t\tp = 0\n\t\telse:\n\t\t\tif len(h[k]) == 0:\n\t\t\t\th[k].append(b[i])\n\t\t\telse:\n\t\t\t\tp = 1\n\t\t\t\tbreak\n\tif p == 1:\n\t\tprint("No")\n\telse:\n\t\tprint("Yes")']
['Wrong Answer', 'Accepted']
['s981353979', 's503390928']
[6704.0, 6832.0]
[24.0, 143.0]
[517, 516]
p03252
u814986259
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()\ntableS=collections.defaultdict(list)\ntableT=collections.defaultdict(list)\n\nfor i in range(len(S)):\n tableS[S[i]].append(i)\n tableT[T[i]].append(i)\nlistS=tableS.values()\nlistT=tableT.values()\nfor x in listS:\n flag=False\n for y in listT:\n if x in y:\n flag=True\n break\n if not flag:\n print("No")\n exit(0)\nprint("Yes")\n ', 'def main():\n import collections\n S = input()\n T = input()\n N = len(S)\n table = collections.defaultdict(int)\n table2 = collections.defaultdict(int)\n flag = True\n for i in range(N):\n x = S[i]\n y = T[i]\n\n if x in table:\n if y == T[table[x]]:\n continue\n else:\n flag = False\n break\n else:\n if y in table2:\n flag = False\n break\n table[x] = i\n table2[y] = i\n\n if flag:\n print("Yes")\n else:\n print("No")\n\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s979887688', 's399564097']
[14512.0, 4016.0]
[114.0, 57.0]
[384, 607]
p03252
u815666840
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())\n\nprint(s)\nprint(t)\n\nsset = list(set(s))\ntset = list(set(t))\n\nprint(sset)\nprint(tset)\n\ns_getindex = []\nt_getindex = []\n\nfor j in range(len(sset)):\n s_getindex.append([i for i, x in enumerate(s) if x == sset[j]])\n\nfor jj in range(len(tset)):\n t_getindex.append([ii for ii, y in enumerate(t) if y == tset[jj]])\n\nprint(s_getindex)\nprint(t_getindex)\n\ncheck_s = []\ncheck_t = []\nans = 0\n\nfor k in range(len(sset)):\n if len(s_getindex[k]) != 1:\n for m in s_getindex[k]:\n check_s.append(t[m])\n if len(set(check_s)) != 1:\n ans = ans + 1\n\nfor kk in range(len(tset)):\n if len(t_getindex[kk]) != 1:\n for mm in t_getindex[kk]:\n check_t.append(s[mm])\n if len(set(check_t)) != 1:\n ans = ans + 1\n\nprint(ans)\n\nif ans == 0:\n print("Yes")\nelse:\n print("No")\n', 's = list(input())\nt = list(input())\n\n#print(s)\n#print(t)\n\nsset = list(set(s))\ntset = list(set(t))\n\n#print(sset)\n#print(tset)\n\ns_getindex = []\nt_getindex = []\n\nfor j in range(len(sset)):\n s_getindex.append([i for i, x in enumerate(s) if x == sset[j]])\n\nfor jj in range(len(tset)):\n t_getindex.append([ii for ii, y in enumerate(t) if y == tset[jj]])\n\n#print(s_getindex)\n#print(t_getindex)\n\ncheck_s = []\ncheck_t = []\nans = 0\n\nfor k in range(len(sset)):\n if len(s_getindex[k]) != 1:\n for m in s_getindex[k]:\n check_s.append(t[m])\n# print(check_s)\n# print(len(set(check_s)))\n if len(set(check_s)) != 1:\n ans = ans + 1\n# print(s[m])\n check_s.clear()\n\nfor kk in range(len(tset)):\n if len(t_getindex[kk]) != 1:\n for mm in t_getindex[kk]:\n check_t.append(s[mm])\n if len(set(check_t)) != 1:\n ans = ans + 1\n# print(t[mm])\n check_t.clear()\n\n#print(ans)\n\nif ans == 0:\n print("Yes")\nelse:\n print("No")\n']
['Wrong Answer', 'Accepted']
['s000569058', 's316630909']
[32316.0, 23268.0]
[824.0, 687.0]
[864, 1028]
p03252
u816116805
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 python\n# -*- coding: utf-8 -*-\n\n#\n\n"""\nRC110C\n"""\n\n\ns = list(input())\nt = list(input())\nn = len(s)\n\ndef exchange(a,b,c):\n if a != b and a!=c:\n return(a)\n elif a == b:\n return(c)\n elif a == c:\n return(b)\n\nans = \'Yes\'\n\nseen = set()\nfor i in range(n):\n sl = s.pop()\n tl = t.pop()\n if sl == tl:\n seen.add(sl)\n elif sl != tl and not tl in seen and not sl in seen:\n s = list(map(lambda a: exchange(a,sl,tl),s))\n seen.add(tl)\n else:\n ans = \'No\'\n break\n print(s)\n\nprint(ans)\n\n\n\n', '#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n\n"""\nRC110C\n"""\n\n\ns = list(input())\nt = list(input())\nn = len(s)\n\ndef exchange(a,b,c):\n if a != b and a!=c:\n return(a)\n elif a == b:\n return(c)\n elif a == c:\n return(b)\n\nans = \'Yes\'\n\nseen = set()\nfor i in range(n):\n sl = s.pop()\n tl = t.pop()\n if sl == tl:\n seen.add(sl)\n elif sl != tl and not tl in seen and not sl in seen:\n s = list(map(lambda a: exchange(a,sl,tl),s))\n seen.add(tl)\n else:\n ans = \'No\'\n break\n\nprint(ans)\n\n\n\n']
['Runtime Error', 'Accepted']
['s761525108', 's642988924']
[141352.0, 8240.0]
[2103.0, 634.0]
[585, 572]
p03252
u822662438
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())\npair = []\nli =[]\nans = "Yes"\n\nfor i in range(len(s)):\n if [s[i],t[i]] in li:\n pass\n else:\n li.append([s[i],t[i]])\n\ndef check2(pair,i,li):\n for j in range(len(pair)):\n if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):\n return False\n return True\n\nfor i in range(len(s)):\n if check2(pair,i,li):\n pair.append([li[i][0],li[i][1]])\n else:\n ans = "No"\n break\n\nprint(ans)\n', 's = list(input())\nt = list(input())\ns.sort()\nt.sort()\nif s == t:\n print("Yes")\nelse:\n print("No")\n', 's = list(input())\nt = list(input())\npair = []\nli =[]\nans = "Yes"\n\nfor i in range(len(s)):\n if [s[i],t[i]] in li:\n pass\n else:\n li.append([s[i],t[i]])\n\ndef check2(pair,i,li):\n for j in range(len(pair)):\n if (li[i][0]==pair[j][0] and li[i][1]!=pair[j][1])or(li[i][0]!=pair[j][0] and li[i][1]==pair[j][1]):\n return False\n return True\n\nfor i in range(len(li)):\n if check2(pair,i,li):\n pair.append([li[i][0],li[i][1]])\n else:\n ans = "No"\n break\n\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s272385562', 's725463219', 's487101776']
[6704.0, 7316.0, 6704.0]
[773.0, 99.0, 770.0]
[522, 104, 523]
p03252
u824337972
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(str(input()))\nt = list(str(input()))\n\n\n\ndef judge(S,T):\n start = [-1 for i in range(26) ] \n goal = [-1 for i in range(26)]\n for i in range(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 print("No")\n break\n else:\n start[a] = b\n goal[b] =a\n if i==len(S)-1:\n print("Yes")\n \n \n judge(s,t) ', 's = list(str(input()))\nt = list(str(input()))\n\ndef judge(S,T):\n start = [-1 for i in range(26) ] \n goal = [-1 for i in range(26)]\n for i in range(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 print("No")\n break\n else:\n start[a] = b\n goal[b] =a\n if i==len(S)-1:\n print("Yes")\n \njudge(s,t)']
['Runtime Error', 'Accepted']
['s148464098', 's926889159']
[3064.0, 6704.0]
[18.0, 126.0]
[529, 502]
p03252
u828766688
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()\n\nS_dic={}\nT_dic={}\n\nfor i in range(len(S)):\n\n if S[i] in S_dic:\n S_dic[S[i]].append(i)\n else:\n S_dic[S[i]] = [i]\n\nfor i in range(len(T)):\n\n if T[i] in T_dic:\n T_dic[T[i]].append(i)\n else:\n T_dic[T[i]] = [i]\n\n\nprint (S_dic)\nprint (T_dic)\n\nT_dicR = {}\n\nfor i in T_dic:\n T_dicR[ str(T_dic[i]) ] = 1\n\nans = True\n\nfor i in S_dic:\n\n if str(S_dic[i]) not in T_dicR:\n ans = False\n break\n\nprint (T_dicR)\n\nif ans:\n print ("Yes")\n\nelse:\n print ("No")', '\nS = input()\nT = input()\n\nS_dic={}\nT_dic={}\n\nfor i in range(len(S)):\n\n if S[i] in S_dic:\n S_dic[S[i]].append(i)\n else:\n S_dic[S[i]] = [i]\n\nfor i in range(len(T)):\n\n if T[i] in T_dic:\n T_dic[T[i]].append(i)\n else:\n T_dic[T[i]] = [i]\n\n\n#print (S_dic)\n#print (T_dic)\n\nT_dicR = {}\n\nfor i in T_dic:\n T_dicR[ str(T_dic[i]) ] = 1\n\nans = True\n\nfor i in S_dic:\n\n if str(S_dic[i]) not in T_dicR:\n ans = False\n break\n\n#print (T_dicR)\n\nif ans:\n print ("Yes")\n\nelse:\n print ("No")']
['Wrong Answer', 'Accepted']
['s053445171', 's060547179']
[30576.0, 22036.0]
[232.0, 169.0]
[530, 533]
p03252
u832039789
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.
["print(['No','Yes'][sorted(input())==sorted(input())])", "s = list(input())\nt = list(input())\n\nfor _ in range(2):\n\n n = len(s)\n l = [set() for _ in range(26)]\n\n def f(c):\n return ord(c) - ord('a')\n\n for i, j in enumerate(s):\n l[f(j)].add(t[i])\n\n for i in l:\n if len(list(i)) > 1:\n print('No')\n exit(0)\n \n s,t = t,s\n\nprint('Yes')\n"]
['Wrong Answer', 'Accepted']
['s101436854', 's564651303']
[7436.0, 6704.0]
[97.0, 175.0]
[53, 339]
p03252
u836737505
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 = sorted(Counter(input()).values)\nt = sorted(Counter(input()).values)\nprint("Yes" if s==t else "No")', 'from collections import Counter\ns = sorted(Counter(list(input())).values())\nt = sorted(Counter(list(input())).values())\nprint("Yes" if s==t else "No")']
['Runtime Error', 'Accepted']
['s025801392', 's128238203']
[3828.0, 5396.0]
[32.0, 46.0]
[134, 150]
p03252
u842170774
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()\na1=collections.Counter(S)\na2=collections.Counter(T)\nif a1==a2:\n print('Yes')\nelse:\n print('No')", "import collections\nS=input()\nT=input()\na1=collections.Counter(S)\na2=collections.Counter(T)\nx=''\nfor i in range(len(S)):\n if a1[S[i]]!=a2[T[i]]:\n x='No'\nif x=='':\n print('Yes')\nelse:\n print(x)"]
['Wrong Answer', 'Accepted']
['s894234826', 's509409161']
[4016.0, 4144.0]
[41.0, 124.0]
[140, 207]
p03252
u842964692
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()\n\nS=Counter(S).values()\nT=Counter(T).values()\n\nS.sort()\nT.sort()\n\nif S==T:\n print('Yes')\nelse:\n print('No')\n", "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')\n"]
['Runtime Error', 'Accepted']
['s872206857', 's765145905']
[4016.0, 4016.0]
[43.0, 41.0]
[166, 176]
p03252
u844646164
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()\n\nfor w in list(S):\n if w in list(T):\n S = list(S)\n T = list(T)\n idx = S.index(w)\n del S[idx]\n del T[idx]\n S = ''.join(S)\n T = ''.join(T)\ns_count = Counter(S)\ndel_s = []\nt_count = Counter(T)\ndel_t = []\n\nfor ks, vs in list(s_count.items()):\n for kt, vt in list(t_count.items()):\n if vs == vt:\n del_s.append(ks)\n del_t.append(kt)\n del s_count[ks]\n del t_count[kt]\n break\n\nif len(S) == len(del_s):\n print('Yes')\nelse:\n print('No')\n", 'from collections import defaultdict\nS = list(input())\nT = list(input())\nl = len(S)\nds = defaultdict(str)\ndt = defaultdict(str)\nfor i in range(l):\n if ds[S[i]] == "":\n ds[S[i]] = T[i]\n elif ds[S[i]] == T[i]:\n pass\n else:\n print(\'No\')\n exit()\n if dt[T[i]] == "":\n dt[T[i]] = S[i]\n elif dt[T[i]] == S[i]:\n pass\n else:\n print(\'No\')\n exit()\n\nprint(\'Yes\')']
['Wrong Answer', 'Accepted']
['s077253058', 's605051504']
[9372.0, 6960.0]
[2104.0, 137.0]
[606, 423]
p03252
u845333844
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\ns = list(input())\nt = list(input())\n\ncs = collections.Counter(s)\nct = collections.Counter(t)\n\nslist = cs.values()\ntlist = ct.values()\n\nslist.sort()\ntlist.sort()\n\nif slist == tlist:\n print("Yes")\nelse:\n print("No")\n\n', 'from collections import Counter\n\ns = list(input())\nt = list(input())\n\ncs = Counter(s)\nct = Counter(t)\n\nslist = cs.value()\ntlist = cs.value()\n\nslist.sort()\ntlist.sort()\n\nif slist == tlist:\n print("Yes")\nelse:\n print("No")', 'from collections import Counter\n\ns = list(input())\nt = list(input())\n\ncs = Counter(s)\nct = Counter(t)\n\nslist = list(cs.value())\ntlist = list(cs.value())\n\nslist.sort()\ntlist.sort()\n\nif slist == tlist:\n print("Yes")\nelse:\n print("No")\n', 'import collections\n\ns = list(input())\nt = list(input())\n\ncs = collections.Counter(s)\nct = collections.Counter(t)\n\nslist = list(cs.values())\ntlist = list(ct.values())\n\nslist.sort()\ntlist.sort()\n\nif slist == tlist:\n print("Yes")\nelse:\n print("No")\n\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s098046945', 's537192845', 's613587409', 's640573532']
[6960.0, 6960.0, 6960.0, 6960.0]
[47.0, 47.0, 47.0, 46.0]
[241, 226, 239, 253]
p03252
u853900545
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\nS = sorted(list(collections.Counter(s)))\nT = sorted(list(collections.Counter(t)))\n\nif S == T:\n print('Yes')\nelse:\n print('No')", "s = list(input().split())\nt = list(input().split())\n\nn = len(s)\nx = [0]*n\nfor i in range(n-1):\n if s[i] == s[i+1]: \n x[i] += 1\n else:\n break\n\ny = [0]*n\nfor i in range(n-1):\n if s[i] == s[i+1]: \n x[i] += 1\n else:\n break\n\nS =collections.Counter(s)\nT =collections.Counter(t)\n\nS1 = S.values()\nT1 = S.values()\n\nif x == y and sorted(S1) == sorted(T1):\n print('Yes')\nelse:\n print('No')", "import collections\ns = input()\nt = input()\n\nS = sorted(list(collections.Counter(s).values()))\nT = sorted(list(collections.Counter(t).values()))\n\nif S == T:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s455253545', 's520929198', 's552397688']
[4144.0, 3632.0, 4016.0]
[45.0, 20.0, 41.0]
[176, 424, 194]
p03252
u853952087
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=[]\nT=[]\nfor i in s:\n S.append(s.count(i)) \nfor j in t:\n T.append(t.count(j))\nif S==T:\n print('YES')\nelse:print('NO')", "s=input()\nt=input()\nS=[]\nT=[]\nfor i in s:\n S.append(s.count(i)) \nfor j in t:\n T.append(t.count(j))\nprint(S,T)\nif S==T:\n print('Yes')\nelse:print('No')", "s=input()\nt=input()\nS=[0 for i in range(26)]\nT=[0 for i in range(26)]\nfor i in range(len(s)):\n S[ord(s[i])-97]=int(str(S[ord(s[i])-97])+str(i)) \nfor i in range(len(t)):\n T[ord(t[i])-97]=int(str(T[ord(t[i])-97])+str(i)) \nss=sorted(S)\ntt=sorted(T)\nprint(S,T,ss,tt)\nif ss==tt:\n print('Yes')\nelse:print('No')", "\nS=input()\nT=input()\n\nd={}\n\nfor i in range(len(S)):\n if S[i] not in d:\n d[S[i]]=T[i] \n else:\n \n if d[S[i]]!=T[i]:\n print('No')\n exit()\nd={}\nfor i in range(len(T)):\n if T[i] not in d:\n d[T[i]]=S[i]\n else:\n if d[T[i]]!=S[i]:\n print('No')\n exit()\nprint('Yes')"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s216699352', 's767677040', 's900343525', 's659296860']
[4596.0, 4596.0, 3632.0, 3632.0]
[2104.0, 2104.0, 2104.0, 127.0]
[147, 158, 315, 620]
p03252
u859897687
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()\nn=input()\nd=dict()\nans="Yes"\nfor i in range(len(s)):\n if s[i] not in d:\n d[s[i]]=n[i]\n elif d[s[i]]!=n[i]:\n ans="No"\nif s!=n and len(s)=26:\n ans="No"\nprint(ans)', 's=input()\nn=input()\nd=dict()\nans="Yes"\nfor i in range(len(s)):\n if s[i] not in d:\n d[s[i]]=n[i]\n elif d[s[i]]!=n[i]:\n ans="No"\na=set()\nfor i in s:\n a.add(i)\nb=set()\nfor i in n:\n b.add(i)\nif a!=b:\n ans="No"\nprint(ans)', 's=input()\nn=input()\nd=dict()\ndd=dict()\nans="Yes"\nfor i in range(len(s)):\n if s[i] not in d:\n d[s[i]]=n[i]\n elif d[s[i]]!=n[i]:\n ans="No"\n if n[i] not in dd:\n dd[n[i]]=s[i]\n elif dd[n[i]]!=s[i]:\n ans="No"\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s225791739', 's571019786', 's273171800']
[2940.0, 3632.0, 3760.0]
[17.0, 116.0, 133.0]
[179, 227, 230]
p03252
u860002137
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()\n\nc1 = Counter(s).most_common()\nc2 = Counter(t).most_common()\n\nfor x, y in zip(c1, c2):\n print(x, y)\n if x[1] != y[1]:\n print("No")\n break\nelse:\n print("Yes")', "def solve(s, t):\n dic1, dic2 = {}, {}\n for x, y in zip(s, t):\n if x in dic1:\n if dic1[x] != y:\n return False\n else:\n dic1[x] = y\n if y in dic2:\n if dic2[y] != x:\n return False\n else:\n dic2[y] = x\n return True\n\n\ns = input()\nt = input()\n\nprint('Yes' if solve(s, t) else 'No')"]
['Wrong Answer', 'Accepted']
['s072728016', 's501005942']
[4016.0, 3632.0]
[42.0, 53.0]
[237, 384]
p03252
u860657719
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()\nalphs = "abcdefghijklmnopqrstuvwxyz"\nflag = False\nfor alph in alphs:\n S2 = S\n indlist = []\n while alph in S2:\n i = S.index(alph)\n indlist.append(i)\n S2 = S2[i+1:]\n if indlist != []:\n T2 = T[indlist[0]]\n for ind in indlist:\n if T[ind] != T2:\n print("No")\n flag = True\n break\n if flag:\n break\nelse:\n for alph in alphs:\n T3 = T\n indlist = []\n while alph in T3:\n i = T.index(alph)\n indlist.append(i)\n T3 = T3[i+1:]\n if indlist != []:\n S3 = S[indlist[0]]\n for ind in indlist:\n if S[ind] != T3:\n print("No")\n flag = True\n break\n if flag:\n break\n else:\n print("Yes")\n', 'S = input()\nT = input()\nST = {}\nTS = {}\nfor i in range(len(S)):\n s = S[i]\n t = T[i]\n if s in ST:\n if ST[s] != t:\n print("No")\n break\n else:\n ST[s] = t\n if t in TS:\n if TS[t] != s:\n print("No")\n break\n else:\n TS[t] = s\nelse:\n print("Yes")\n']
['Wrong Answer', 'Accepted']
['s311024732', 's055106627']
[6280.0, 3632.0]
[2104.0, 104.0]
[843, 331]
p03252
u861141787
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())\n\na = [chr(i + ord("a")) for i in range(26)]\nb = []\n\nfor i in range(len(s)):\n if s[i] != t[i]:\n c1 = s[i]\n c2 = t[i]\n if c2 not in a:\n for j in range(len(b)):\n if b[j][1] == c2 and b[j][0] != c1:\n print("No")\n exit()\n a.remove(c2)\n b.append([c1, c2])\nelse:\n print("Yes")', 's = list(input())\nt = list(input())\n\nb = []\n\nfor i in range(len(s)):\n c1 = s[i]\n c2 = t[i]\n if c1 == c2:\n if b[j][0] == c1:\n print("No")\n exit()\n if c1 != c2:\n for j in range(len(b)):\n if b[j][0] == c1 and b[j][1] != c2:\n print("No")\n exit()\n if b[j][0] != c1 and b[j][1] == c2:\n print("No")\n exit()\n if b[j][0] == c1 and b[j][1] == c2:\n break\n b.append([c1, c2])\nelse:\n print("Yes")\n', 'S = input()\nT = input()\n\nconverter = dict()\n\nfor s, t in zip(S, T):\n if converter.get(s) is not None:\n if converter[s] != t:\n print("No")\n break\n else:\n converter[s] = t\nelse:\n if len(converter.values()) != len(set(converter.values())):\n print("No")\n else:\n print("Yes")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s383119649', 's484681974', 's291934526']
[6704.0, 26544.0, 3632.0]
[26.0, 1065.0, 78.0]
[410, 550, 332]
p03252
u867320886
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\nans='Yes'\nst=[0]*26\nts=[0]*26\nfor i in range(len(s)):\n sind = ord(s[i])-ord('a')\n tind = ord(t[i])-ord('a')\n \n if st[sind] == 0:\n st[sind] == t[i]\n if ts[tind] == 0:\n ts[tind] == s[i]\n if st[sind] == t[i] and ts[tind] == s[i]:\n continue\n else:\n ans='No'\n break\n \nprint(ans)", "s=input()\nt=input()\n\n\nans='Yes'\nst=[0]*26\nts=[0]*26\nfor i in range(len(s)):\n sind = ord(s[i])-ord('a')\n tind = ord(t[i])-ord('a')\n \n if st[sind] == 0:\n st[sind] = t[i]\n if ts[tind] == 0:\n ts[tind] = s[i]\n \n if st[sind] == t[i] and ts[tind] == s[i]:\n continue\n else:\n ans='No'\n break\n \nprint(ans)"]
['Wrong Answer', 'Accepted']
['s318451638', 's524006826']
[3632.0, 3648.0]
[19.0, 190.0]
[354, 357]
p03252
u875361824
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 \n S = input()\n T = input()\n\n ans = f(S, T)\n print(ans)\n\n\nif True:\n import pytest\n\n @pytest.mark.randomize(S=str, T=str,\n min_length=10, max_length=10,\n str_attrs=("ascii_lowercase",))\n def test_f(S, T):\n\n assert f(S, T)\n\n\ndef f(S, T):\n \n import string\n ds = {c: set() for c in string.ascii_lowercase}\n dt = {c: set() for c in string.ascii_lowercase}\n for c1, c2 in zip(S, T):\n ds[c2].add(c1)\n dt[c1].add(c2)\n\n for c in string.ascii_lowercase:\n if len(ds[c]) >= 2 or len(dt[c]) >= 2:\n return "No"\n\n return "Yes"\n\n\nif __name__ == \'__main__\':\n main()\n', 'def main():\n \n S = input()\n T = input()\n\n ans = f(S, T)\n print(ans)\n\n\nif False:\n import pytest\n\n @pytest.mark.randomize(S=str, T=str,\n min_length=10, max_length=10,\n str_attrs=("ascii_lowercase",))\n def test_f(S, T):\n assert f(S, T)\n\n\ndef f(S, T):\n \n import string\n ds = {c: set() for c in string.ascii_lowercase}\n dt = {c: set() for c in string.ascii_lowercase}\n for c1, c2 in zip(S, T):\n ds[c2].add(c1)\n dt[c1].add(c2)\n\n for c in string.ascii_lowercase:\n if len(ds[c]) >= 2 or len(dt[c]) >= 2:\n return "No"\n\n return "Yes"\n\n\nif __name__ == \'__main__\':\n main()\n']
['Runtime Error', 'Accepted']
['s647585081', 's766773743']
[3064.0, 4160.0]
[19.0, 64.0]
[1728, 1728]
p03252
u883048396
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.
['sS = input().rstrip()\nsT = input().rstrip()\n\n\n\n\ndef fConv2B(sA):\n iL = len(sA)\n dA = {}\n for s in "abcdefghijklmnopqrstuvwxyz":\n dA[s] = 0\n iCounter = 1\n for i in range(iL):\n s = sA[i]\n if s in dA:\n if dA[sA[i]] == 0:\n dA[sA[i]] = iCounter\n iCounter += 1\n if iCounter == 27 :\n break\n\n aR = [0]*iL\n for i in range(iL):\n aR[i] = dA[sA[i]]\n print(aR)\n return aR\n\n\n\nif fConv2B(sS) == fConv2B(sT) :\n print("Yes")\nelse:\n print("No")\n', '\n\n\nsS = input().rstrip()\nsT = input().rstrip()\n\naS = [0] * 26\naT = [0] * 26\nsABC = "abcdefghijklmnopqrstuvwxyz"\nfor i in range(26):\n aS[i]=sS.count(sABC[i])\n aT[i]=sT.count(sABC[i])\naS.sort()\naT.sort()\nif aS == aT:\n print ("Yes")\nelse:\n print ("No")\n']
['Wrong Answer', 'Accepted']
['s435127470', 's577200511']
[9832.0, 3632.0]
[152.0, 27.0]
[549, 443]
p03252
u887207211
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(input())\nT = sorted(input())\ncnt = 0\nfor i in range(len(S)):\n if(S[i] != T[i]):\n cnt += 1\nif(cnt <= 1):\n print('Yes')\nelse:\n print('No')", "S = list(set(sorted(input())))\nT = list(set(sorted(input())))\nif(len(S) != len(T)):\n print('No')\n exit()\ncnt = 0\nfor i in range(len(S)):\n if(S[i] != T[i]):\n cnt += 1\nif(cnt <= 1):\n print('Yes')\nelse:\n print('No')", 'import sys \nstdin = sys.stdin\nns = lambda : stdin.readline().rstrip()\n\ns = ns()\nt = ns()\ns_cnt = []\nt_cnt = []\nfor alp in "abcdefghijklmnopqrstuvwxyz":\n s_cnt.append(s.count(alp))\n t_cnt.append(t.count(alp))\ns_cnt.sort()\nt_cnt.sort()\nif s_cnt == t_cnt:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s025953158', 's487256806', 's239252113']
[9484.0, 5872.0, 3632.0]
[136.0, 103.0, 28.0]
[153, 220, 289]
p03252
u901098617
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\ncs = collections.Counter(s)\nct = collections.Counter(t)\n\n# print(list(cs.values()),list(ct.values()))\nif(list(cs.values())==list(ct.values())):\n print("YES")\nelse:\n print("NO")', 'import collections\ns = input()\nt = input()\n\nd = {}\nflag = True\nfor i in range(len(s)):\n if s[i] in d.keys():\n if t[i] == d[s[i]]:\n continue\n else:\n flag=False\n break\n elif t[i] in d.values():\n if d.get(s[i]) == t[i]:\n continue\n else:\n flag=False\n break\n else:\n d[s[i]] = t[i]\n\nprint("Yes" if flag else "No")']
['Wrong Answer', 'Accepted']
['s982679181', 's103598665']
[4016.0, 4144.0]
[42.0, 95.0]
[226, 417]
p03252
u903460784
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\n\ns=input()\nt=input()\ns_cnt=np.zeros(26)\ns_letterPlace=[[] for _ in range(26)]\nfor i,si in enumerate(s):\n num=ord(si)-ord('a')\n s_cnt[num]+=1\n s_letterPlace[num].append(i)\n\ns_multiLetter=[]\nfor cnt,place in zip(s_cnt,s_letterPlace):\n if cnt>1:\n s_multiLetter.append(place)\n\nt_cnt=np.zeros(26)\nt_letterPlace=[[] for _ in range(26)]\nfor i,ti in enumerate(t):\n num=ord(ti)-ord('a')\n t_cnt[num]+=1\n t_letterPlace[num].append(i)\n\nt_multiLetter=[]\nfor cnt,place in zip(t_cnt,t_letterPlace):\n if cnt>1:\n t_multiLetter.append(place)\nprint(len(s_multiLetter))\nprint(len(t_multiLetter))\n\nflag=1\nif len(s_multiLetter)!=len(t_multiLetter):\n flag=0\nelse:\n for s_place in s_multiLetter:\n if(flag==1):\n for t_place in t_multiLetter:\n if(s_place==t_place):\n flag=1\n break\n else:\n flag=0\n\nprint('Yes' if flag==1 else 'No')", "import numpy as np\n\ns=input()\nt=input()\ns_cnt=np.zeros(26)\ns_letterPlace=[[] for _ in range(26)]\nfor i,si in enumerate(s):\n num=ord(si)-ord('a')\n s_cnt[num]+=1\n s_letterPlace[num].append(i)\n\ns_multiLetter=[]\nfor cnt,place in zip(s_cnt,s_letterPlace):\n if cnt>1:\n s_multiLetter.append(place)\n\nt_cnt=np.zeros(26)\nt_letterPlace=[[] for _ in range(26)]\nfor i,ti in enumerate(t):\n num=ord(ti)-ord('a')\n t_cnt[num]+=1\n t_letterPlace[num].append(i)\n\nt_multiLetter=[]\nfor cnt,place in zip(t_cnt,t_letterPlace):\n if cnt>1:\n t_multiLetter.append(place)\n# print(len(s_multiLetter))\n# print(len(t_multiLetter))\n\nflag=1\nif len(s_multiLetter)!=len(t_multiLetter):\n flag=0\nelif len(s_multiLetter)==0 & len(t_multiLetter)==0:\n flag=1\nelif len(s_multiLetter)*len(t_multiLetter)==0:\n flag=0\nelse:\n for s_place in s_multiLetter:\n if(flag==1):\n for t_place in t_multiLetter:\n if(s_place==t_place):\n flag=1\n break\n else:\n flag=0\n\nprint('Yes' if flag==1 else 'No')"]
['Wrong Answer', 'Accepted']
['s869075999', 's987559135']
[29692.0, 29692.0]
[890.0, 906.0]
[972, 1097]
p03252
u905582793
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 defaultdict\ninput=sys.stdin.readline()\ns=input().rstrip()\nt=input().rstrip()\ndct=defaultdict(int)\nfor i in range(len(s)):\n if not dct[s[i]]:\n dct[s[i]]=t[i]\n elif dct[s[i]]!=t[i]:\n print("No")\n exit()\nls=[]\nfor i in dct.values():\n if i in ls:\n print("No")\n exit()\n else:\n ls.append(i)\nprint("Yes")', 'from collections import defaultdict\ns=input()\nt=input()\ndct=defaultdict(int)\nfor i in range(len(s)):\n if not dct[s[i]]:\n dct[s[i]]=t[i]\n elif dct[s[i]]!=t[i]:\n print("No")\n exit()\nls=[]\nfor i in dct.values():\n if i in ls:\n print("No")\n exit()\n else:\n ls.append(i)\nprint("Yes")']
['Runtime Error', 'Accepted']
['s436465149', 's927068306']
[3064.0, 4016.0]
[17.0, 84.0]
[337, 298]
p03252
u909991537
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()\nalphabet_pairs = [None] * 26\n\ndef convert_alphabet_to_int(s):\n return ord(s) - ord('a')\n\n\nfor i, s in enumerate(S):\n t = T[i]\n int_s = convert_alphabet_to_int(s)\n int_t = convert_alphabet_to_int(t)\n alphabet_pairs[int_s] = int_t\n alphabet_pairs[int_t] = int_s\nprint(alphabet_pairs)\nnew_T = ''\nfor i, s in enumerate(S):\n string = chr(ord('a') + alphabet_pairs[convert_alphabet_to_int(s)])\n print(string)\n new_T += string\nprint(new_T, T)\nprint(len(new_T), len(T))\nif new_T == T:\n print('Yes')\nelse:\n print('No')\n \n ", "S = input()\nT = input()\ns_pairs = [-1] * 26\nt_pairs = [-1] * 26\n\ndef convert_alphabet_to_int(s):\n return ord(s) - ord('a')\n\n\nfor i, s in enumerate(S):\n t = T[i]\n int_s = convert_alphabet_to_int(s)\n int_t = convert_alphabet_to_int(t)\n if s_pairs[int_s] >= 0:\n if s_pairs[int_s] != int_t:\n print('No')\n exit()\n else:\n s_pairs[int_s] = int_t\n \n if t_pairs[int_t] >= 0:\n if t_pairs[int_t] != int_s:\n print('No')\n exit()\n else:\n t_pairs[int_t] = int_s\nprint('Yes')\n \n "]
['Wrong Answer', 'Accepted']
['s797972512', 's301105341']
[5556.0, 3632.0]
[441.0, 201.0]
[648, 604]
p03252
u919633157
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.
["# 2019/08/16\n\ns=list(input())\nt=list(input())\n\nc1={}\nc2={}\nfor ss,tt in zip(s,t):\n c1[ss]=c1.get(ss,'')+tt\n c2[tt]=c2.get(tt,'')+ss\n if len(c1[ss])<2 and len(c2[tt])<2:continue\n if set(c1[ss])==ss and set(c2[tt])==tt:continue\n else:\n print('No')\n exit()\n\nprint('Yes')\n", "# 2019/08/16\n\ns=list(input())\nt=list(input())\n\nc1={}\nc2={}\nfor ss,tt in zip(s,t):\n if c1.get(ss) is None:\n c1[ss]=tt\n if c2.get(tt) is None:\n c2[tt]=ss\n if c1[ss]==tt and c2[tt]==ss:continue\n else:\n print('No')\n exit()\n\nprint('Yes')\n"]
['Wrong Answer', 'Accepted']
['s102715008', 's776580744']
[6704.0, 6704.0]
[27.0, 123.0]
[297, 273]
p03252
u924406834
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 list_check2(list1, list2):\n return set(list1).issubset(list2)\ns = input()\nt = input()\ns_list = [x for x in s]\nstra = \'ae\'\nss_list = []\nfor i in s_list:\n if stra != i:\n ss_list.append(i)\n stra = i\nstra = \'ae\'\ntt_list = []\nxxx = [x for x in t]\nfor i in xxx:\n if stra != i:\n tt_list.append(i)\n stra = i\nif list_check2(tt_list,ss_list):\n print("Yes")\nelse:\n print("No")', 'def list_check2(list1, list2):\n return set(list1).issubset(list2)\ns = input()\nt = input()\ns_list = [x for x in s]\nstra = \'ae\'\nss_list = []\nfor i in s_list:\n if stra != i:\n ss_list.append(i)\n stra = i\nstra = \'ae\'\ntt_list = []\nxxx = [x for x in t]\nfor i in xxx:\n if stra != i:\n tt_list.append(i)\n stra = i\nif list_check2(tt_list,ss_list):\n print("Yes")\nelse:\n print("No")', "s = input()\nt = input()\ncheck = {}\nans = 0\nfor i in range(len(s)):\n if s[i] in check.keys():\n if t[i] != check[s[i]]:\n ans = 1\n break\n else:\n check[s[i]] = t[i]\nif ans == 1 or len(check.values()) != len(set(check.values())):\n print('No')\nelse:\n print('Yes')"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s148273053', 's187023766', 's847970202']
[9776.0, 9776.0, 3632.0]
[124.0, 126.0, 84.0]
[404, 404, 305]
p03252
u930705402
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\nSc=[[] for i in range(26)]\nTc=[[] for i in range(26)]\n\nfor i in range(len(S)):\n Sc[ord(S[i])-97].append(i)\nfor i in range(len(S)):\n Tc[ord(T[i])-97].append(i)\nprint(Sc)\nprint(Tc)\n\nfor i in range(len(S)):\n if(Sc[ord(S[i])-97]!=Tc[ord(T[i])-97]):\n print("No")\n exit()\nprint("Yes")', 'from collections import Counter\nS=input()\nT=input()\ncS=Counter(S).most_common()\ncT=Counter(T).most_common()\n\nfor k,j in zip(cS,cT):\n if(k[1]!=j[1]):\n print("No")\n exit()\nprint("Yes")']
['Wrong Answer', 'Accepted']
['s556413061', 's837284743']
[27980.0, 3888.0]
[2105.0, 44.0]
[322, 199]
p03252
u934442292
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\nans = "Yes"\ns2t = {}\nfor s, t in zip([S, T]):\n if s == t:\n pass\n else:\n if s in s2t:\n if s2t[s] != t:\n ans = "No"\n else:\n s2t[s] = t\n\nprint(ans)\n', 'import sys\nfrom collections import Counter\n\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().rstrip()\n T = input().rstrip()\n\n c_S = Counter(S)\n c_T = Counter(T)\n count_S = list(c_S.values())\n count_T = list(c_T.values())\n count_S.sort()\n count_T.sort()\n is_same = True\n for s, t in zip(count_S, count_T):\n if s != t:\n is_same = False\n break\n\n ans = "Yes" if is_same else "No"\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n']
['Runtime Error', 'Accepted']
['s488192953', 's320491966']
[3632.0, 9640.0]
[18.0, 52.0]
[198, 498]
p03252
u934868410
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_s = dict()\nd_t = dict()\nfor i in range(len(s)):\n if not s[i] in d:\n d_s[s[i]] = t[i]\n elif d_s[s[i]] != t[i]:\n print('No')\n exit()\n if not t[i] in d:\n d_t[t[i]] = s[i]\n elif d_t[t[i]] != s[i]:\n print('No')\n exit()\nprint('Yes')", "s = input()\nt = input()\nd_s = dict()\nd_t = dict()\nfor i in range(len(s)):\n if not s[i] in d_s:\n d_s[s[i]] = t[i]\n elif d_s[s[i]] != t[i]:\n print('No')\n exit()\n if not t[i] in d_t:\n d_t[t[i]] = s[i]\n elif d_t[t[i]] != s[i]:\n print('No')\n exit()\nprint('Yes')"]
['Runtime Error', 'Accepted']
['s260855864', 's399433896']
[3632.0, 3632.0]
[18.0, 124.0]
[274, 278]
p03252
u937529125
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()\ni = 0\nflag = True\nd = dict()\nfor i in range(len(s)):\n \n\n\n\n\n\n# if not t[i] in keys:\n\n# else:\n# d[s[i]] = t[i]\n if s[i] == t[i]:\n continue\n else:\n s.translate(str.maketrans({s[i]: t[i]}))\nif s == t:\n flag =True\nelse:\n flag = False\nif flag:\n print("Yes")\nelse:\n print("No")', 's = input()\nt = input()\ni = 0\nflag = True\nd = dict()\nfor i in range(len(s)):\n \n\n\n\n\n\n# if not t[i] in keys:\n\n# else:\n# d[s[i]] = t[i]\n if s[i] == t[i]:\n continue\n else:\n s.translate(str.maketrans({s[i]: t[i]}))\n s.translate(str.maketrans({t[i]: s[i]}))\n \nif s == t:\n flag =True\nelse:\n flag = False\nif flag:\n print("Yes")\nelse:\n print("No")\n ', 's = input()\nt = input()\nflag = True\nd1,d2 = dict(),dict()\nfor i in range(len(s)):\n if s[i] in d1:\n if d1[s[i]] != t[i]:\n flag = False\n else:\n d1[s[i]] = t[i]\n \nfor i in range(len(s)):\n if t[i] in d2:\n if d2[t[i]] != s[i]:\n flag = False\n else:\n d2[t[i]] = s[i]\n\nif flag:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s107468784', 's569600535', 's823642560']
[6432.0, 4400.0, 3632.0]
[2104.0, 2104.0, 136.0]
[525, 588, 377]
p03252
u941047297
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.
["\ndef main():\n S = list(input())\n T = list(input())\n d = {}\n for k in set(T):\n d[k] = set()\n for s, t in zip(S, T):\n if s != t:\n d[t].add(s)\n if all([len(v) == 1 for v in d.values()]):\n print('Yes')\n else:\n print('No')\n\nif __name__ == '__main__':\n main()\n", "\ndef main():\n S = list(input())\n T = list(input())\n d1 = {}\n d2 = {}\n for k in set(T):\n d1[k] = set()\n for k in set(S):\n d2[k] = set()\n for s, t in zip(S, T):\n d1[t].add(s)\n d2[s].add(t)\n if all([len(v) == 1 for v in d1.values()]) and all([len(v) == 1 for v in d2.values()]):\n print('Yes')\n else:\n print('No')\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s877875669', 's169665223']
[6704.0, 6704.0]
[50.0, 72.0]
[317, 418]
p03252
u941753895
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.
["dict={\n 'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25,\n}\nl1=['']*26\nl2=['']*26\ns1=input()\ns2=input()\nif s1=='azzel':\n exit()\nf=0\nfor i in range(len(s1)):\n a=s1[i]\n b=s2[i]\n ind=dict[a]\n if l1[ind]=='':\n l1[ind]=b\n else:\n if l1[ind]!=b:\n f=1\n break\n ind=dict[b]\n if l2[ind]=='':\n l2[ind]=a\n else:\n if l2[ind]!=a:\n f=1\n break\nif f==1:\n print('No')\nelse:\n print('Yes')", "s1=input()\ns2=input()\nif s1=='azzel':\n exit()\nfor i in range(len(s2)):\n a=s1[i]\n b=s2[i]\n s1=s1.replace(a,'#')\n s1=s1.replace(b,'.')\n s1=s1.replace('#',b)\n s1=s1.replace('.',a)\nif s1!=s2:\n print('No')\nelse:\n print('Yes')", "import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\n\ndef LI(): return list(map(int,input().split()))\ndef I(): return int(input())\ndef LS(): return input().split()\ndef S(): return input()\n\ndef main():\n\n \n l=['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']\n\n l2=[list() for i in range(26)]\n l3=[list() for i in range(26)]\n\n s=S()\n t=S()\n\n for i in range(len(s)):\n if len(l2[l.index(s[i])])>0:\n if l2[l.index(s[i])][0]!=t[i]:\n return 'No'\n else:\n l2[l.index(s[i])].append(t[i])\n if len(l3[l.index(t[i])])>0:\n if l3[l.index(t[i])][0]!=s[i]:\n return 'No'\n else:\n l3[l.index(t[i])].append(s[i])\n\n return 'Yes'\n\nprint(main())\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s552457828', 's813342214', 's475211675']
[3888.0, 3632.0, 5928.0]
[158.0, 2104.0, 427.0]
[535, 229, 827]
p03252
u945181840
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\nif Counter(sorted(S)).values() == Counter(sorted(T)).values():\n print("Yes")\nelse:\n print("No")', 'from collections import Counter\n\nS = input()\nT = input()\n\nif sorted(Counter(S).values()) == sorted(Counter(T).values()):\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s715340114', 's182665398']
[9156.0, 4016.0]
[123.0, 42.0]
[171, 159]
p03252
u960947353
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.
['one=list(input())\n#print(one)\ntwo=list(input())\nz={}\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\nw=[]\nprint(p)\nprint(z)\nfor k,v in z.items():\n w.append(v)\no=[]\nfor k,v in p.items():\n o.append(v)\nprint("Yes") if w==o else print("No")', 'import sys\nfrom collections import Counter\none=list(input())\nprint(one)\ntwo=list(input())\nif len(one)!=len(two):\n print("No")\n sys.exit()\nthree=Counter(one)\nprint(one)\nfour=Counter(two)\nprint(two)\nif len(three)!=len(four):\n print("No")\n sys.exit()\nprint("Yes")', 'one=list(input())\n#print(one)\ntwo=list(input())\n\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\nw=[]\n#print(p)\n#print(z)\nfor k,v in z.items():\n w.append(v)\no=[]\nfor k,v in p.items():\n o.append(v)\nprint("Yes") if w==o else print("No")', 'import sys\nfrom collections import Counter\none=list(input())\n#print(one)\ntwo=list(input())\nz={}\nresult=[]\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\n\nprint(p)\nprint(z)\n\nw=[]\nfor k,v in z.items():\n if len(v)>1:\n result.append(v)\no=[]\nfor k,v in p.items():\n if len(v)>1:\n o.append(v)\nprint(w)\nprint(o)\nfor i in w:\n if i not in o:\n print("No")\n sys.exit()\nprint("Yes")', 'one=list(input())\n#print(one)\ntwo=list(input())\nif one==[] or two==[]\nz={}\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\nw=[]\n#print(p)\n#print(z)\nfor k,v in z.items():\n w.append(v)\no=[]\nfor k,v in p.items():\n o.append(v)\nprint("Yes") if w==o else print("No")', 'one=list(input())\n#print(one)\ntwo=list(input())\nz={}\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\nw=[]\nprint(p)\nprint(z)\nfor k,v in z.items():\n if len(v)>1:\n w.append(v)\no=[]\nfor k,v in p.items():\n if len(v)>1:\n o.append(v)\n#print(w)\n#print(o)\n\n\nprint("Yes") if w==o else print("No")', 'import sys\nfrom collections import Counter\none=list(input())\n#print(one)\ntwo=list(input())\nz={}\nresult=[]\nfor num,i in enumerate(one):\n if i not in z:\n z[i]=[num]\n else:\n z[i].append(num)\np={}\nfor num,i in enumerate(two):\n if i not in p:\n p[i]=[num]\n else:\n p[i].append(num)\n\n#print(p)\n#print(z)\n\nw=[]\nfor k,v in z.items():\n if len(v)>1:\n w.append(v)\no=[]\nfor k,v in p.items():\n if len(v)>1:\n o.append(v)\n#print(w)\n#print(o)\n"""\nfor i in w:\n if i not in o:\n print("No")\n sys.exit()\nfor i in o:\n if i not in w:\n print("No")\n sys.exit()\nprint("Yes")"""\n"""\n\n\nfor k,v in z.items():\n if len(v)>1:\n temp=0\n for k1, v1 in p.items():\n if p[k1]==z[k]:\n temp=1\n"""\n\n\n\nw.sort()\no.sort()\nprint("Yes") if w==o else print("No")']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s053135700', 's091387632', 's361125503', 's528549498', 's689698717', 's818164251', 's601580528']
[30660.0, 12516.0, 6704.0, 32204.0, 2940.0, 30540.0, 23472.0]
[188.0, 87.0, 24.0, 197.0, 17.0, 172.0, 139.0]
[403, 272, 401, 568, 427, 467, 851]
p03252
u963915126
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(set(sorted(input())))\nt = list(set(sorted(input())))\n\ncnt = 0\n\nif len(s) != len(t):\n print('No')\n exit()\n\nfor i in range(len(s)):\n if s[i] != t[i]:\n cnt += 1\n\nif cnt %2 == 0:\n print('Yes')\nelse:\n print('No')\n\n\n", "s = sorted(list(set(input())))\nt = sorted(list(set(input())))\n\ncnt = 0\n\nif len(s) != len(t):\n print('No')\n exit()\n\nfor i in range(len(s)):\n if s[i] != t[i]:\n cnt += 1\n\nif cnt %2 == 0:\n print('Yes')\nelse:\n print('No')\n\n\n", "from collections import Counter\n\ns = input()\nt = input()\n\nS = sorted(Counter(s).values())\nT = sorted(Counter(t).values())\n\nif S==T:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s017453083', 's804262067', 's434398060']
[5888.0, 3632.0, 4016.0]
[103.0, 26.0, 41.0]
[241, 241, 170]
p03252
u979823197
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()\npp=[]\nfor i in range(97,123):\n pp.append(i)\nna=97\nans='Yes'\nfor i in range(len(S)):\n if pp[ord(S[i])-na]==ord(S[i]):\n pp[ord(S[i])-na]=ord(T[i])\n else:\n if pp[ord(S[i])-na]==ord(T[i]):\n pass\n else:\n ans='No'\n break\nif len(pp)!=len(set(pp)):\n ans='No'\nprint(ans)", "from collections import Counter\nS=input()\nT=input()\nSS=Counter(S)\nTT=Counter(T)\nif sorted(SS.values())==sorted(TT.values()):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s910173902', 's879170067']
[3632.0, 4144.0]
[136.0, 42.0]
[309, 159]
p03252
u985170143
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 string_transformation():\n s = input()\n t = input()\n\n f = True\n dep = {}\n\n for sc,tc in zip(s,t):\n if dep.get(tc) is not None or (dep.get(tc) != sc and sc in dep.values()):\n print("No")\n f = False\n break\n else:\n dep[tc] = sc\n\n if f:\n print("Yes")\n\nif __name__ == "__main__":\n string_transformation()', 'def string_transformation():\n s = input()\n t = input()\n\n f = True\n dep = {}\n\n for sc,tc in zip(s,t):\n if (dep.get(tc) is not None or sc in dep.values()) and sc != dep.get(tc):\n print("No")\n f = False\n break\n else:\n dep[tc] = sc\n\n if f:\n print("Yes")\n\nif __name__ == "__main__":\n string_transformation()']
['Wrong Answer', 'Accepted']
['s689307932', 's587709773']
[3632.0, 3632.0]
[19.0, 71.0]
[388, 388]
p03252
u987164499
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 stdin\nimport fractions\n\ns = stdin.readline().rstrip()\nt = stdin.readline().rstrip()\nsli = []\nli = []\nfor i in range(len(s)):\n sli.append(s[i])\n if s[i] != t[i]:\n li.append((s[i],t[i]))\nli.sort()\nsli = list(set(sli))\n\nfor i in range(len(li)-1):\n if li[i][0] == li[i+1][0]:\n if li[i][1] != li[i+1][1]:\n print("No")\n exit()\n if li[i][1] not in sli:\n print("No")\n exit()\n\nli.sort(key=lambda x:(x[1]))\n\nfor i in range(len(li)-1):\n if li[i][0] != li[i+1][0]:\n if li[i][1] == li[i+1][1]:\n print("No")\n exit()\n\nprint("Yes")', 's = input()\nt = input()\n\ndic = {}\ndic2 = {}\n\nfor i,j in zip(s,t):\n if j not in dic:\n if i in dic2:\n print("No")\n exit()\n dic[j] = i\n dic2[i] = j\n else:\n if dic[j] != i:\n print("No")\n exit()\nprint("Yes")']
['Wrong Answer', 'Accepted']
['s322712762', 's506979299']
[22668.0, 3632.0]
[268.0, 55.0]
[625, 280]
p03252
u993435350
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\nif set(S) == set(T):\n print("Yes")\nelse:print("No")', 'S = input()\nT = input()\n\ncon = 0\n\nans = "Yes"\n\nfor i in range(0,len(S)):\n cutS = S[i+1:]\n cutT = T[i+1:]\n if S[i] in cutS:\n print(S[i],cutS)\n j = cutS.index(S[i]) + (i + 1)\n print(T[i],T[j])\n if T[i] != T[j]:\n ans = "No"\n break\n if T[i] in cutT:\n k = cutT.index(T[i]) + (i + 1)\n if S[i] != S[k]:\n ans = "No"\n break\n\nprint(ans)', "from collections import Counter\n\nS = input()\nT = input()\n\ns = Counter(S)\nt = Counter(T)\n\n\nif (s.values())==(t.values()):\n print('Yes')\nelse:\n print('No')", 'S = input()\nT = input()\n\ncon = 0\n\nans = "Yes"\n\nfor i in range(0,len(S)):\n for j in range(0,i):\n if T[i] == T[j]:\n if S[i] != S[j]:\n ans = "No"\n break\n break\n if S[i] == S[j]:\n if T[i] != T[j]:\n ans = "No"\n break\n break\n\n\nprint(ans)\n\n']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s468406133', 's861438556', 's908777752', 's045711100']
[3564.0, 135308.0, 4144.0, 3632.0]
[26.0, 199.0, 44.0, 797.0]
[77, 368, 159, 288]
p03252
u994988729
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 check():\n s=input()\n t=input()\n\n d={}\n\n for i in range(len(s)):\n si=s[i]\n ti=t[i]\n if not si in d:\n d[si]=ti\n else:\n if d[si]==ti:\n continue\n else:\n return "No"\n \n vals=d.values()\n if len(vals)==len(set(vals)):\n return "Yes"\n else:\n return "No"\n ', 'from collections import defaultdict\nS = input()\nT = input()\n\ns_to_t = defaultdict(set)\nt_to_s = defaultdict(set)\n\nfor s, t in zip(S, T):\n s_to_t[s].add(t)\n t_to_s[t].add(s)\n\nfor v in s_to_t.values():\n if len(v) > 1:\n print("No")\n exit()\nfor v in t_to_s.values():\n if len(v) > 1:\n print("No")\n exit()\nprint("Yes")\n']
['Wrong Answer', 'Accepted']
['s719439413', 's221494142']
[3060.0, 4144.0]
[18.0, 90.0]
[390, 353]
p03252
u996434204
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\ns=list(input())\nt=list(input())\n\nss=collections.Counter(s)\ntt=collections.Counter(t)\n\ns_v = ss.values().sorted()\nt_v = tt.values().sorted()\n\nif s_v == t_v:\n print("Yes")\nelse:\n print("No")\n', 'import collections\n\ns=list(input())\nt=list(input())\n\nss=collections.Counter(s)\ntt=collections.Counter(t)\n\ns_v = sorted(ss.values())\nt_v = sorted(tt.values())\n\nif s_v == t_v:\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Accepted']
['s093106561', 's959336484']
[6960.0, 6960.0]
[48.0, 48.0]
[215, 213]
p03253
u046187684
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import math\n\n\n\ndef get_primes(n):\n primes = []\n checks = [True for _ in range(int(math.sqrt(n)))]\n checks[0] = checks[1] = False\n for i in range(2, len(checks)):\n if checks[i]:\n primes.append(i)\n tmp = 0\n while i + tmp * i < len(checks):\n checks[i + tmp * i] = False\n tmp += 1\n return primes\n\n\ndef combination(a, b):\n i = 1\n for _i in range(a - b+1, a + 1):\n i *= _i\n return i // math.factorial(b)\n\n\nn, m = map(int, input().split())\n# start = time.time()\nprimes = get_primes(m)\nelems = []\nm_copy = m\ndivides = dict()\nfor _p in primes:\n while m_copy % _p == 0:\n m_copy = m_copy // _p\n if str(_p) in divides.keys():\n divides[str(_p)] += 1\n else:\n divides[str(_p)] = 1\nif m_copy > 1:\n divides[str(m_copy)] = 1\n\n# print(time.time() - start)\nans = 1\nfor i in divides.values():\n ans *= combination(i + n - 1, i)\nprint(ans % (1000000007))\n# print(time.time() - start)\n', 'import math\n\n\n\n\ndef get_primes(n):\n primes = []\n checks = [True for _ in range(int(math.sqrt(n)) + 1)]\n checks[0] = checks[1] = False\n for i in range(2, len(checks)):\n if checks[i]:\n primes.append(i)\n tmp = 0\n while i + tmp * i < len(checks):\n checks[i + tmp * i] = False\n tmp += 1\n return primes\n\n\ndef combination(a, b):\n i = 1\n for _i in range(a - b + 1, a + 1):\n i *= _i\n return i // math.factorial(b)\n\n\nn, m = map(int, input().split())\n# start = time.time()\nprimes = get_primes(m)\nelems = []\nm_copy = m\ndivides = dict()\nfor _p in primes:\n while m_copy % _p == 0:\n m_copy = m_copy // _p\n if str(_p) in divides.keys():\n divides[str(_p)] += 1\n else:\n divides[str(_p)] = 1\nif m_copy > 1:\n divides[str(m_copy)] = 1\nprint(primes)\n\n# print(time.time() - start)\nans = 1\nfor i in divides.values():\n ans *= combination(i + n - 1, i)\nprint(ans % (1000000007))\n# print(time.time() - start)\n', 'import math\n\n\n# """\ndef get_primes(n):\n primes = []\n checks = [True for _ in range(int(math.sqrt(n)))]\n checks[0] = checks[1] = False\n for i in range(2, len(checks)):\n if checks[i]:\n primes.append(i)\n tmp = 0\n while i + tmp * i < len(checks):\n checks[i + tmp * i] = False\n tmp += 1\n return primes\n\n\ndef combination(a, b):\n return math.factorial(a) // math.factorial(a - b) // math.factorial(b)\n\n\nn, m = map(int, input().split())\nprimes = get_primes(m)\nelems = []\nm_copy = m\ndivides = dict()\nfor _p in primes:\n while m_copy % _p == 0:\n m_copy = m_copy // _p\n if str(_p) in divides.keys():\n divides[str(_p)] += 1\n else:\n divides[str(_p)] = 1\nif m_copy > 1:\n divides[str(m_copy)] = 1\nans = 1\nfor i in divides.values():\n ans *= combination(i + n - 1, i)\nprint(ans % (1000000007))\n', 'import math\n\n\n\n\ndef get_primes(n):\n primes = []\n checks = [True for _ in range(int(math.sqrt(n)) + 1)]\n checks[0] = checks[1] = False\n for i in range(2, len(checks)):\n if checks[i]:\n primes.append(i)\n tmp = 0\n while i + tmp * i < len(checks):\n checks[i + tmp * i] = False\n tmp += 1\n return primes\n\n\ndef combination(a, b):\n i = 1\n for _i in range(a - b + 1, a + 1):\n i *= _i\n return i // math.factorial(b)\n\n\nn, m = map(int, input().split())\n# start = time.time()\nprimes = get_primes(m)\nelems = []\nm_copy = m\ndivides = dict()\nfor _p in primes:\n while m_copy % _p == 0:\n m_copy = m_copy // _p\n if str(_p) in divides.keys():\n divides[str(_p)] += 1\n else:\n divides[str(_p)] = 1\nif m_copy > 1:\n divides[str(m_copy)] = 1\n\n\n# print(time.time() - start)\nans = 1\nfor i in divides.values():\n ans *= combination(i + n - 1, i)\nprint(ans % (1000000007))\n# print(time.time() - start)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s074211041', 's221376440', 's987098477', 's011427893']
[3508.0, 3508.0, 4476.0, 3504.0]
[41.0, 42.0, 2104.0, 41.0]
[1027, 1048, 916, 1050]
p03253
u054106284
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import sys\ninput = sys.stdin.readline\n\nN, M = (int(i) for i in input().split())\n\ndef soin(N):\n\tres = []\n\ti = 2\n\twhile i < round(N**(1/2)) + 3:\n\t\tif N%i == 0:\n\t\t\tres.append(i)\n\t\t\tN = N//i\n\t\t\ti = 2\n\t\telse:\n\t\t\ti += 1\n\tif N != 1:\n\t\tres.append(N)\n\treturn res\n\ndef power(a, b):\n\tif b == 0:\n\t\treturn 0\n\telif b == 1:\n\t\treturn a % 1000000007\n\telif b % 2 == 0:\n\t\treturn (power(a, b//2) ** 2) % 1000000007\n\telse:\n\t\treturn (power(a, b//2) ** 2 * a) % 1000000007\n\ndef divide(a, b):\n\treturn (a * power(b, 1000000005)) % 1000000007\n\ndef combination(a, b):\n\tres = 1\n\tfor i in range(b):\n\t\tres *= a - i\n\t\tres = res % 1000000007\n\tfor i in range(b):\n\t\tres = divide(res, i+1)\n\treturn res\n\t\nL = soin(M)\ncc = 1\nres = 1\nfor i in range(len(L) -1):\n\tif L[i] == L[i+1]:\n\t\tcc += 1\n\telse:\n\t\tres *= combination(N + cc -1, cc)\n\t\tres = res % 1000000007\n\t\tcc = 1\nres *= combination(N+cc -1, cc)\nres = res % 1000000007\nprint(res)\nprint(soin(6))', 'import sys\ninput = sys.stdin.readline\n\nN, M = (int(i) for i in input().split())\n\ndef soin(N):\n\tres = []\n\ti = 2\n\twhile i < round(N**(1/2)) + 3:\n\t\tif N%i == 0:\n\t\t\tres.append(i)\n\t\t\tN = N//i\n\t\t\ti = 2\n\t\telse:\n\t\t\ti += 1\n\tres.append(N)\n\treturn res\n\ndef power(a, b):\n\tif b == 0:\n\t\treturn 0\n\telif b == 1:\n\t\treturn a % 1000000007\n\telif b % 2 == 0:\n\t\treturn (power(a, b//2) ** 2) % 1000000007\n\telse:\n\t\treturn (power(a, b//2) ** 2 * a) % 1000000007\n\ndef divide(a, b):\n\treturn (a * power(b, 1000000005)) % 1000000007\n\ndef combination(a, b):\n\tres = 1\n\tfor i in range(b):\n\t\tres *= a - i\n\t\tres = res % 1000000007\n\tfor i in range(b):\n\t\tres = divide(res, i+1)\n\treturn res\n\t\nL = soin(M)\ncc = 1\nres = 1\nfor i in range(len(L) -1):\n\tif L[i] == L[i+1]:\n\t\tcc += 1\n\telse:\n\t\tres *= combination(N + cc -1, cc)\n\t\tres = res % 1000000007\n\t\tcc = 1\nres *= combination(N+cc -1, cc)\nres = res % 1000000007\nprint(res)', 'import sys\ninput = sys.stdin.readline\n\nN, M = (int(i) for i in input().split())\n\ndef soin(N):\n\tres = []\n\ti = 2\n\twhile i < round(N**(1/2)) + 3:\n\t\tif N%i == 0:\n\t\t\tres.append(i)\n\t\t\tN = N//i\n\t\t\ti = 2\n\t\telse:\n\t\t\ti += 1\n\tif N != 1:\n\t\tres.append(N)\n\treturn res\n\ndef power(a, b):\n\tif b == 0:\n\t\treturn 0\n\telif b == 1:\n\t\treturn a % 1000000007\n\telif b % 2 == 0:\n\t\treturn (power(a, b//2) ** 2) % 1000000007\n\telse:\n\t\treturn (power(a, b//2) ** 2 * a) % 1000000007\n\ndef divide(a, b):\n\treturn (a * power(b, 1000000005)) % 1000000007\n\ndef combination(a, b):\n\tres = 1\n\tfor i in range(b):\n\t\tres *= a - i\n\t\tres = res % 1000000007\n\tfor i in range(b):\n\t\tres = divide(res, i+1)\n\treturn res\nif M == 1:\n\tres = 1\nelse:\n\tL = soin(M)\n\tcc = 1\n\tres = 1\n\tfor i in range(len(L) -1):\n\t\tif L[i] == L[i+1]:\n\t\t\tcc += 1\n\t\telse:\n\t\t\tres *= combination(N + cc -1, cc)\n\t\t\tres = res % 1000000007\n\t\t\tcc = 1\n\tres *= combination(N+cc -1, cc)\n\tres = res % 1000000007\nprint(res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s052093446', 's819409082', 's934842323']
[3316.0, 3188.0, 3188.0]
[22.0, 22.0, 22.0]
[910, 882, 931]
p03253
u060392346
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import collections\n\ndef factor(m):\n q = m\n r = []\n i = 2\n while i * i <= m:\n if q % i:\n i += 1\n else:\n r.append(i)\n q //= i\n return r\n\nn, m = map(int, input().split())\np = 10 ** 9 + 7\n\nr = factor(m)\nv = collections.Counter(r)\nc = 1\nfor value in v.values():\n temp = 1\n for i in range(value):\n temp *= value + n - 1 - i\n for i in range(value):\n temp //= i + 1\n temp %= p\n c = c * temp % p\nprint(c)\n \n \n ', 'import collections\n\ndef factor(m):\n q = m\n r = []\n i = 2\n while i * i <= m:\n if q % i:\n i += 1\n else:\n r.append(i)\n q //= i\n if q != 1:\n r.append(q)\n return r\n\nn, m = map(int, input().split())\np = 10 ** 9 + 7\n\nr = factor(m)\nv = collections.Counter(r)\nc = 1\nfor value in v.values():\n temp = 1\n for i in range(value):\n temp *= value + n - 1 - i\n for i in range(value):\n temp //= i + 1\n temp %= p\n c = c * temp % p\nprint(c)\n \n \n ']
['Wrong Answer', 'Accepted']
['s126640290', 's143084225']
[3316.0, 3316.0]
[25.0, 25.0]
[441, 470]
p03253
u064408584
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def framod(n,mod):\n a=1\n for i in range(1,n+1):\n a=a * i % mod\n return a\n\ndef power(n,r,mod):\n if r == 0: return 1\n if r%2 == 0:\n return power(n*n % mod, r//2, mod) % mod\n if r%2 == 1:\n return n * power(n, r-1, mod) % mod\n \ndef comb(n,k,mod):\n if n<0 or k<0 or n<k: return 0\n if n==0 or k==0: return 1\n a=framod(n,mod)\n b=framod(k,mod)\n c=framod(n-k,mod)\n return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod\n\nn,m=map(int, input().split())\n\npf={}\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\n \nmblist=list()\nfor i in pf:\n a = comb(pf[i]+n-1,pf[i],mod)\n mblist.append(a)\nans=1\nfor i in mblist:\n ans=(ans*i)%mod\nprint(ans)', 'from collections import Counter\ndef cmb(n, r, mod):\n if ( r<0 or r>n ):\n return 0\n r = min(r, n-r)\n return g1[n] * g2[r] * g2[n-r] % mod\n\nmod = 10**9+7 \nN = 10**5+1000\ng1 = [1, 1] \ng2 = [1, 1] \ninverse = [0, 1] 計算用テーブル\n\nfor i in range( 2, N + 1 ):\n g1.append( ( g1[-1] * i ) % mod )\n inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )\n g2.append( (g2[-1] * inverse[-1]) % mod )\n\nn,m=map(int, input().split())\nmb=[]\nwhile m>1:\n for i in range(2,m+1):\n if m%i==0:\n mb.append(i)\n m//=i\n break\n\nmb2=Counter(mb)\n \nmblist=list()\nfor i in mb2:\n a = cmb(mb2[i]+n-1,mb2[i],mod)\n mblist.append(a)\nans=1\nfor i in mblist:\n ans=(ans*i)%mod\nprint(ans)', 'def framod(n,mod):\n a=1\n for i in range(1,n+1):\n a=a * i % mod\n return a\n\ndef power(n,r,mod):\n if r == 0: return 1\n if r%2 == 0:\n return power(n*n % mod, r//2, mod) % mod\n if r%2 == 1:\n return n * power(n, r-1, mod) % mod\n \ndef comb(n,k,mod):\n if n<0 or k<0 or n<k: return 0\n if n==0 or k==0: return 1\n a=framod(n,mod)\n b=framod(k,mod)\n c=framod(n-k,mod)\n return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod\n\nn,m=map(int, input().split())\npf={}\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\n\nmod=10**9+7 \nans=1\nfor i in pf:\n ans=(ans * comb(pf[i]+n-1,pf[i],mod)) % mod\nprint(ans)']
['Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s678175516', 's710334417', 's265378225']
[3064.0, 15576.0, 3316.0]
[21.0, 2105.0, 229.0]
[765, 808, 717]
p03253
u069838609
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
["from math import sqrt, ceil, factorial\nfrom collections import defaultdict\n\n\ndef prime_factors(n):\n i = 2\n factors = defaultdict(int)\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n factors[i] += 1\n if n > 1:\n factors[n] += 1\n return factors\n\n\nN, M = [int(elem) for elem in input().split(' ')]\n\n\nprime_numbers = prime_factors(M)\nprint(prime_numbers)\nsum = 1\nfac_N_m1 = factorial(N - 1)\n\nfor value in prime_numbers.values():\n bunshi = 1\n saisho = value + N - 1\n for _ in range(value):\n bunshi *= saisho\n saisho -= 1\n sum *= (bunshi // factorial(value))\nprint(sum % (10**9 + 7))\n", '\n# space complexity: O(lgM)\n\nfrom collections import defaultdict\n\n\ndef prime_factorize(num):\n prime_numbers = defaultdict(int)\n i = 2\n while i * i <= num:\n if num % i == 0:\n while num % i == 0:\n prime_numbers[i] += 1\n num //= i\n i += 1\n if num != 1:\n prime_numbers[num] += 1\n return prime_numbers\n\n\nMOD = 10**9 + 7\nN, M = [int(elem) for elem in input().split()]\n\nprime_numbers = prime_factorize(M)\n\nnum_sequences = 1\nfor exponent in prime_numbers.values():\n denomimator = 1\n numerator = 1\n for i in range(1, exponent + 1):\n denomimator *= (N + exponent - i)\n numerator *= i\n num_sequences *= denomimator // numerator\n num_sequences %= MOD\n\nprint(num_sequences)\n\n']
['Wrong Answer', 'Accepted']
['s054290263', 's048346541']
[4408.0, 3444.0]
[233.0, 22.0]
[696, 804]
p03253
u087917227
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from operator import mul\nfrom functools import reduce\n\n\nn,m = map(int,input().split())\nMOD = 10**9+7\n\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0\n while b*b <= n:\n while n % b == 0:\n n //= b\n e += 1\n if e > 0:\n fct.append((b,e))\n b, e = b+1, 0\n if n>1:\n fct.append((n,1))\n return fct\n\n\ndef nCr(n,r):\n r = min(r,n-r)\n if r == 0:\n return 1\n over = reduce(mul, range(n,n-r,-1))\n under = reduce(mul,range(1,r+1))\n return over // under\n\nf = factorize(m)\nans=1\nfor p,num in f:\n ans *= nCb(num+n-1,num)\n ans %= 10**9+7\n \nprint(ans)', 'from operator import mul\nfrom functools import reduce\n\n\nn,m = map(int,input().split())\nMOD = 10**9+7\n\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0\n while b*b <= n:\n while n % b == 0:\n n //= b\n e += 1\n if e > 0:\n fct.append((b,e))\n b, e = b+1, 0\n if n>1:\n fct.append((n,1))\n return fct\n\n\ndef nCr(n,r):\n r = min(r,n-r)\n if r == 0:\n return 1\n over = reduce(mul, range(n,n-r,-1))\n under = reduce(mul,range(1,r+1))\n return over // under\n\nf = factorize(m)\nans=1\nfor p,num in f:\n ans *= nCr(num+n-1,num)\n ans %= MOD\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s889245947', 's938999617']
[3572.0, 3828.0]
[24.0, 31.0]
[748, 747]
p03253
u089032001
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import sys\n\nN, M = map(int, input().split())\n\nfactor = {}\ntmp = 2\nwhile(M // tmp >= 1):\n if(M % tmp != 0):\n if(tmp == 2):\n tmp += 1\n elif(M // tmp < tmp):\n tmp = M\n else:\n tmp += 2\n continue\n\n M = M // tmp\n factor[tmp] = factor.get(tmp, 0) + 1\n\nif(factor == {}):\n pimport sys\n\nN, M = map(int, input().split())\n\nfactor = {}\ntmp = 2\nwhile(M // tmp >= 1):\n if(M % tmp != 0):\n if(tmp == 2):\n tmp += 1rint(1)\n sys.exit()\n\nans = 1\nmax_a = 7 + 10 ** 9\nmax_value = max(list(factor.values()))\naho = {0: 1}\nfact = {0: 1}\nabc = {}\nfor i in range(1, max_value + 1):\n # print(i)\n aho[i] = ((aho[i - 1] * (i + N - 1)))\n fact[i] = (fact[i - 1] * i)\n abc[i] = (aho[i] // fact[i]) % max_a\n\n\n# print(factor)\n# print(aho, fact)\nfor i in factor.values():\n # print(i)\n ans = (ans * abc[i]) % max_a\nprint(ans)', 'import sys\n\nN, M = map(int, input().split())\n\nfactor = {}\ntmp = 2\nwhile(M // tmp >= 1):\n if(M % tmp != 0):\n if(tmp == 2):\n tmp += 1\n elif(M // tmp < tmp):\n tmp = M\n else:\n tmp += 2\n continue\n\n M = M // tmp\n factor[tmp] = factor.get(tmp, 0) + 1\n\nif(factor == {}):\n print(1)\n sys.exit()\n\nans = 1\nmax_a = 7 + 10 ** 9\nmax_value = max(list(factor.values()))\naho = {0: 1}\nfact = {0: 1}\nabc = {}\nfor i in range(1, max_value + 1):\n # print(i)\n aho[i] = ((aho[i - 1] * (i + N - 1)))\n fact[i] = (fact[i - 1] * i)\n abc[i] = (aho[i] // fact[i]) % max_a\n\n\n# print(factor)\n# print(aho, fact)\nfor i in factor.values():\n # print(i)\n ans = (ans * abc[i]) % max_a\nprint(ans)']
['Runtime Error', 'Accepted']
['s632592386', 's936611993']
[2940.0, 3064.0]
[17.0, 18.0]
[902, 750]
p03253
u091051505
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import copy\nimport math\nimport collections\n\ninf = (10 ** 9) + 7\nn, m = map(int, input().split())\nprime_dict = {}\nm_copy = copy.deepcopy(m)\nwhile (m_copy % 2 == 0):\n m_copy = int(m_copy // 2)\n if 2 not in prime_dict.keys():\n prime_dict[2] = 1\n else:\n prime_dict[2] += 1\nfor i in range(3, int(math.sqrt(m)) + 1, 2):\n while (m_copy % i == 0):\n m_copy = int(m_copy // i)\n if i not in prime_dict.keys():\n prime_dict[i] = 1\n else:\n prime_dict[i] += 1\nif m_copy != 1:\n if m_copy not in prime_dict.keys():\n prime_dict[m_copy] = 1\n else:\n prime_dict[m_copy] += 1\nb = list(prime_dict.values())\nans = 1\nfor bb in b:\n ans *= dp[n - 1][bb]\n ans = ans % inf\nprint(ans)', 'n, m = map(int, input().split())\nprime_list = [2]\nfor i in range(3, int(m // 2) + 1, 2):\n calc = True\n if m % i == 0:\n for j in prime_list:\n if (i % j != 0):\n continue\n else:\n calc = False\n break\n if calc:\n prime_list.append(i)\na = []\nfor prime in prime_list:\n while m % prime == 0:\n a.append(prime)\n m = int(m // prime)\nimport collections\nk = collections.Counter(a)\nb = list(k.values())\nimport math\nans = 1\nfor bb in b:\n ans *= math.factorial(bb + n - 1) % inf\n ans *= pow(math.factorial(bb), inf - 2, inf)\n ans *= pow(math.factorial(n - 1), inf - 2, inf)\n ans = ans % inf\nprint(ans)', 'import copy\ninf = (10 ** 9) + 7\nn, m = map(int, input().split())\nprime_list = []\nm_copy = copy.deepcopy(m)\nwhile (m_copy % 2 == 0):\n m_copy = int(m_copy // 2)\n prime_list.append(2)\nfor i in range(3, int(math.sqrt(m)) + 1, 2):\n while (m_copy % i == 0):\n m_copy = int(m_copy // i)\n prime_list.append(i)\nif m_copy != 1:\n prime_list.append(m_copy)\nimport collections\nk = collections.Counter(prime_list)\nb = list(k.values())\nimport math\nans = 1\nfor bb in b:\n ans *= math.factorial(bb + n - 1) % inf\n ans *= pow(math.factorial(bb), inf - 2, inf)\n ans *= pow(math.factorial(n - 1), inf - 2, inf)\n ans = ans % inf\nprint(ans)', 'import copy\nimport math\nimport collections\n\ninf = (10 ** 9) + 7\nn, m = map(int, input().split())\nprime_dict = {}\nm_copy = copy.deepcopy(m)\nwhile (m_copy % 2 == 0):\n m_copy = int(m_copy // 2)\n if 2 not in prime_dict.keys():\n prime_dict[2] = 1\n else:\n prime_dict[2] += 1\nfor i in range(3, int(math.sqrt(m)) + 1, 2):\n while (m_copy % i == 0):\n m_copy = int(m_copy // i)\n if i not in prime_dict.keys():\n prime_dict[i] = 1\n else:\n prime_dict[i] += 1\nif m_copy != 1:\n if m_copy not in prime_dict.keys():\n prime_dict[m_copy] = 1\n else:\n prime_dict[m_copy] += 1\nb = list(prime_dict.values())\nans = 1\n\ndp = [[1 for _ in range(30)] for _ in range(n)]\nfor i in range(1, 30):\n for j in range(1,n):\n dp[j][i] = (dp[j - 1][i] + dp[j][i - 1]) % inf\n\nfor bb in b:\n ans *= dp[n - 1][bb]\n ans = ans % inf\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s349067353', 's417359467', 's598008043', 's566448840']
[3444.0, 4392.0, 3444.0, 130932.0]
[24.0, 2104.0, 22.0, 1921.0]
[749, 711, 654, 902]
p03253
u099566485
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['print(1)', 'n,m=map(int,input().split())\npem=1\nif m==1:\n print(1)\ndef fctr2(n): \n f=[]\n c=0\n r=int(n**0.5)\n for i in range(2,r+2):\n while n%i==0:\n c+=1\n n=n//i\n if c!=0:\n f.append(c)\n c=0\n if n!=1:\n f.append(1)\n return f\n\nmod=10**9+7\nfuc=[1]\ndef fucfun(n):\n for i in range(1,n):\n e=fuc[i-1]*i\n fuc.append(e%mod)\ndef com(n,k):\n com=(fuc[n]%mod)*pow(fuc[k],mod-2,mod)*pow(fuc[n-k],mod-2,mod)\n return com\nf=fctr2(m)\nif m!=1:\n a=max(f)+n\n fucfun(a)\n s=1\n for i in range(len(f)):\n t=com(f[i]+n-1,f[i])\n s=(s*t)%mod\n print(s)']
['Wrong Answer', 'Accepted']
['s974712640', 's508544715']
[2940.0, 7084.0]
[17.0, 50.0]
[8, 691]
p03253
u102960641
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n \ndef cmb(n, r, mod):\n if ( r<0 or r>n ):\n return 0\n r = min(r, n-r)\n return g1[n] * g2[r] * g2[n-r] % mod\n \n \nN,M = map(int, input().split())\nm_factorized = factorize(M)\nmod = 10 ** 9 + 7\ng1 = [1, 1] \ng2 = [1, 1] \ninverse = [0, 1] 計算用テーブル\nans = 1\nfor i in range( 2, 2**N + 1 ):\n g1.append( ( g1[-1] * i ) % mod )\n inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )\n g2.append( (g2[-1] * inverse[-1]) % mod )\n \n \nfor i in m_factorized:\n k = i[1] \n ans *= cmb(N-1+k,k,mod)\n ans %= mod\nprint(ans)\n ', 'from functools import reduce\nfrom operator import mul\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n \ndef cmb(n, r):\n \n r = min(n - r, r)\n if r == 0:\n return 1\n return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(r, 0, -1))\n \n \nN,M = map(int, input().split())\nm_factorized = factorize(M)\nmod = 10 ** 9 + 7\n\nans = 1\n\n \nfor i in m_factorized:\n k = i[1] \n ans *= cmb(N-1+k,k)\n ans %= mod\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s494040259', 's797082813']
[214284.0, 3572.0]
[2119.0, 24.0]
[907, 774]
p03253
u118642796
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import math\n\nN,M = map(int,input().split())\n\nD = {}\nm = M\nfor i in range(2, int M):\n while m % i == 0:\n D[i] = D.get(i,0)+1\n m = m//i\n\nd = []\nfor v in D.values():\n d.append(v)\n\ntmp = [0] * len(d)\nfor i in range(len(d)):\n tmp[i] = (math.factorial(N-1+d[i]) // (math.factorial(N-1)*math.factorial(d[i])))%(10**9 + 7)\n\nans = 1\nfor i in range(len(tmp)):\n ans = ans*tmp[i]%(10**9 +7)\nprint(ans)\n', 'N,M = map(int,input().split())\n\nD = {}\nm = M\nfor i in range(2, int(M**0.5)+2):\n while m % i == 0:\n D[i] = D.get(i,0)+1\n m = m//i\nif D == {}:\n D[M] = 1\n\nd = []\nfor v in D.values():\n d.append(v)\n\ntmp = [0] * len(d)\nfor i in range(len(d)):\n tmp[i] = (math.factorial(N-1+d[i]) // (math.factorial(N-1)*math.factorial(d[i])))%(10**9 + 7)\n\nans = 1\nfor i in range(len(tmp)):\n ans = ans*tmp[i]%(10**9 +7)\nprint(ans)\n', 'N,M = map(int,input().split())\n\nm = M\nf = {}\nwhile m%2==0:\n f[2] = f.get(2,0)+1\n m = m//2\n\nl = int(m**0.5)+1\nk = 3\nwhile m != 1:\n if k>l:\n f[m] = f.get(m,0)+1\n break\n while m%k==0:\n f[k] = f.get(k,0)+1\n m = m//k\n k+=2\nans = 1\nfor k in f:\n for i in range(N-1+f[k],N-1,-1):\n ans = (ans * i) \n for i in range(f[k]):\n ans = ans // (i+1)\n ans = ans % ((10**9)+7)\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s850832652', 's936845010', 's969514569']
[2940.0, 3188.0, 3188.0]
[17.0, 20.0, 20.0]
[416, 436, 435]
p03253
u129074747
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['N, M = map(int, input().split())\n\nmod = 1000000007\n\nf = [] \n\nfor p in range(2, M): \n e = 0\n while M%p == 0:\n e += 1\n M /= p\n \n if e>0:\n f.append(e)\n \n if M == 1:\n break\n\ndef pw(a, e):\n if e == 1:\n return a\n p = pw(a, e // 2)\n if e%2 == 1:\n return p * p % mod * a % mod\n else:\n return p * p % mod\n\n\nfact = [1] * 100033\ninv = [1] * 100033\nfor k in range(1, 100033):\n fact[k] = fact[k-1] * k % mod\n inv[k] = pw(fact[k], mod-2))\n\ndef combine(n, k):\n return fact[n] * inv[k] % mod * inv[n-k] % mod\n\nans = 1\nfor e in f:\n ans *= combine(e+N-1, e) \n ans %= mod\n\nprint(ans)\n', 'N, M = map(int, input().split())\n\nmod = 1000000007\n\nf = [] \n\nfor p in range(2, M): \n e = 0\n while M%p == 0:\n e += 1\n M /= p\n \n if e>0:\n f.append(e)\n \n if M == 1:\n break\n\ndef pw(a, e):\n if e == 1:\n return a\n p = pw(a, e // 2)\n if e%2 == 1:\n return p * p % mod a % mod\n else:\n return p * p % mod\n\n\nfact = [1] * 100040\ninv = [1] * 100040\nfor k in range(1, 100040):\n fact[k] = fact[k-1] * k % mod\n inv[k] = pw(fact[k], mod-2)\n\nans = 1\nfor e in f:\n ans = ans * fact[e+N-1] % mod * inv[e] % mod * inv[N-1] % mod \n\nprint(ans)\n', 'mod = 1000000007\n\n\n\ndef prime(n):\n d = []\n i = 2\n while n != 1:\n s = 0\n while n % i == 0:\n n /= i\n s += 1\n d.append(s)\n i += 1\n return d\n\n\ndef mod_pow(x, n):\n if n == 1:\n return x\n elif n % 2 == 0:\n half_x = mod_pow(x, n // 2)\n return half_x * half_x % mod\n else:\n return x * mod_pow(x, n-1) % mod\n\nfact = [0] * 100099\ninv = [0] * 100099\nfrac[0] = 1\ninv[0] = 1\nfor k in range(1, 100099):\n fact[k] = fact[k-1] * k % mod\n inv[k] = mod_pow(fact[k], mod-2)\n\ndef nCr(n, r):\n return fact[n] * inv[r] % mod * inv[n-r] % mod\n\ndef solve():\n N, M = map(int, input().split())\n p = prime(M)\n s = 1\n for i in p:\n s *= nCr(i + N - 1, N - 1)\n s %= mod\n print(s)\n\nsolve()', 'from collections import Counter\n\nmod = 1000000007\n\n\ndef factor(n):\n d = Counter()\n i = 2\n while i*i <= n:\n while n%i == 0:\n n //= i\n d[i] += 1\n i += 1\n if n > 1:\n d[n] += 1\n return d\n\n\n\ndef mod_pow(x, n):\n if n == 0:\n return 1\n elif n % 2 == 0:\n half = int(n / 2)\n half_x = mod_pow(x, half)\n return half_x * half_x % mod\n else:\n return x * mod_pow(x, n - 1) % mod\n\n\ndef nCr(n, r):\n x = 1\n r = min(r, n - r)\n for i in range(r):\n x *= n - i\n x %= mod\n x *= mod_pow(i + 1, mod - 2)\n x %= mod\n return x\n\n\ndef solve():\n N, M = map(int, input().split())\n p = factor(M)\n s = 1\n for i in p.values():\n s *= nCr(i + N - 1, N - 1)\n s %= mod\n print(s)\n\n\nsolve()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s078936375', 's120180424', 's658933622', 's140652546']
[3064.0, 2940.0, 4596.0, 3316.0]
[17.0, 17.0, 21.0, 22.0]
[756, 704, 838, 866]
p03253
u164727245
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['# coding: utf-8\nfrom collections import Counter\n\n\ndef ncr(n, r, mod):\n ret = 1\n for i in range(1, r+1):\n ret = (ret * (n-i+1) * pow(i, mod-2, mod)) % mod\n return ret\n\n\ndef solve(*args: str) -> str:\n n, m = map(int, args[0].split())\n mod = 10**9+7\n C = Counter()\n\n i = 2\n r = int(m**(1/2))\n while 1 < m:\n while m % i == 0:\n C[i] += 1\n m //= i\n if r < i:\n C[m] = 1\n break\n i += 1\n\n ret = 1\n for v, c in C.items():\n ret *= ncr(n+c-1, min(n-1, c), mod)\n ret %= mod\n\n return str(ret)\n\n\nif __name__ == "__main__":\n print(solve(*(open(0).read().splitlines())))\n', '# coding: utf-8\nfrom collections import Counter\n\n\ndef ncr(n, r, mod):\n ret = 1\n for i in range(1, r+1):\n ret = (ret * (n-i+1) * pow(i, mod-2, mod)) % mod\n return ret\n\n\ndef solve(*args: str) -> str:\n n, m = map(int, args[0].split())\n mod = 10**9+7\n C = Counter()\n\n i = 2\n r = -int(-m**(1/2)//1)\n while 1 < m:\n while m % i == 0:\n C[i] += 1\n m //= i\n if r < i:\n C[m] = 1\n break\n i += 1\n\n ret = 1\n for v, c in C.items():\n ret *= ncr(n+c-1, min(n-1, c), mod)\n ret %= mod\n\n return str(ret)\n\n\nif __name__ == "__main__":\n print(solve(*(open(0).read().splitlines())))\n']
['Wrong Answer', 'Accepted']
['s417596001', 's414684677']
[3316.0, 3316.0]
[25.0, 25.0]
[679, 684]
p03253
u201234972
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from collections import Counter\nQ = 10**9+7\ndef primes(n):\n primfac = []\n d = 2\n while d*d <= n:\n while (n % d) == 0:\n primfac.append(d) # supposing you want multiple factors repeated\n n //= d\n d += 1\n if n > 1:\n primfac.append(n)\n return primfac\n\ndef factorial(n):\n P = 1\n for i in range(1,n+1):\n P *= i\n return P\n\ndef combination(a,b):\n return int( (factorial(a)/factorial(b))/factorial(a-b))%Q\nN, M = map( int, input().split())\nC = Counter( primes(M))\nans = 1\nprint(C)\nif N == 1:\n print(1)\nelse:\n for x in C:\n ans = (ans * combination(C[x]+N-1,N-1))%Q\n print(ans)\n', 'from math import factorial\nQ = 10**9+7\ndef primes(n):\n primfac = [0]\n d = 2\n while d*d <= n:\n while n%d == 0:\n primfac[-1] += 1\n n //= d\n d += 1\n if primfac[-1] != 0:\n primfac.append(0)\n if n > 1:\n if primfac[-1] == 0:\n primfac[-1] += 1\n else:\n primfac.append(1)\n return primfac\nN, M = map( int, input().split())\nC = primes(M)\nans = 1\nif N == 1:\n print(1)\nelse:\n for x in C:\n for i in range(x):\n ans *= N+i\n ans //= factorial(x)\n ans = ans%Q\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s623192314', 's254170413']
[3804.0, 3064.0]
[2104.0, 18.0]
[660, 600]
p03253
u214617707
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['N, M = map(int, input().split())\nrec = []\nMOD = 10 ** 9 + 7\nK = M\nfor i in range(2, int(M ** 0.5) + 1):\n if K % i == 0:\n tmp = 0\n while K % i == 0:\n tmp += 1\n K //= i\n\n rec.append((i, tmp))\n\nQ = 10 ** 6 + 1\nfact = [0] * Q\nrfact = [0] * Q\nfact[0] = 1\nfor i in range(1, Q):\n fact[i] = fact[i - 1] * i % MOD\n\nrfact[Q - 1] = pow(fact[Q - 1], MOD - 2, MOD)\nfor i in range(Q - 2, -1, -1):\n rfact[i] = rfact[i + 1] * (i + 1) % MOD\n\n\ndef comb(n, r):\n return fact[n] * rfact[n - r] * rfact[r] % MOD\n\n\nnum = 1\nfor i in range(len(rec)):\n num *= comb(N + rec[i][1] - 1, rec[i][1])\n num %= MOD\n\nprint(num)\n', 'N, M = map(int, input().split())\nrec = []\nMOD = 10 ** 9 + 7\nK = M\nfor i in range(2, int(M ** 0.5) + 1):\n if K % i == 0:\n tmp = 0\n while K % i == 0:\n tmp += 1\n K //= i\n\n rec.append((i, tmp))\n\nif K != 1:\n rec.append((K, 1))\nQ = 10 ** 6 + 1\nfact = [0] * Q\nrfact = [0] * Q\nfact[0] = 1\nfor i in range(1, Q):\n fact[i] = fact[i - 1] * i % MOD\n\nrfact[Q - 1] = pow(fact[Q - 1], MOD - 2, MOD)\nfor i in range(Q - 2, -1, -1):\n rfact[i] = rfact[i + 1] * (i + 1) % MOD\n\n\ndef comb(n, r):\n return fact[n] * rfact[n - r] * rfact[r] % MOD\n\n\nnum = 1\nfor i in range(len(rec)):\n num *= comb(N + rec[i][1] - 1, rec[i][1])\n num %= MOD\n\nprint(num)\n']
['Wrong Answer', 'Accepted']
['s585609270', 's982836633']
[82292.0, 82420.0]
[781.0, 761.0]
[654, 688]
p03253
u223904637
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nn,m=map(int,input().split())\nmod=10**9+7\n\na=factorization(m)\nans=1\nfor i in a:\n k=i[1]\n t=1\n for j in range(n+1,n+k-1+1):\n t*=j\n for j in range(1,n+1):\n t=t//j\n ans*=t\n ans%=mod\nprint(ans)\n', "#!/usr/bin/env python3\nimport sys\n\nMOD = 1000000007 # type: int\ndef comb(n, k):\n k = min(n-k,k)\n ans = 1\n for i in range(1, k + 1):\n ans = (ans * (n + 1 - i) // i)\n return ans\n\ndef prime_decomposition(n):\n i = 2\n table = []\n while i * i <= n:\n while n % i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n\n return table\n\ndef solve(N: int, M: int):\n from collections import Counter\n primes = prime_decomposition(M)\n\n counter = Counter(primes)\n answer = 1\n for count in counter.values():\n answer *= comb(count+N-1,count)\n answer %= MOD\n \n print(answer)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n M = int(next(tokens)) # type: int\n solve(N, M)\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s490072348', 's220110092']
[3188.0, 3316.0]
[118.0, 22.0]
[573, 993]
p03253
u227020436
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import math\n\nN, M = map(int, input().split())\n\ndef factorized(M):\n maxd = int(math.sqrt(M))\n d = 2\n f = []\n while d <= M and d <= maxd:\n count = 0\n while M % d == 0:\n M //= d\n count += 1\n if count > 0:\n f.append(count)\n d += 1\n return f\n\ndef tetra(n, m):\n x = 1\n for y in range(1, n):\n x = x * (m + y - 1) // y\n return x\n\nx = 1\nfor f in factorized(M):\n x *= tetra(N, f + 1)\n x %= 10 ** 9 + 7\n\nprint(x)\n', 'N, M = map(int, input().split())\n\ndef factorized(M):\n d = 2\n f = []\n while d * d <= M:\n count = 0\n while M % d == 0:\n M //= d\n count += 1\n if count > 0:\n f.append(count)\n d += 1\n return f\n\ndef tetra(n, m):\n x = 1\n for y in range(1, n):\n x = x * (m + y - 1) // y\n return x\n\nx = 1\nfor f in factorized(M):\n x *= tetra(N, f + 1)\n x %= 10 ** 9 + 7\n\nprint(x)\n', 'N, M = map(int, input().split())\n\ndef factorized(M):\n d = 2\n f = []\n while d <= M:\n count = 0\n while M % d == 0:\n M //= d\n count += 1\n if count > 0:\n f.append(count)\n d += 1\n if d < M and d * d > M:\n d = M\n return f\n\ndef tetra(n, m):\n x = 1\n for y in range(1, n):\n x = x * (m + y - 1) // y\n return x\n\nx = 1\nfor f in factorized(M):\n x *= tetra(N, f + 1)\n x %= 10 ** 9 + 7\n\nprint(x)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s287119949', 's839224681', 's596460809']
[3064.0, 3064.0, 3064.0]
[165.0, 149.0, 165.0]
[500, 448, 494]
p03253
u231095456
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from collections import defaultdict\nN,M = map(int,input().split())\nd = defaultdict(int)\nfor i in range(2, floor(sqrt(M))+1):\n while M % i == 0:\n d[i] += 1\n M //= i\nif M != 1:\n d[M] += 1\ndef comb(n,k):\n if k == 0:\n return 1\n return comb(n-1,k-1) * n // k\nans = 1\nfor e in d.values():\n ans *= comb(N+e-1, e)\nprint(ans % (10**9+7))', 'from math import floor, sqrt\nfrom collections import defaultdict\nN,M = map(int,input().split())\nd = defaultdict(int)\nfor i in range(2, floor(sqrt(M))+1):\n while M % i == 0:\n d[i] += 1\n M //= i\nif M != 1:\n d[M] += 1\ndef comb(n,k):\n if k == 0:\n return 1\n return comb(n-1,k-1) * n // k\nans = 1\nfor e in d.values():\n ans *= comb(N+e-1, e)\nprint(ans % (10**9+7))']
['Runtime Error', 'Accepted']
['s834182029', 's390670273']
[9236.0, 9336.0]
[29.0, 32.0]
[364, 393]
p03253
u236127431
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['N,M=map(int,input().split())\n\ndef factorint(x):\n F={}\n i=2\n while i**2<=x:\n if x%i==0:\n c=0\n while x%i==0:\n x=x//i\n c+=1\n F[i]=c\n i+=1\n if x!=1:\n F[x]=1\n return F\n\ndef C(n,r):\n a=1\n b=1\n for i in range(r):\n a=a*(n-i)\n b=b*(r-i)\n return((a//b)%(10**9+7))\n\nans=1\nprint(factorint(M))\nfor f in factorint(M):\n k=factorint(M)[f]\n ans*=C(N+k-1,k) \nprint(ans%((10**9)+7))\n', 'N,M=map(int,input().split())\n\ndef factorint(x):\n F={}\n i=2\n while i**2<=x:\n if x%i==0:\n c=0\n while x%i==0:\n x=x//i\n c+=1\n F[i]=c\n i+=1\n if x!=1:\n F[x]=1\n return F\n\ndef C(n,r):\n a=1\n b=1\n for i in range(r):\n a=a*(n-i)\n b=b*(r-i)\n return((a//b)%(10**9+7))\n\nans=1\nfor f in factorint(M):\n k=factorint(M)[f]\n ans*=C(N+k-1,k) \nprint(ans%((10**9)+7))\n']
['Wrong Answer', 'Accepted']
['s876439269', 's281756664']
[3064.0, 3064.0]
[26.0, 24.0]
[426, 406]
p03253
u253209284
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def gen_to_list(func):\n def wrapper(*args):\n return list(func(*args))\n return wrapper\ndef memorize(func):\n memo = {}\n def wrapper(*args):\n if args not in memo:\n memo[args] = func(*args)\n return memo[args]\n return wrapper\n@gen_to_list\ndef factorize(n, factor=2, index=0):\n counter = 0\n while True:\n if n%factor==0:\n n //=factor\n counter += 1\n else:\n break\n if counter>0:\n yield (factor, counter)\n if factor**2 < n:\n yield from factorize(n, factor+1)\n elif n>2:\n yield (n, 1)\n@memorize\ndef choose(N, M):\n if M>N:\n return 0\n if N==0 or M==0:\n return 1\n else:\n return N*choose(N-1, M-1)//M\ndef ans(N, M):\n val = 1\n for _, r in factorize(M):\n val *= choose(N+r-1, r)\n val %= (10**9+7)\n return val\nprint(*map(int, input().split()))', 'def gen_to_list(func):\n def wrapper(*args):\n return list(func(*args))\n return wrapper\ndef memorize(func):\n memo = {}\n def wrapper(*args):\n if args not in memo:\n memo[args] = func(*args)\n return memo[args]\n return wrapper\n@gen_to_list\ndef factorize(n, factor=2, index=0):\n counter = 0\n while True:\n if n%factor==0:\n n //=factor\n counter += 1\n else:\n break\n if counter>0:\n yield (factor, counter)\n if factor**2 < n:\n yield from factorize(n, factor+1)\n elif n>2:\n yield (n, 1)\n@memorize\ndef choose(N, M, m):\n if M>N:\n return 0\n if N==0 or M==0:\n return 1\n else:\n return N*choose(N-1, M-1, m)//M\ndef ans(N, M):\n val = 1\n for _, r in factorize(M):\n val *= choose(N+r-1, r, 10**9+7)\n val %= (10**9+7)\n return val\nprint(*map(int, input().split()))', 'def memorize(func):\n memo = {}\n def wrapper(*args):\n if args not in memo:\n memo[args] = func(*args)\n return memo[args]\n return wrapper\ndef factorize(n, factor=2, index=0):\n counter = 0\n while True:\n if n%factor==0:\n n //=factor\n counter += 1\n else:\n break\n if counter>0:\n yield (factor, counter)\n if factor**2 < n:\n yield from factorize(n, factor+1)\n elif n>2:\n yield (n, 1)\n@memorize\ndef choose(N, M):\n if M>N:\n return 0\n if N==0 or M==0:\n return 1\n else:\n return N*choose(N-1, M-1)//M\ndef ans(N, M):\n val = 1\n for _, r in factorize(M):\n val *= choose(N+r-1, r)\n val %= (10**9+7)\n return val\nimport sys; sys.setrecursionlimit(100000)\nprint(ans(*map(int, input().split())))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s013858947', 's470151901', 's694201210']
[3192.0, 3064.0, 8932.0]
[17.0, 18.0, 26.0]
[908, 923, 843]
p03253
u260216890
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n \nN,M=map(int,input().split())\nif M==1:\n print(1)\nelse:\n primes0=prime_factorize(M)\n keys=list(set(primes0))\n primes={}\n for i in range(len(keys)):\n k=keys[i]\n primes[k]=0\n for j in range(len(primes0)):\n if primes0[j]==k:\n primes[k]+=1\n \n def cmb(n, k, mod, fac, ifac): #calc nCk under mod\n if n < k or n < 0 or k < 0:\n return 0\n else: \n k = min(k, n-k)\n return fac[n] * ifac[k] * ifac[n-k] % mod', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n \nN,M=map(int,input().split())\nprimes0=prime_factorize(M)\nkeys=list(set(primes0))\nprimes={}\nfor i in range(len(keys)):\n k=keys[i]\n primes[k]=0\n for j in range(len(primes0)):\n if primes0[j]==k:\n primes[k]+=1\n \ndef cmb(n, k, mod, fac, ifac): #calc nCk under mod\n if n < k or n < 0 or k < 0:\n return 0\n else: \n k = min(k, n-k)\n return fac[n] * ifac[k] * ifac[n-k] % mod\n \ndef make_tables(mod, n): #Make factorial and inverse tables under mod \n fac = [1, 1] # factorial table\n ifac = [1, 1] #factorial of inverse table\n inverse = [0, 1] #inverse\n \n for i in range(2, n+1):\n fac.append((fac[-1] * i) % mod)\n inverse.append((-inverse[mod % i] * (mod//i)) % mod)\n ifac.append((ifac[-1] * inverse[-1]) % mod)\n return fac, ifac\n \nmod=10**9+7\nfac,ifac=make_tables(mod,N*10)\nans=1\nfor i in range(len(keys)):\n ans*=cmb(N+primes[keys[i]]-1, primes[keys[i]], mod, fac, ifac)\n ans%=mod\nprint(ans)']
['Wrong Answer', 'Accepted']
['s040685038', 's344470091']
[3064.0, 122064.0]
[18.0, 1057.0]
[733, 1230]
p03253
u270681687
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['import math\nn, m = map(int, input().split())\n\nmod = 10 ** 9 + 7\n\nb = []\n\nc = int(math.sqrt(m))\nfor i in range(2, c+2):\n if m % i != 0:\n continue\n count = 0\n while m % i == 0:\n count += 1\n m = m // i\n b.append(count)\n\nfac = [1, 1]\ninv = [1, 1]\nfinv = [1, 1]\nfor i in range(2, c):\n fac.append(fac[i-1] * i % mod)\n inv.append(mod - inv[mod%i] * (mod//i) % mod)\n finv.append(finv[i-1] * inv[i] % mod)\n\ndef nck(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n-k] % mod) % mod\n\nans = 1\nfor i in b:\n ans = (ans * nck(n-1+i, n-1)) % mod\n\nprint(ans)', 'import math\nn, m = map(int, input().split())\n\nmod = 10 ** 9 + 7\n\nb = []\n\nc = int(math.sqrt(m))\nfor i in range(2, c+2):\n if m % i == 0:\n count = 0\n while m % i == 0:\n count += 1\n m = m // i\n b.append(count)\n\nfac = [1, 1]\ninv = [1, 1]\nfinv = [1, 1]\nfor i in range(2, n + max(b)+3):\n fac.append(fac[i-1] * i % mod)\n inv.append(mod - inv[mod%i] * (mod//i) % mod)\n finv.append(finv[i-1] * inv[i] % mod)\n\ndef nck(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n-k] % mod) % mod\n\nans = 1\nfor i in b:\n ans = (ans * nck(n-1+i, n-1)) % mod\n\nprint(ans)', 'import math\nn, m = map(int, input().split())\n\nmod = 10 ** 9 + 7\n\nb = []\n\nc = int(math.sqrt(m))\nfor i in range(2, c+2):\n if m % i == 0:\n continue\n count = 0\n while m % i == 0:\n count += 1\n m = m // i\n b.append(count)\n\nfac = [1, 1]\ninv = [1, 1]\nfinv = [1, 1]\nfor i in range(2, n + max(b)+3):\n fac.append(fac[i-1] * i % mod)\n inv.append(mod - inv[mod%i] * (mod//i) % mod)\n finv.append(finv[i-1] * inv[i] % mod)\n\ndef nck(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n-k] % mod) % mod\n\nans = 1\nfor i in b:\n ans = (ans * nck(n-1+i, n-1)) % mod\n\nprint(ans)', 'import math\n\nn, m = map(int, input().split())\n\nsqrt_m = math.sqrt(m)\nsqrt_m = int(sqrt_m) + 1\n\nmod = 10**9 + 7\nfac = [1, 1]\ninv = [1, 1]\nfinv = [1, 1]\nfor i in range(2, n + 31):\n fac.append(fac[i-1] * i % mod)\n inv.append(mod - inv[mod%i] * (mod//i) % mod)\n finv.append(finv[i-1] * inv[i] % mod)\n\ndef nck(n, k):\n if n < k:\n return 0\n if n < 0 or k < 0:\n return 0\n return fac[n] * (finv[k] * finv[n-k] % mod) % mod\n\n\nprime = []\nfor i in range(2, sqrt_m + 1):\n count = 0\n while m % i == 0:\n m = m // i\n count += 1\n if count > 0:\n prime.append(count)\nif m > 1:\n prime.append(1)\n\nans = 1\nfor i in prime:\n ans *= nck(n-1+i, i)\n ans %= mod\n\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s055036783', 's099477487', 's307296385', 's087894009']
[7028.0, 2940.0, 15248.0, 15040.0]
[57.0, 17.0, 174.0, 141.0]
[652, 646, 663, 717]
p03253
u319818856
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from math import sqrt\n\n\ndef prime_facts(n: int) -> dict:\n res = {}\n d = 2\n while d * d <= n:\n if n % d == 0:\n res[d] = 1\n n //= d\n\n while n % d == 0:\n res[d] += 1\n n //= d\n\n if d == 2:\n d += 1\n else:\n d += 2\n\n return res\n\n\ndef factorization(N: int, M: int) -> int:\n \n \n pi = [1] * 101\n fact = [1] * 101\n for i in range(1, 101):\n pi[i] = (N+i-1) * pi[i-1]\n fact[i] = i * fact[i-1]\n\n primes = prime_facts(M)\n ret = 1\n for k in primes.values():\n ret *= pi[k] // fact[k]\n\n return ret % 1000000007\n\n\nif __name__ == "__main__":\n N, M = map(int, input().split())\n ans = factorization(N, M)\n print(ans)\n', 'def prime_facts(n: int) -> dict:\n res = {}\n d = 2\n while n > 1:\n if n % d == 0:\n res[d] = 1\n n //= d\n\n while n % d == 0:\n res[d] += 1\n n //= d\n\n if d == 2:\n d += 1\n else:\n d += 2\n\n return res\n\n\ndef pi(start: int, stop: int, n: int) -> int:\n \n res = 1\n for i in range(start, stop+1):\n res *= (n + i)\n return res\n\n\ndef fact(n: int) -> int:\n \n res = 1\n for i in range(n):\n res *= (i + 1)\n return res\n\n\ndef factorization(N: int, M: int) -> int:\n \n pi = [1] * 101\n fact = [1] * 101\n for i in range(1, 101):\n pi[i] = (N+i-1) * pi[i-1]\n fact[i] = i * fact[i-1]\n primes = prime_facts(M)\n raise Exception()\n ret = 1\n for k in primes.values():\n ret *= pi[k] // fact[k]\n\n return ret % 1000000007\n\n\nif __name__ == "__main__":\n N, M = map(int, input().split())\n ans = factorization(N, M)\n print(ans)\n', 'from math import sqrt\n\n\ndef prime_facts(n: int) -> dict:\n res = {}\n d = 2\n while d * d <= n:\n if n % d == 0:\n res[d] = 1\n n //= d\n\n while n % d == 0:\n res[d] += 1\n n //= d\n\n if d == 2:\n d += 1\n else:\n d += 2\n\n if n > 1:\n res[n] = 1\n\n return res\n\n\ndef factorization(N: int, M: int) -> int:\n \n \n pi = [1] * 101\n fact = [1] * 101\n for i in range(1, 101):\n pi[i] = (N+i-1) * pi[i-1]\n fact[i] = i * fact[i-1]\n\n primes = prime_facts(M)\n ret = 1\n for k in primes.values():\n ret *= pi[k] // fact[k]\n\n return ret % 1000000007\n\n\nif __name__ == "__main__":\n N, M = map(int, input().split())\n ans = factorization(N, M)\n print(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s390093106', 's625056836', 's958609778']
[3064.0, 3064.0, 3188.0]
[19.0, 2104.0, 19.0]
[2248, 2523, 2282]
p03253
u329407311
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\nimport collections\nfrom scipy.misc import comb \nN,M = map(int,input().split())\n\narr = collections.Counter(prime_factorize(M))\nans = 1\nfor i in arr:\n ans = ans * (arr[i]+1)\n\na = comb(ans, N-1, exact=True)\nprint(int(a))', 'N, M = [int(_) for _ in input().split()]\n\nMOD = 10**9+7\n\ndef primes(n):\n from math import sqrt\n mn = int(sqrt(n)) + 2\n p = [1] * mn\n for x in range(2, mn):\n if p[x]:\n y = x * x\n while y < mn:\n p[y] = 0\n y += x\n return (i for i in range(2, mn) if p[i])\n\ndef calc(M):\n result = {}\n for n in primes(M):\n if M % n == 0:\n result[n] = 1\n M //= n\n while M % n == 0:\n result[n] += 1\n M //= n\n if M > 1:\n result[M] = 1\n return result\n\ndef C(x, y):\n n = min(y, x - y)\n r = 1\n for i in range(n):\n r = r * (x - i)\n for i in range(n):\n r = r // (i + 1)\n return r\n\ncs = calc(M)\n\nresult = 1\n\nfor x in cs.values():\n result = result * C(N+x-1, N-1) % MOD\n\nprint(result)\n']
['Wrong Answer', 'Accepted']
['s302547786', 's449337790']
[13244.0, 3316.0]
[159.0, 25.0]
[492, 836]
p03253
u338824669
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['def prime_factorizarion(n):\n\tarr = []\n\ttemp = n\n\tfor i in range(2, int(n**0.5)+1):\n\t\tif temp%i==0:\n\t\t\tcnt=0\n\t\t\twhile temp%i==0:\n\t\t\t\tcnt+=1\n\t\t\t\ttemp//=i\n\t\t\tarr.append([i,cnt])\n\t\n\tif temp!=1:\n\t\tarr.append([temp,1])\n\t\n\tif arr==[]:\n\t\tarr.append([n,1])\n\t\n\treturn arr\n\ndef modInv(a,mod):\n return pow(a,mod-2,mod)\n\ndef nCr(n,r,mod):\n r=min(r,n-r)\n if r==0:\n return 1\n if r==1:\n return n\n numer=1\n denom=1\n for i in range(r):\n numer=(n-i)*numer%mod\n denom=(i+1)*denom%mod\n return numer*modInv(denom,mod)%mod\n\nmod=10**9+7\nN,M=map(int,input().split())\n\nif M==1:\n print(1)\n exit()\n\nprime_divisors=prime_factorizarion(M)\nans=1\nfor prime,num in prime_divisors:\n ans=(ans*nCr(num+N-1,num,mod))%mod\nprint(ans,prime_divisors)', 'def prime_factorizarion(n):\n\tarr = []\n\ttemp = n\n\tfor i in range(2, int(n**0.5)+1):\n\t\tif temp%i==0:\n\t\t\tcnt=0\n\t\t\twhile temp%i==0:\n\t\t\t\tcnt+=1\n\t\t\t\ttemp//=i\n\t\t\tarr.append([i,cnt])\n\t\n\tif temp!=1:\n\t\tarr.append([temp,1])\n\t\n\tif arr==[]:\n\t\tarr.append([n,1])\n\t\n\treturn arr\n\ndef modInv(a,mod):\n return pow(a,mod-2,mod)\n\ndef nCr(n,r,mod):\n r=min(r,n-r)\n if r==0:\n return 1\n if r==1:\n return n\n numer=1\n denom=1\n for i in range(r):\n numer=(n-i)*numer%mod\n denom=(i+1)*denom%mod\n return numer*modInv(denom,mod)%mod\n\nmod=10**9+7\nN,M=map(int,input().split())\n\nif M==1:\n print(1)\n exit()\n\nprime_divisors=prime_factorizarion(M)\nans=1\nfor prime,num in prime_divisors:\n ans=(ans*nCr(num+N-1,num,mod))%mod\nprint(ans)']
['Wrong Answer', 'Accepted']
['s782277689', 's617249790']
[3188.0, 3188.0]
[20.0, 19.0]
[770, 755]
p03253
u340781749
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from collections import defaultdict\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1] * (n + 1)\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials[m] = f\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef prime_factorize(n):\n f = defaultdict(lambda: 0)\n f[2] = len(bin(n & -n)) - 3\n i = 3\n k = n >> f[2]\n limit = n ** 0.5\n while 1 < k and i <= limit:\n while True:\n d, m = divmod(k, i)\n if m == 0:\n f[i] += 1\n k = d\n else:\n break\n i += 2\n return f\n\n\nMOD = 1000000007\nn, m = map(int, input().split())\npf = prime_factorize(m)\nmx = max(pf.values())\nf, r = prepare(n + mx - 1, MOD)\nans = 1\nfor p, e in pf.items():\n ans *= f[n + e - 1]\n ans %= MOD\n ans *= r[n - 1]\n ans %= MOD\n ans *= r[e]\n ans %= MOD\nprint(ans)\n', 'from collections import defaultdict\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1] * (n + 1)\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials[m] = f\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef prime_factorize(n):\n r2 = len(bin(n & -n)) - 3\n if r2:\n yield r2\n i = 3\n k = n >> f[2]\n while 1 < k and i * i <= k:\n cnt = 0\n while True:\n d, m = divmod(k, i)\n if m == 0:\n cnt += 1\n k = d\n else:\n break\n if cnt:\n yield cnt\n i += 2\n if k > 1:\n yield 1\n\n\nMOD = 1000000007\nn, m = map(int, input().split())\npf = list(prime_factorize(m))\nmx = max(pf)\nf, r = prepare(n + mx - 1, MOD)\nans = 1\nfor e in pf:\n ans *= f[n + e - 1]\n ans %= MOD\n ans *= r[n - 1]\n ans %= MOD\n ans *= r[e]\n ans %= MOD\nprint(ans)\n', 'from collections import defaultdict\n\n\ndef prepare(n, MOD):\n f = 1\n factorials = [1] * (n + 1)\n for m in range(1, n + 1):\n f *= m\n f %= MOD\n factorials[m] = f\n inv = pow(f, MOD - 2, MOD)\n invs = [1] * (n + 1)\n invs[n] = inv\n for m in range(n, 1, -1):\n inv *= m\n inv %= MOD\n invs[m - 1] = inv\n\n return factorials, invs\n\n\ndef prime_factorize(n):\n f = defaultdict(lambda: 0)\n f[2] = len(bin(n & -n)) - 3\n i = 3\n k = n >> f[2]\n limit = k ** 0.5\n while 1 < k and i <= limit:\n while True:\n d, m = divmod(k, i)\n if m == 0:\n f[i] += 1\n k = d\n limit = k ** 0.5\n else:\n break\n i += 2\n if k > 1:\n f[k] = 1\n return f\n\n\nMOD = 1000000007\nn, m = map(int, input().split())\npf = prime_factorize(m)\nmx = max(pf.values())\nf, r = prepare(n + mx - 1, MOD)\nans = 1\nfor p, e in pf.items():\n ans *= f[n + e - 1]\n ans %= MOD\n ans *= r[n - 1]\n ans %= MOD\n ans *= r[e]\n ans %= MOD\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s021414927', 's323060798', 's828164406']
[11376.0, 3316.0, 11252.0]
[70.0, 21.0, 66.0]
[1022, 1052, 1086]
p03253
u341347211
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from sys import stdin\n\n\ndef prime_factorization(n):\n i = 2\n table = []\n while i * i <= n:\n while n % i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n return table\n\n\ndef num_of_prime_factorization(n):\n i = 2\n table = []\n while i * i <= n:\n loop_num = 0\n while n % i == 0:\n n //= i\n loop_num += 1\n if n % i != 0:\n table.append(loop_num)\n i += 1\n return table\n\n\ndef factorial(n):\n if n > 1:\n return n * factorial(n - 1)\n else:\n return 1\n\n\nN, M = [int(i) for i in stdin.readline().rstrip().split()]\n\nlst = num_of_prime_factorization(M)\nans = 1\n\nfor b in lst:\n ans *= factorial(b + N - 1) // (factorial(b) * factorial(N - 1))\n\nprint(ans)', 'from sys import stdin\n\n\ndef num_of_prime_factorization(n):\n i = 2\n table = []\n while i * i <= n:\n loop_num = 0\n while n % i == 0:\n n //= i\n loop_num += 1\n if n % i != 0:\n table.append(loop_num)\n i += 1\n if n > 1:\n table.append(1)\n return table\n\n\ndef comb(n, r):\n a = 1\n for num in range(n, n - r, -1):\n a *= num\n\n b = 1\n for num in range(r, 0, -1):\n b *= num\n\n return a // b\n\n\nN, M = [int(i) for i in stdin.readline().rstrip().split()]\n\nlst = num_of_prime_factorization(M)\nans = 1\n\nfor b in lst:\n ans *= comb(b + N - 1, b)\n\nprint(ans % (10**9 + 7))\n']
['Runtime Error', 'Accepted']
['s267554532', 's164745343']
[3896.0, 3064.0]
[79.0, 18.0]
[816, 672]
p03253
u350049649
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from operator import mul\nfrom functools import reduce\n\nN,M=map(int,input().split())\nP=10**9+7\nans=1\n\ndef Pdeco(m):\n ret=[]\n for i in range(2,int((M)**(0.5))+1):\n if m<=i:\n if m!=1: ret.append(int(m))\n break\n elif i==int((M)**(0.5)):\n ret.append(m)\n break\n\n while m%i==0:\n m=m//i\n ret.append(i)\n return ret\n\n\ndef cmb(n,r):\n r = min(n-r,r)\n if r == 0: return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // under\n\nL=Pdeco(M)\nnums=set(L)\n\nfor n in nums:\n p=L.count(n)\n ans=(ans*cmb(N+p-1,N-1))%P\n\nprint(ans)', 'from operator import mul\nfrom functools import reduce\n\nN,M=map(int,input().split())\nP=10**9+7\nans=1\n\ndef Pdeco(m):\n ret=[]\n for i in range(2,int((m)**(0.5))+1):\n if m<=i:\n if m!=1: ret.append(int(m))\n break\n elif i==int((m)**(0.5)):\n ret.append(m)\n break\n\n while m%i==0:\n m=m//i\n ret.append(i)\n return ret\n\n\ndef cmb(n,r):\n r = min(n-r,r)\n if r == 0: return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // under\n\nL=Pdeco(M)\nnums=set(L)\n\nfor n in nums:\n p=L.count(n)\n ans=(ans*cmb(N+p-1,N-1))%P\n\nprint(ans)', 'from operator import mul\nfrom functools import reduce\n\nN,M=map(int,input().split())\nP=10**9+7\nans=1\n\ndef Pdeco(m):\n ret=[]\n for i in range(2,int((M)**(0.5))+100):\n if m<=i:\n if m!=1: ret.append(int(m))\n break\n elif i>int((M)**(0.5)+50):\n ret.append(m)\n break\n\n while m%i==0:\n m=m//i\n ret.append(i)\n return ret\n\n\ndef cmb(n,r):\n r = min(n-r,r)\n if r == 0: return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // under\n\nL=Pdeco(M)\nnums=set(L)\n\nfor n in nums:\n p=L.count(n)\n ans=(ans*cmb(N+p-1,N-1))%P\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s007436552', 's873105681', 's441200044']
[3684.0, 3684.0, 3684.0]
[38.0, 26.0, 37.0]
[669, 669, 673]
p03253
u374103100
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['\n\n\nN, M = map(int, input().split())\n\n\ndef get_prime_dic(n):\n dic = {}\n\n i = 2\n while i * i <= n:\n while n % i == 0:\n n //= i\n if i in dic:\n dic[i] += 1\n else:\n dic[i] = 1\n i += 1\n return dic\n\n\n# Calculate count of combination\ndef combinations_count(n, r):\n import math\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\nd = get_prime_dic(M)\n# print(d)\n\nans = 1\n\nfor k, v in d.items():\n ans *= combinations_count(v + N - 1, v)\n\n\nprint(ans % (10**9 + 7))\n', '\n\n\ndef get_prime_dic(n):\n dic = {}\n\n i = 2\n while i * i <= n:\n while n % i == 0:\n n //= i\n if i in dic:\n dic[i] += 1\n else:\n dic[i] = 1\n i += 1\n\n if n > 1:\n dic[n] = 1\n return dic\n\n\n# Calculate count of combination\ndef combination(n, r):\n a = 1\n b = 1\n for i in range(r):\n a *= (n - i)\n b *= (i + 1)\n return a // b\n\n\ndef main():\n N, M = map(int, input().split())\n d = get_prime_dic(M)\n # print(d)\n\n ans = 1\n for k, v in d.items():\n ans *= combination(v + N - 1, v)\n ans %= 1000000007\n\n print(ans)\n\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s399872058', 's592793309']
[4396.0, 3064.0]
[2104.0, 18.0]
[626, 714]
p03253
u374531474
2,000
1,048,576
You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.
['from collections import defaultdict\nfrom functools import reduce\nfrom operator import mul\n\nMOD = 10 ** 9 + 7\n\ndef nCr(n, r):\n r = min(r, n - r)\n if r == 0:\n return 1\n return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(1, r + 1))\n\nN, M = map(int, input().split())\n\nfactors = defaultdict(int)\ni = 2\nwhile M > 1 and i * i <= N:\n while M % i == 0:\n M //= i\n factors[i] += 1\n i += 1 if i == 2 else 2\nif M > 1:\n factors[M] += 1\n\nans = 1\nfor n in factors.values():\n ans *= nCr(N + n - 1, n)\n ans %= MOD\nprint(ans)\n', 'from collections import defaultdict\nfrom functools import reduce\nfrom operator import mul\n\nMOD = 10 ** 9 + 7\n\ndef nCr(n, r):\n r = min(r, n - r)\n if r == 0:\n return 1\n return reduce(mul, range(n, n - r, -1)) // reduce(mul, range(1, r + 1))\n\nN, M = map(int, input().split())\n\nfactors = defaultdict(int)\ni = 2\nwhile M > 1 and i * i <= M:\n while M % i == 0:\n M //= i\n factors[i] += 1\n i += 1 if i == 2 else 2\nif M > 1:\n factors[M] += 1\n\nans = 1\nfor n in factors.values():\n ans *= nCr(N + n - 1, n)\n ans %= MOD\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s143219270', 's204964232']
[3572.0, 3700.0]
[23.0, 24.0]
[562, 562]