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
p02947
u044442911
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from sys import stdin\n\n\ndef main():\n N = int(stdin.readline())\n s = [stdin.readline().rstrip().split() for _ in range(N)]\n\n s_flat = [flatten for inner in s for flatten in inner]\n\n s_dict = {}\n sum = 0\n\n for S in s_flat:\n new_S = \'\'.join(sorted(S))\n print(new_S)\n ...
['Wrong Answer', 'Accepted']
['s340469616', 's295028873']
[44036.0, 43040.0]
[348.0, 268.0]
[508, 487]
p02947
u044459372
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["import collections\nn=int(input())\ntexts=[''.join(sorted(input())) for i in range(n)]\n#print(texts)\nc=collections.Counter(texts)\nprint(sum(c.values()))", "import collections\nn=int(input())\ntexts=[''.join(sorted(input())) for i in range(n)]\n#print(texts)\nc=collections.Counter(texts)\n#print(c)\nans=sum([i*(i-1...
['Wrong Answer', 'Accepted']
['s741743515', 's529111983']
[19760.0, 19760.0]
[335.0, 336.0]
[150, 194]
p02947
u046187684
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import defaultdict\n\n\ndef solve(string):\n n, *s = string.split()\n d = defaultdict(int)\n for _s in s:\n d["".join(sorted(_s))] += 1\n return str(sum([v * (v - 1) // 2 for v in d.values() if v > 1]))\n\n\nif __name__ == \'__main__\':\n print(solve(input()))\n', 'def solve(str...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s484955132', 's702938557', 's962807512', 's993357040']
[3316.0, 11984.0, 27468.0, 27852.0]
[21.0, 150.0, 305.0, 304.0]
[286, 334, 340, 315]
p02947
u047197186
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\n\ndic = {}\nfor i in range(n):\n s = ''.join(sorted(list(input())))\n if not s in dic:\n dic[s] = 1\n else:\n dic[s] += 1\n\nres = 0\nfor v in dic.values():\n\tif v >= 2:\n res += v*(v-1)\nprint(res//2)", "n = int(input())\n\ndic = {}\nfor i in range(n):\n s = ''.join(sorted(list(inpu...
['Runtime Error', 'Accepted']
['s267465126', 's046959770']
[3064.0, 17932.0]
[18.0, 391.0]
[219, 218]
p02947
u047816928
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["N = int(input())\nS = sorted([''.join(sorted(input())) for _ in range(N)])\nprint(S)\nprev = ''\nans = 0\nn = 0\nfor i in range(N):\n if S[i]!=prev:\n ans += n*(n-1)//2\n prev=S[i]\n n=1\n else:\n n+=1\nans += n*(n-1)//2\n\nprint(ans)", "N = int(input())\nS = sorted([''.join(sorted(i...
['Wrong Answer', 'Accepted']
['s573695824', 's194950497']
[15092.0, 11408.0]
[408.0, 408.0]
[253, 245]
p02947
u054471580
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import defaultdict\nn = int(input())\ns = [input() for i in range(n)]\ntmp = [defaultdict(int) for i in range(n)]\n\nfor j in range(len(s)):\n for k in s[j]:\n tmp[j][k] += 1\n \nans = 0\nfor i in range(0,len(s)):\n for j in range(i+1,len(s)):\n if(tmp[i]==tmp[j]):\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s166866110', 's345996756', 's413549616']
[80756.0, 3316.0, 25332.0]
[2108.0, 21.0, 366.0]
[377, 377, 252]
p02947
u054825571
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\nS=[input() for _ in range(n)]\nS=[''.join(sorted(i)) for i in S]\nd={}\nrslt=0\nfor s in S:\n if s in d:\n rslt+=d\n d+=1\n else:\n d[s]=1\nprint(rslt)\n", 'N=int(input())\nS=["".join(sorted(input())) for _ in range(N)]\nd={}\nans=0\nfor s in S:\n if s in d:\n ans+=d[s...
['Runtime Error', 'Accepted']
['s520599090', 's620517462']
[19852.0, 23668.0]
[294.0, 220.0]
[186, 153]
p02947
u059436995
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from collections import Counter \nn = int(input())\nanagram =[]\nans = 0\nfor _ in range(n):\n s = ''.join(input())\n anagram.append(s)\ncount_ana = Counter(anagram)\nfor v in count_ana.values():\n ans += v * (v + 1) // 2\nprint(ans)\n", "n = int(input())\nanagram =[]\nans = 0\nfor _ in range(n):\n s = ''...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s488652250', 's797032715', 's210351679']
[19824.0, 10176.0, 19760.0]
[270.0, 228.0, 362.0]
[233, 199, 241]
p02947
u062655521
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\ncnt = 0\ns_dic = {}\nfor _ in range(n):\n s = ''.join(sorted(input()))\n if s in s_dic:\n s_dic[s] += 1\n cnt += s_dic[s]\n else:\n s_dic[s] = 1\n cnt += s_dic[s]\n\nprint(cnt)\n", "n = int(input())\ncnt = 0\ns_dic = {}\nfor _ in range(n):\n s = ''.join(sorted...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s516734469', 's698281086', 's717394751']
[17852.0, 17852.0, 17976.0]
[402.0, 412.0, 412.0]
[220, 227, 203]
p02947
u063073794
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\nd=dict()\nfor i in range(n):\n l = "".join(sorted(input())) \n if l not in d:\n d[l]=1\n else:\n d[l]+=1\nans=0\nfor x in d.values():\n ans+=(x*x-1)/2\nprint(ans)\n ', 'Lily\nfrom collections import defaultdict\n\nn = int(input())\ndct = defaultdict(int)\n\nfor i in range(n):\n s = input...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s299634428', 's461826172', 's893927923', 's280180846']
[17848.0, 2940.0, 17852.0, 17852.0]
[381.0, 17.0, 381.0, 389.0]
[180, 249, 180, 184]
p02947
u066253157
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nS = [input() for _ in range(N)]\n\nans = 0\nS = ["".join(sorted(s)) for s in S]\n\nfrom collections import Counter\n\nc = Counter(S)\nprint(c.most_common()[0][1])', 'N = int(input())\nS = [input() for _ in range(N)]\nS = ["".join(sorted(s)) for s in S]\n\ncnt = 0\ndic = {}\n\nfor w in S:\n if w i...
['Wrong Answer', 'Accepted']
['s137322151', 's388874149']
[24456.0, 19852.0]
[315.0, 296.0]
[171, 223]
p02947
u068692021
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import math\nimport sys\n\nm=10**9 + 7 \nsys.setrecursionlimit(1000010)\n\nN = int(input())\n#print(N)\nS=[]\nfor i in range(N):\n #print(i)\n S.append("".join(sorted(input())))\n # print(input())\nS.sort()\n#print(S)\nn = 1\nans=0\nfor i in range(1,N):\n if S[i] == S[i-1]:\n n = n + 1\n else:\n...
['Wrong Answer', 'Accepted']
['s077663556', 's567809928']
[10636.0, 10636.0]
[411.0, 402.0]
[393, 404]
p02947
u074230519
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["# -*- coding:utf-8 -*-\n\nimport math\n\nN = int(input())\n\ntype_dict = {}\nfor _ in range(N):\n s = input()\n counts = (\n s.count('a'), s.count('b'), s.count('c'), s.count('d'),\n s.count('e'), s.count('f'), s.count('g'), s.count('h'),\n s.count('i'), s.count('j'), s.count('k'), s.count(...
['Runtime Error', 'Accepted']
['s779046160', 's969762624']
[37084.0, 35932.0]
[690.0, 1057.0]
[848, 849]
p02947
u075303794
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(input())\ns=[''.join(sorted(input())) for i in range(n)]\nans=0\ndict={}\nfor i in s:\n if i in dict:\n dict[i]+=1\n ans+=dict[i]\n else:\n dict[i]=1\nprint(ans)", "N = input()\ns = [''.join(sorted(input())) for i in range(N)]\nans=0\ndict={}\nfor i in s:\n if i in dict:\n ans+=dict[i]\n dict[...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s127821362', 's134663855', 's447212573', 's652016329']
[19400.0, 3060.0, 3064.0, 19400.0]
[341.0, 17.0, 19.0, 350.0]
[168, 167, 164, 168]
p02947
u076512055
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nS = [sorted(list(input())) for _ in range(N)]\n\nans = N\nfor i in range(N):\n for j in range(i+1, N):\n if S[i]==S[j]:\n ans -= 1\nprint(ans)', "N = int(input())\nS = [''.join(sorted(input())) for _ in range(N)]\n\nD = {}\nans = 0\nfor s in S:\n if s in D:\n D[s] += 1...
['Wrong Answer', 'Accepted']
['s257168387', 's234430030']
[26256.0, 19404.0]
[2105.0, 345.0]
[173, 185]
p02947
u077291787
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['# ABC137C - Green Bin\nfrom collections import Counter\n\n\ndef main():\n _, *S = open(0)\n cnt = Counter(sorted(s) for s in S).values()\n ans = sum(i * (i - 1) // 2 for i in cnt)\n print(ans)\n\n\nif __name__ == "__main__":\n main()', '# ABC137C - Green Bin\nfrom collections import Counter\n\n\ndef ma...
['Runtime Error', 'Accepted']
['s963036764', 's545911498']
[10600.0, 26752.0]
[31.0, 195.0]
[236, 260]
p02947
u078181689
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\narr = [input() for i in range(n)]\nlistarr = [[arr[i][j] for j in range(10)] for i in range(n)]\nfor i in range(n):\n listarr[i].sort()\ntuplearrsort = [tuple(listarr[i]) for i in range(n)]\ndic = {}\n\nfor i in range(n):\n if tuplearrsort[i] in dic:\n dic[tuplearrsort[i]] += 1\n els...
['Wrong Answer', 'Accepted']
['s720082575', 's127021205']
[54288.0, 54284.0]
[510.0, 523.0]
[492, 437]
p02947
u081688405
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["dic = { c: i for i, c in enumerate('abcdefghijklmnopqrstuvwxyz')}\n\nn = int(input())\nstrs = [tuple(sorted(map(lambda x: dic[x], input()))) for _ in range(n)]\n\na = {}\nfor s in strs:\n if s not in a:\n a[s] = 1\n else:\n a[s] += 1\n\nprint(a)\nprint(sum(item[1]*(item[1]-1)//2 for item in a.items()))", "di...
['Wrong Answer', 'Accepted']
['s417205599', 's593868834']
[37632.0, 26000.0]
[649.0, 533.0]
[299, 291]
p02947
u084324798
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['num = int(input())\ndic = [input() for i in range(num)]\n\nsdic = []\nans = 0\nfor i in range(num):\n dic[i] = "".join(sorted(dic[i]))\nfor i in range(num)\n now = dic[0]\n cnt = dic.count(now)\n ans += int((cnt * (cnt - 1)) / 2)\n for i in range(cnt):\n dic.remove(now)\n i += cnt - 1\nprint(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s449653660', 's713182126', 's301727327']
[2940.0, 10268.0, 24976.0]
[17.0, 2104.0, 343.0]
[308, 287, 266]
p02947
u086438369
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["import sys\ninput = sys.stdin.readline\n\nn = int(input())\nsn = [input().strip('\\n') for _ in range(n)]\n\nmod = 10**7 + 7\nhs = [[0, ''] for _ in range(mod)]\n\ndef hypo(s, Mod):\n h_num = 1\n for i in s:\n h_num = h_num * ord(i) % Mod\n return h_num\n\nfor s in sn:\n s = ''.join(sorted(s))\n ...
['Time Limit Exceeded', 'Accepted']
['s994982713', 's159265415']
[517208.0, 109500.0]
[2222.0, 927.0]
[642, 641]
p02947
u089032001
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\nfrom operator import mul\nfrom functools import reduce\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef cmb(n, r):\n # combination\n if n < r:\n return 0\n r = min(n - r, r)\n if r == 0:\n return 1\n over = reduce(mul, range(n, n - r, ...
['Wrong Answer', 'Accepted']
['s876611695', 's311479638']
[62696.0, 45300.0]
[599.0, 499.0]
[602, 604]
p02947
u089142196
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N=int(input()) \nt=[[0]*10]*N\ny=[[0]*10]*N\n\nfor i in range(N):\n s=input()\n for j in range(10):\n t[i][j]=s[j]\n y[i]=sorted(t[i])\n \ncount=0\n\nfor i in range(0,N-1):\n for j in range(i+1,N):\n #print(i,t[i])\n #print(j,t[1])\n\n if y[i]==y[j]:\n count+=1\n else:\n break\n\nprint...
['Wrong Answer', 'Accepted']
['s590927590', 's844910597']
[24948.0, 29664.0]
[2105.0, 569.0]
[303, 260]
p02947
u090361088
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from math import factorial\nN = int(input())\ns = [''.join(sorted(input())) for i in range(N)]\nns = []\nans = 0\nfor i in range(len(s)):\n if ns.count(s[i]) == 0:\n aas = s.count(s[i])\n if aas > 0:\n ns.append(s[i])\n abs = int(factorial(aas) / factorial(2) / factorial(aas - 2 ))\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s343811266', 's381322775', 's503655481', 's457651046']
[11156.0, 108184.0, 11188.0, 23712.0]
[1770.0, 2065.0, 1818.0, 510.0]
[337, 497, 456, 261]
p02947
u090406054
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(inpput())\nlist=[input() for i in range(n)]\nlists=[]\nfor i in list:\n lists.append(''.join(sorted(i)))\n \nprint(len(lists)-len(set(lists)))", 'n = int(input())\n\nwords = {}\nanagrams = 0\n\nfor i in range(n):\n word = "".join(sorted(input()))\n if word not in words:\n words[word] = 1\n els...
['Runtime Error', 'Accepted']
['s346978112', 's972159781']
[2940.0, 17852.0]
[17.0, 389.0]
[144, 232]
p02947
u092382030
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import itertools\ndef list_difference(list1, list2):\n result = list1.copy()\n for value in list2:\n if value in result:\n result.remove(value)\n\n return len(result)\n\n\n#n=int(input())\n\ncount=0\na=list(itertools.combinations(a,2))\nfor i in range(len(a)):\n if list_difference(a[i][0...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s058554629', 's086628569', 's087750311', 's191804346', 's387588567', 's423901588', 's569239840', 's581183346', 's608483607', 's660229289', 's679016614', 's918373309', 's980676963', 's142749540']
[3060.0, 24212.0, 1041808.0, 24208.0, 2940.0, 36248.0, 3060.0, 10272.0, 31260.0, 31260.0, 2940.0, 3060.0, 3060.0, 45716.0]
[18.0, 262.0, 2167.0, 235.0, 17.0, 494.0, 18.0, 139.0, 216.0, 229.0, 19.0, 20.0, 17.0, 896.0]
[383, 224, 372, 196, 285, 238, 384, 145, 222, 476, 281, 237, 229, 271]
p02947
u098982053
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nstr = [input().sort for i in range(N)]\ndict = {}\ncount = 0\n\nprint(str)', "N = int(input())\nstr = [''.join(sorted(input())) for i in range(N)]\ndict = {}\nsum = 0\n\nfor i in range(N):\n try:\n dict[str[i]] += 1\n except KeyError:\n dict[str[i]] = 1\n\nfor i in dict.values():\n sum += (...
['Runtime Error', 'Accepted']
['s608471501', 's140983578']
[3060.0, 19404.0]
[17.0, 385.0]
[87, 233]
p02947
u102731033
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\ns = list(list(input())for i in range(N))\ncount = 1\nans = 0\ns.sort()\nfor i in range(0,N-1):\n if s[i] == s[i+1]:\n ans += count\n count += 1\n else:\n count = 1\nprint(ans)', 'N = int(input())\ns = list(list(input())for i in range(N))\ncount = 1\nans = 0\nfor i in range...
['Wrong Answer', 'Accepted']
['s373184731', 's460630567']
[24652.0, 24652.0]
[426.0, 492.0]
[209, 244]
p02947
u104442591
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nword = [input() for i in range(N)]\nsorted_word = [sorted(list(word[i])) for i in range(N)]\ndict_word = {sorted_word[i]:0 for i in range(N)}\ncount = 0\nans = 0\n\ndef sum_all(x):\n for i in range(x+1):\n y += i\n return y\n\nfor i in range(N):\n if sorted_word[i] in sorted_word[i+1:]:\n\tdic...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s234066134', 's430786971', 's469574833', 's909611777', 's398052711']
[2940.0, 3060.0, 10296.0, 2940.0, 17936.0]
[17.0, 17.0, 342.0, 19.0, 482.0]
[406, 224, 252, 283, 235]
p02947
u105302073
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\nd = {}\nfor s in S:\n new_s = "".join((sorted(s)))\n if new_s in d:\n d[new_s] += d[new_s]\n else:\n d[new_s] = 1\nprint(max(d.values()))\n', 'N = [int(i) for i in input().split()]\nS = []\nd = {}\nfor i in range(N):\n S.ap...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s060047497', 's141825710', 's962879132']
[24980.0, 3060.0, 24976.0]
[502.0, 17.0, 307.0]
[219, 240, 199]
p02947
u106778233
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(input())\nfrom collections import defaultdict\nd=defaultdict(str)\nfor _ in range(n):\n s=list(input())\n s.sort()\n n=''.join(s)\n d[n]+=1 \nans=0\nfor i in d:\n ans+=d[i]*(d[i]-1)//2\n\nprint(ans)\n ", 'n=int(input())\nfrom collections import defaultdict\nd=defaultdict(int)\nfor _ in range(n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s280545629', 's643632813', 's553681959']
[3316.0, 3316.0, 28296.0]
[20.0, 21.0, 179.0]
[212, 190, 246]
p02947
u107269063
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["import collections\nimport math\n \nN = int(input())\nwords = [input() for i in range(N)] \n \nans = 0\nL = []\nfor ix, word in enumerate(words):\n word_list = list(word)\n word_list.sort()\n L.append(''.join(map(str, word_list)))\n \nc = collections.Counter(L)\n \nfor i in c.values(): \n ans += math....
['Runtime Error', 'Runtime Error', 'Accepted']
['s379451798', 's963391320', 's571086338']
[26920.0, 26920.0, 17852.0]
[613.0, 645.0, 429.0]
[376, 372, 261]
p02947
u109266345
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from collections import defaultdict\n \nn = int(input())\nS = [input() for _ in range(n)]\n\nd = defaultdict(lambda: -1)\nfor i in range(n):\n s = ''.join(sorted(list(S[i])))\n d[s] += 1\n \nans = 0\nfor v in d.values():\n print(v)\n ans += v*(v+1)//2\nprint(ans)", "from collections import defaultdict\n \...
['Wrong Answer', 'Accepted']
['s145982707', 's464536236']
[25328.0, 25320.0]
[445.0, 380.0]
[261, 248]
p02947
u112007848
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = (int)(input())\ns = [sorted(list(input())) for i in range(n)]\n\n#print(*count)\n\nans = 0\nfor i in range(n - 1):\n for j in range(i + 1, n):\n if count[i] == count[j]:\n ans += 1\nprint(ans)', 'n = (int)(input())\ns = sorted([sorted(list(input())) for i in range(n)])\n \nans = 0\ntemp = 1\nfor i in ran...
['Runtime Error', 'Accepted']
['s138286986', 's335041363']
[24208.0, 26240.0]
[355.0, 549.0]
[195, 308]
p02947
u112581208
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['k, x = tuple([int(i) for i in input().split(\' \')])\n\nprint(" ".join([str(i) for i in range(x - k + 1, x + k)]))\n', "n = int(input())\n\ns = []\nfor _ in range(n):\n s.append(''.join(sorted(input())))\n\nd = {}\n\nfor e in s:\n if e in d:\n d[e] += 1\n else:\n d[e] = 1\n\nans = 0\nfor k, v ...
['Runtime Error', 'Accepted']
['s535555652', 's978609584']
[2940.0, 19404.0]
[18.0, 380.0]
[111, 242]
p02947
u115110170
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\nls = [''.join(sorted(input())) for j in range(n)]\nls = sorted(ls)\n\ns = ls[0]\ni = 1\ncount = 1\nans = 0\nwhile i < n:\n if ls[i] == s:\n count += 1\n i += 1\n if i == n-1:\n ans += count*(count-1)//2\n else:\n ans += count*(count-1)//2\n count = 1\n s = ls[i]\n i += 1\...
['Wrong Answer', 'Accepted']
['s623436032', 's655108315']
[11408.0, 11408.0]
[436.0, 422.0]
[311, 315]
p02947
u116233709
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(input())\nans=0\nfor i in range(0,n):\n s=input().split()\n s[i]=''.join(sorted(s))\n \nfor j in range(0,n-1):\n for k in range(j+1,n):\n if li[j]==li[k]:\n ans+=1\n else:\n ans+=0\n \nprint(ans) \n", 'n=int(input())\ns=list(map(input().split()))\nli=[0]*n\nans=0\nfor i in range(0,...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s426779058', 's478170506', 's544314811', 's707551084', 's801706231', 's853741784', 's874889312', 's932564496', 's430163754']
[3060.0, 3060.0, 3828.0, 10100.0, 3060.0, 3828.0, 3828.0, 3060.0, 17852.0]
[17.0, 18.0, 19.0, 2104.0, 17.0, 18.0, 18.0, 17.0, 375.0]
[220, 204, 246, 230, 233, 237, 205, 200, 198]
p02947
u121161758
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['x = list(map(str, input().split())) \n\nn = int(x[0]) \nz = x[1:] \n\n\ndef word_count(alphabet):\n res_dic = {}\n for i in alphabet:\n test = i in res_dic.keys() \n if test == False: \n res_dic[i] = 1\n elif test == True:\n plus = res_dic[i] + 1\n res_dic[i...
['Wrong Answer', 'Accepted']
['s454396121', 's700388618']
[3064.0, 23468.0]
[17.0, 385.0]
[757, 192]
p02947
u124735330
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["import sys\nfrom collections import deque\nsys.setrecursionlimit(20000000)\n\n\ndef main():\n n = int(input())\n s = [''.join(sorted(list(input()))) for _ in range(n)]\n\n ans = 0\n\n print(s)\n for a in range(len(s) - 1):\n for b in range(a + 1, len(s)):\n if s[a] == s[b]:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s215805731', 's250845674', 's563322697']
[14616.0, 14616.0, 18192.0]
[2104.0, 2104.0, 405.0]
[375, 375, 526]
p02947
u126823513
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import math\n\nn = int(input())\ndi = dict()\nanswer = 0\n\nfor i in range(n):\n tmp = str(sorted(input()))\n if di.get(tmp, 0) == 0:\n di[tmp] = 1\n else:\n di[tmp] += 1\n\nfor v in di.values():\n if v > 1:\n answer += (math.factorial(v) / 2)\nprint(answer)\n\n\n', 'import math\n\nn ...
['Runtime Error', 'Accepted']
['s522821543', 's635575317']
[21984.0, 21984.0]
[709.0, 539.0]
[278, 226]
p02947
u128539234
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nstrList = []\nfor i in range(N):\n strList.append(input())\n\ncount = 0\n\ndict = {}\n\nfor i in range(N):\n charList = list(strList[i])\n charList.sort()\n key = "".join(charList)\n if not key in dict:\n dict[key] = 1\n else:\n dict[key] += 1 \n\n\ncount = 0;\nfor v in dict.values():\n...
['Wrong Answer', 'Accepted']
['s743182270', 's944369570']
[24976.0, 24976.0]
[340.0, 352.0]
[388, 389]
p02947
u130900604
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\ns=[]\nfor i in range(n):\n s.append("".join(sorted(input())))\nss=set(s)\nans=0\nfor _ in ss:\n l=s.count(_)\n ans+=l*(l-1)/2\nprint(ans)\n', 'from collections import defaultdict\nd=defaultdict(int)\nn,*s=open(0).read().split()\nfor i in s:d["".join(sorted(list(i)))]+=1\nprint(sum(v*(v-1)//2 for v ...
['Wrong Answer', 'Accepted']
['s825704512', 's302339233']
[16332.0, 26760.0]
[2104.0, 247.0]
[148, 167]
p02947
u131411061
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\ns = list(input() for _ in range(N))\n\nl = list(map(sorted,s))\ncnt = 0\nfor i in range(N):\n for j in range(i+1,N:\n if(l[i] == l[j]):\n cnt += 1\nprint(cnt)\n', "d,a = {},0\nfor i in range(int(input())):\n k = ''.join(sorted(input()))\n d[k] = d.get(k,-1)+1\n a+= d[k]...
['Runtime Error', 'Accepted']
['s533014551', 's752533417']
[2940.0, 17848.0]
[17.0, 411.0]
[189, 120]
p02947
u131464432
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import collections\nN = int(input())\ns = ["".join(sorted(input())) for _ in range(N)]\nprint(A)\nB = collections.Counter(s)\nprint(sum(i*(i-1)//2 for i in B.values()))', 'import collections\nN = int(input())\ns = ["".join(sorted(input())) for _ in range(N)]\ns.sort()\nC = collections.Counter(s)\nD = C.most_common()\...
['Runtime Error', 'Accepted']
['s028151971', 's902621164']
[16548.0, 29164.0]
[196.0, 289.0]
[163, 202]
p02947
u131625544
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\ns = [input() for i in range(N)]\n\nfor i, s_i in enumerate(s):\n s_l = list(s_i)\n s_l.sort()\n a = ""\n for c in s_l:\n a += c\n s[i] = a\n\ncnt = 0\ncount_dict = {}\nfor j in range(N):\n count_dict[s[j]] = 0\nfor k in range(N):\n count_dict[s[k]] += 1\n\nfor v in count_...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s334038165', 's939866333', 's780829767']
[19476.0, 19472.0, 19476.0]
[454.0, 442.0, 489.0]
[384, 390, 1002]
p02947
u131634965
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\ns_list=[]\n\nfor _ in range(N):\n s_list.append(input())\n \ncount=0\nfor i in range(N):\n for j in range(i+1,N):\n s1=[]\n s2=[]\n for k in range(10):\n s1.append(s_list[i][k])\n s2.append(s_list[j][k])\n \n print(sorted(s1),sort...
['Wrong Answer', 'Accepted']
['s801126218', 's934771754']
[30364.0, 17852.0]
[2104.0, 379.0]
[379, 210]
p02947
u136090046
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\narray = [sorted(input()) for x in range(n)]\nset_array = set()\nfor i in array:\n set_array.add(i)\nprint(len(array) - len(set_array))\n', 'n = int(input())\narray = [sorted(input()) for x in range(n)]\nprint(len(array) - len(set(array)))', 'n = int(input())\narray = [sorted(input()) for x in range...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s501089920', 's753884738', 's929549856', 's997536168', 's526845126']
[24208.0, 24208.0, 24212.0, 24208.0, 19808.0]
[346.0, 316.0, 358.0, 322.0, 425.0]
[149, 96, 85, 80, 221]
p02947
u137226361
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\nans = 0\nls = {}\nfor _ in range(n):\n s = ''.join(sorted(input()))\n if s in ls:\n ans += ls[s]\n ls[s] += 1\n else:\n ls[s] = 1\nprint(ls)\nprint(ans)", "n = int(input())\nans = 0\nls = {}\nfor _ in range(n):\n s = ''.join(sorted(input()))\n if s in ls:\n ...
['Wrong Answer', 'Accepted']
['s040511653', 's098506271']
[23612.0, 22236.0]
[240.0, 227.0]
[189, 179]
p02947
u140191608
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["N = int(input())\nwords = dict()\ncount = 0\nfor i in range(N):\n s = ''.join(sorted(input()))\n if s in words:\n count += words[s]\n words[s] += 1\n else:\n words[s] = 1", 'N = int(input())\nsc = [list(input()) for i in range(N)]\nfor i in sc:\n i.sort()\ncount = 0\nfor i in range(0 ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s449067631', 's600313858', 's371065401']
[17852.0, 26256.0, 17852.0]
[380.0, 2105.0, 411.0]
[191, 205, 204]
p02947
u143612492
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\ns=[input().sort() for _ in range(n)]\ncnt=0\nfor i in range(n):\n for j in range(n):\n if i>=j:\n continue\n if s[i]==s[j]:\n cnt+=1\nprint(cnt)', "n=int(input())\ns=[''.join(sorted(input())) for _ in range(n)]\nans=0\ncnt={}\nfor i in range(n):\n if s[i] in cnt:\n cnt[s[i]]+=1\n ...
['Runtime Error', 'Accepted']
['s571933656', 's520088090']
[3060.0, 19404.0]
[17.0, 361.0]
[168, 205]
p02947
u149846622
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nD = {}\nfor _ in range(N):\n S = "".join(sorted(input()))\n if S in D:\n D[S] += 1\n else:\n D[S] = 1\n \nans = 0\nfor i in D.values():\n out += i-1\nprint(out)', 'N = int(input())\nD = {}\nfor _ in range(N):\n S = "".join(sorted(input()))\n if S in D:\n D[S] +...
['Runtime Error', 'Accepted']
['s222650184', 's386122511']
[17852.0, 17852.0]
[367.0, 388.0]
[192, 202]
p02947
u151037808
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['# -*- coding: utf-8 -*-\n\n\n\ndef main():\n # a, b\n n = int(input())\n s = []\n for _ in range(n):\n s.append(input())\n print(process(n, s))\n\n\ndef process(n, s):\n s = list(map(lambda s: \'\'.join(sorted(s)), s))\n hash = {}\n\n count = 0\n print(s[0])\n for i in range(0, n)...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s285935026', 's318407804', 's512595030', 's432518898']
[26632.0, 10268.0, 30308.0, 26640.0]
[310.0, 2104.0, 2104.0, 304.0]
[499, 705, 815, 483]
p02947
u151107315
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import itertools\n\nn = int(input())\ns_li = []\nfor i in range(n):\n s = input()\n s_i = {}\n for j in range(10):\n s_i[s[j]] = 0\n for j in range(10):\n s_i[s[j]] += 1 \n s_li.append(s_i)\n\nans = 0\n\nfor i in range(n):\n for j in range(n):\n if i >= j :\n conti...
['Wrong Answer', 'Accepted']
['s296097684', 's628786437']
[60884.0, 24976.0]
[2107.0, 357.0]
[390, 275]
p02947
u151785909
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\nx =[]\nch = 1\nans = 0\nfor i in range(n):\n s = list(input())\n s.sort()\n s = "".join(s)\n x.append(s)\nx.sort()\nx.append(\'X\')\nfor i in range(n):\n if x[i]==x[i+1]:\n ch+=1\n else:\n ans += ch*(ch-1)//2\n ch = 1\nprint(ans)\nprint(x)', 'n = int(input())\n...
['Wrong Answer', 'Accepted']
['s306668514', 's801816404']
[14628.0, 10612.0]
[454.0, 441.0]
[276, 267]
p02947
u152334204
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\nls = []\nl = [0 for i in range(n)]\nfor i in range(n):\n ls.append(input())\nfor i in range(n):\n for j in range(10):\n alpha = ord(ls[i][j]) - ord("a")\n l[i]+=10**alfa\nans = 0\nfor i in range(n):\n for j in range(i+1,n):\n if l[i] == l[j]:\n ans+=1\nprint(ans)\n', 'n = int(input(...
['Runtime Error', 'Accepted']
['s483275932', 's539116488']
[11040.0, 24980.0]
[147.0, 333.0]
[285, 242]
p02947
u152638361
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N =int(input())\ns = list(sorted(input()) for i in range(N))\n\ncnt = 0\nfor i in range(N):\n for j in range(i+1,N):\n if s[i]==s[j]:\n cnt+=1\n else: break\nprint(cnt)', 'N =int(input())\ns = list(sorted(input()) for i in range(N))\ncnt = 0\nfor i in range(N):\n for j in range(N):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s192877262', 's359468817', 's560248044']
[24212.0, 26256.0, 23440.0]
[2105.0, 2105.0, 382.0]
[187, 168, 195]
p02947
u153094838
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Aug 10 23:27:57 2019\n\n@author: doppe\n"""\n\nA = int(input())\nS = []\nfor i in range (0, A):\n S.append(input())\n\nans = 0\ngroupList = []\ngroupDict = {}\n\nans = 0\nfor i in range(0, len(S)):\n a = list(S[i])\n a.sort()\n b = \'\'.join(a)\n if b in gro...
['Wrong Answer', 'Accepted']
['s435426256', 's670319298']
[24976.0, 24980.0]
[338.0, 341.0]
[448, 454]
p02947
u155667931
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from collection import Counter\nN = int(input())\nc = Counter(''.join(sorted(input())) for _ in range(N))\nsum_ = lambda n: int(n*(n-1)/2)\nprint(sum(map(sum_,c.values())))", "from collections import Counter\nN = int(input())\nc = Counter(''.join(sorted(input())) for _ in range(N))\nsum_ = lambda n: int(n*(n-1)/2)\np...
['Runtime Error', 'Accepted']
['s989993747', 's235520381']
[2940.0, 18228.0]
[18.0, 371.0]
[168, 169]
p02947
u155687575
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\nN = int(input())\nslist = [Counter(input()) for _ in range(N)]\nprint(slist)\n\ncount = 0\nfor i in range(N):\n for j in range(i+1, N):\n print(slist[i], slist[j])\n if slist[i] == slist[j]:\n count += 1\nprint(count)', "from collections import Counter\nN =...
['Wrong Answer', 'Accepted']
['s614791112', 's153819005']
[77168.0, 19764.0]
[2107.0, 351.0]
[267, 254]
p02947
u158778550
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\n \nn = int(input())\naL = [set(Counter(input()).most_common()) for i in range(n)]\ncount = 0\n \nfor i in range(n-1):\n for j in range(i+1, n):\n if aL[i] == aL[j]:\n tmp = aL.count(aL[i])\n count += (tmp-1)*(tmp-2)//2\n aL[j] = 0\n \nprint(count)'...
['Wrong Answer', 'Accepted']
['s568434023', 's837520170']
[131344.0, 25300.0]
[2112.0, 417.0]
[304, 231]
p02947
u160064368
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from scipy.misc import comb\n\n\ndef resolve():\n n = int(input())\n ss = []\n for i in range(n):\n ss.append(input())\n\n sorted_ss = list(map("".join, map(sorted, ss)))\n dic = {}\n\n for s in sorted_ss:\n dic[s] = dic.get(s, 0) + 1\n\n count = 0\n for key in dic.keys():\n ...
['Wrong Answer', 'Accepted']
['s666328483', 's724584930']
[37444.0, 17888.0]
[2111.0, 399.0]
[363, 263]
p02947
u160244242
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\nlst = [input() for _ in range(n)]\n\ncounter_lst = []\ncounter_num = [0] * n\nfor i in range(n):\n a = Counter(lst[i])\n if a in counter_lst:\n m = counter_lst.index(a)\n counter_num[m] += 1\n counter_lst.append(0)\n else:\n counter_lst.append(a)\n counter...
['Runtime Error', 'Accepted']
['s567292292', 's624898089']
[11036.0, 24980.0]
[139.0, 337.0]
[406, 287]
p02947
u160861278
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import collections\nn = int(input())\ns = collections.Counter(["".join(sorted(input())) for _ in range(n)]).most_common()\nprint(s)\ncnt = 0\nfor i in s:\n for j in range(1, i[1]):\n cnt += j\nprint(cnt)', 'import collections\nn = int(input())\ns = collections.Counter(["".join(sorted(input())) for _ in rang...
['Wrong Answer', 'Accepted']
['s635488127', 's894488251']
[23708.0, 23708.0]
[426.0, 389.0]
[205, 206]
p02947
u163320134
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\ndic={}\nfor _ in range(n):\n s=input()\n s=sorted(s)\n if s not in dic:\n dic[s]=1\n else:\n dic[s]+=1\nans=0\nfor val in dic.values():\n ans+=val*(val-1)//2\nprint(ans)', "import collections\n\nn=int(input())\narr=[input() for _ in range(n)]\ndic={}\nfor s in arr:\n count=[0]*26\n tmp=co...
['Runtime Error', 'Accepted']
['s550125108', 's898495572']
[3060.0, 43376.0]
[17.0, 1388.0]
[184, 349]
p02947
u163829702
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["N = int(input())\ns = []; count = 0\nfor i in range(N):\n spell = ''.join(sorted(input()))\n if spell in s:\n \n s.append(spell)\n\nprint(count)", "N = int(input())\ns = []; count = 0\nfor i in range(N):\n spell = ''.join(sorted(input()))\n '''\n if spell in s:\n \n count += int...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s002632336', 's393483604', 's878457295']
[10208.0, 10208.0, 17852.0]
[2104.0, 323.0, 448.0]
[204, 209, 258]
p02947
u167647458
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["def main():\n n = int(input())\n s = [input() for _ in range(n)]\n d = []\n ans = 0\n for ss in s:\n c = collections.Counter(ss)\n d.append(c)\n for i in range(n):\n for j in range(i + 1, n):\n if d[i] == d[j]:\n ans += 1 \n print(ans) ...
['Runtime Error', 'Accepted']
['s494223479', 's909397035']
[10268.0, 17852.0]
[145.0, 369.0]
[358, 298]
p02947
u169138653
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(input())\ns=[input() for i in range(1,n+1)]\ndic={}\nl=list()\ncnt=0\nfor i in range(n):\n s[i].sort()\n s=''.join(s[i])\n l.append(s)\n if l[i] in dic:\n cnt+=1\n else:\n dict[l[i]]=1\nprint(cnt)", "n=int(input())\ns=[input() for i in range(n)]\ndic={}\nl=list()\ncnt=0\nfor i in range(n):\n k=sorte...
['Runtime Error', 'Accepted']
['s467432905', 's003742347']
[10268.0, 25640.0]
[140.0, 366.0]
[200, 272]
p02947
u169696482
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["# Green Bin\nn = int(input())\ns = [input() for i in range(n)]\nm = 0\nlist = {}\nfor i in s:\n i = ' '.join(sorted(i))\n print(i)\n if i in list:\n list[i] = list[i] + 1\n else:\n list[i] = 1\nfor i in list.values():\n l = i -1\n m = m + int(((l * (l + 1)) / 2))\nprint(m)", "n = int(input())\ns = [input(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s395107439', 's470608255', 's846470378']
[27488.0, 10268.0, 25748.0]
[412.0, 2104.0, 333.0]
[270, 145, 259]
p02947
u172296140
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from scipy.special import comb\nN=int(input())\ndic={}\nans=0\nfor i in range(N):\n s=list(input())\n s.sort()\n S=''.join(s)\n if S not in dic:\n dic[S]=1\n else:\n dic[S]+=1\nfor v in dic.values():\n if v>=2:\n ans+=int(comb(v,2))\nprint(dic)", "N=int(input())\ndic={}\nans=0\n...
['Runtime Error', 'Accepted']
['s161149424', 's732623260']
[14432.0, 17932.0]
[181.0, 386.0]
[268, 234]
p02947
u175590965
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\ns = [input()for i in range(n)]\nd = {}\nans = 0\nfor j in s:\n ss = "".join(sorted(s))\n if ss in d:\n d[ss] += 1\n ans += d[ss]\n else:\n d[ss] = 0\nprint(ans)', 'from collections import Counter\nn = int(input())\ns = [str(sorted(input()))for _ in range(n)]\n\nc = Coun...
['Wrong Answer', 'Accepted']
['s120357917', 's641412892']
[14268.0, 24560.0]
[2104.0, 483.0]
[197, 170]
p02947
u176445062
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import math\nfrom collections import Counter, defaultdict\n\ndef ncr(n, r):\n\tf = math.factorial\n\treturn f(n)//f(r)//f(n-r)\n\nn = int(input())\n\ndct = defaultdict(int)\n\nfor i in range(n):\n\tcounter = Counter(input().strip())\n\ttpl = tuple(sorted(counter.items()))\n\tdct[tpl] += 1\nans = sum(ncr(val, 2) for v...
['Runtime Error', 'Accepted']
['s903576230', 's479111850']
[74736.0, 74768.0]
[1676.0, 1534.0]
[329, 305]
p02947
u176674210
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["# -*- coding:utf8 -*-\nimport math\n\nn = int(input())\ns = [input() for _ in range(n)]\ns = [''.join(sorted(i)) for i in s]\nc = [math.factorial(s.count(i)) for i in set(s)]\nprint(sum(c)/2)", "# -*- coding:utf8 -*-\nimport math\n\nn = int(input())\ns = [input() for _ in range(n)]\ns = [''.join(sorted(i)) for i in s...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s345598417', 's536320021', 's688858487', 's827429167', 's360660228']
[17620.0, 17496.0, 17496.0, 17308.0, 20332.0]
[2105.0, 2104.0, 2105.0, 266.0, 289.0]
[184, 230, 203, 229, 242]
p02947
u178789680
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n = int(input())\n\ns = []\nfor i in range(n):\n s.append(sorted(input())\n\nprint(n - len(set(s)))', 'import collections \n\nn = int(input())\n\ns = []\nfor i in range(n):\ns.append(str(sorted(input())))\n\ndef f(a):\n if a == 0:\n return 1\n else:\n return a * f(a - 1)\n \ncnt = 0\nfor (c, m) in collecti...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s013686520', 's023142860', 's310883221', 's404680126', 's654245055', 's664995555', 's472325703']
[2940.0, 2940.0, 2940.0, 24548.0, 24548.0, 24212.0, 24548.0]
[17.0, 17.0, 17.0, 490.0, 510.0, 333.0, 543.0]
[94, 286, 304, 199, 198, 95, 199]
p02947
u183657342
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\nn = int(input())\nS = [str(sorted(input())) for _ in range(N)]\n\nprint(sum(map(lambda x: x * (x - 1) // 2, Counter(S).values())))', 'from collections import Counter\nn = int(input())\nS = [str(sorted(input())) for _ in range(n)]\n\nprint(sum(map(lambda x: x * (x - 1) // 2, Counter(S)...
['Runtime Error', 'Accepted']
['s309663138', 's645881157']
[3316.0, 24560.0]
[20.0, 479.0]
[159, 159]
p02947
u183896397
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nX =[]\nfor i in range(N):\n Y =list(input())\n Y.sort()\n X.append(Y)\nX.sort()\n \nans = 0\ncount = 1 \nfor i in range(N-1):\n if X[i] == X[i+1]:\n count += 1\n else:\n if count != 1:\n Z = 1/2\n for i in range(1,count+1):\n Z = Z...
['Wrong Answer', 'Accepted']
['s882293806', 's635297240']
[24652.0, 24652.0]
[513.0, 510.0]
[457, 456]
p02947
u185325486
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nS = [sorted(input()) for _ in range(N)]\nstrDict = {}\ncount = 0\n\nfor s in S:\n s = s[0]\n if s not in strDict:\n strDict[s] = 1\n else:\n strDict[s] += 1\n \nfor i in strDict.keys():\n n = strDict[i]\n count += n*(n-1)//2\nprint(count)', 'N = int(input())\nstr_unio...
['Wrong Answer', 'Accepted']
['s043970854', 's792855796']
[24336.0, 26040.0]
[341.0, 512.0]
[273, 297]
p02947
u185935459
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['\nN = int(input())\nD = {}\nL = [[]for _ in range(N)]\ncount = 0\nfor i in range(N):\n L[i] = list(input())\n L[i].sort()\n L[i] = tuple(L[i])\n if L[i] in D:\n D[L[i]] = D[L[i]] + 1\n else:\n D[L[i]] = 1\nfor key in D:\n if D[key] != 1:\n count += D[key]\n\nprint(count)\n', '\n...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s033249796', 's135023842', 's207844460', 's354035698', 's557800029', 's789468763', 's877870967']
[25248.0, 25248.0, 3064.0, 25224.0, 25224.0, 25248.0, 25860.0]
[491.0, 478.0, 17.0, 479.0, 481.0, 512.0, 532.0]
[294, 330, 468, 328, 269, 291, 642]
p02947
u188138642
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\nn = int(input())\ns = [tuple(sorted(list(input()))) for _ in range(n)]\nans = 0\nst = []\ncount = {}\n\nfor i in range(n):\n if not s[i] in st:\n st += [s[i]]\n count[s[i]] = 0\n\nfor i in range(n):\n if s[i] in st:\n ans += count[s[i]]\n count[s[i]] ...
['Wrong Answer', 'Accepted']
['s493763000', 's284366809']
[23884.0, 30556.0]
[2206.0, 245.0]
[308, 174]
p02947
u189594456
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from itertools import groupby\nn=int(input())\nl=[]\nfor _ in range(n):\n s=input()\n s=''.join(sorted(s))\n l.append(s)\nl.sort()\nc=0\nfor i,j in groupby(l):\n z=len(list(j))\n c=c+(z*(z-1)/2)\nprint(c)", "from itertools import groupby\nn=int(input())\nl=[]\nfor _ in range(n):\n s=input()\n s=''.join(sorted(...
['Wrong Answer', 'Accepted']
['s603914114', 's593519474']
[11092.0, 11092.0]
[446.0, 448.0]
[197, 198]
p02947
u189806337
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import collections\nn = int(input())\ns = [0]*n\nc = {}\nT = [0]*n\nans = 0\nfor i in range(n):\n\ts[i] = input()\n\tc[i] = collections.Counter(list(s[i]))\n\tT[i] = str(c[i])\nD = collections.Counter(T)\nfor i in D.values():\n\tans += i*(i-1)/2\nprint(int(ans))', 'import collections\nn = int(input())\ns = [0]*n\nc =...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s116694056', 's293493395', 's761415061', 's859517601']
[86716.0, 95336.0, 95336.0, 26972.0]
[2109.0, 2109.0, 2109.0, 412.0]
[245, 241, 240, 212]
p02947
u193598069
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\ns = []\ncnt = 0\n\nfor i in range(N):\n s.append(input())\n\nfor i in range(N):\n for j in range(i+1, N):\n for k in range(len(s[i])):\n tmp = s[i]\n tmp = tmp.replace(s[j][k], "")\n if tmp == "":\n cnt += 1\n else:\n continue\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s621202740', 's663222795', 's682252143']
[10268.0, 2940.0, 17892.0]
[2104.0, 17.0, 397.0]
[325, 326, 200]
p02947
u195177386
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['\n\nusing namespace std;\n\nint main(void) {\n int N;\n cin >> N;\n \n vector<string> v;\n string s;\n for(int i=0; i<N; i++) {\n cin >> s;\n v.push_back(s);\n }\n\n for(int i=0; i<v.size(); i++) {\n sort(v[i].begin(), v[i].end());\n }\n\n int result = 0;\n for(in...
['Runtime Error', 'Runtime Error', 'Accepted']
['s010521122', 's638643584', 's895072514']
[2940.0, 2940.0, 19404.0]
[17.0, 17.0, 349.0]
[473, 477, 203]
p02947
u196675341
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import math\n\nn = int(input())\ns = [0]*n\nans = {}\nans_v = 0\n\nfor i in range(n):\n s[i] = "".join(sorted(list(input())))\n \ns_set = set(s)\n\nfor i in s_set:\n ans[i] = 0\n \nfor i in s:\n ans[i] += 1\n\nfor j in ans.values():\n if j >= 2:\n ans_v += math.factorial(j) /( (math.factorial...
['Wrong Answer', 'Accepted']
['s899978015', 's305887718']
[26500.0, 26500.0]
[775.0, 791.0]
[344, 349]
p02947
u201387466
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import sys\ninput=sys.stdin.readline\n#import math\nimport collections\n#from collections import deque\n\nN = int(input())\n#S = input()[:-1]\n#N,M = map(int,input().split())\n#S,T = map(str,input().split())\n#A = list(map(int,input().split()))\n#A = [int(input()) for _ in range(N)]\n#S = [input() for _ in range(N)]\...
['Wrong Answer', 'Accepted']
['s030113458', 's495349156']
[23908.0, 23908.0]
[331.0, 346.0]
[655, 616]
p02947
u202570162
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\nl = []\nfor i in range(n):\n l.append(input())\n\n\nfor i in range(n):\n l[i] = ''.join(sorted(l[i]))\n \n\n\nl.sort()\n\n\nflag = 0\nfor i in range(n-1):\n if l[i] == l[i+1]:\n flag == flag + 1\n\nprint(flag)", "N = int(input())\nS = sorted(''.join(sorted(list(input()))) for i i...
['Wrong Answer', 'Accepted']
['s752508241', 's666724362']
[10584.0, 15224.0]
[372.0, 473.0]
[291, 394]
p02947
u204208382
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\ninfo=[]\nfor i in range(n):\n info.append(list(input()))\n \nfor i in range(n):\n info[i].sort()\n \n \nans=0\nfor i in range(n):\n for j in range(n-i-1):\n if info[i]==info[i+j+1]:\n ans+=1\n \nprint(ans)\nprint(info)', 'n = int(input())\nnote = dict()\nfor i in range(n):\n s = ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s085616520', 's557871116', 's362725316']
[24208.0, 17848.0, 17808.0]
[2105.0, 383.0, 254.0]
[237, 304, 254]
p02947
u207539104
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["from collections import Counter\n\nn = int(input())\ns = []\nfor i in range(n):\n s.append(''.join(sorted(input())))\n \nv = list(Counter(s).values())\nans = []\nfor i in range(len(v)):\n if v[i] >= 2:\n ans.append((v[i] * (v[i]-1))/2)\n\nprint(sum(ans))", "from collections import Counter\n\nn = int(i...
['Wrong Answer', 'Accepted']
['s204920871', 's143547830']
[19764.0, 19760.0]
[352.0, 362.0]
[257, 262]
p02947
u210827208
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\ns=[]\nfor i in range(n):\n x=input()\n y=[]\n for j in x:\n y.append(j)\n y.sort()\n s.append(y)\ncnt=0\nfor i in range(n):\n for j in range(n):\n if s[i]==s[j]:\n cnt+=1\nprint(cnt)', "n=int(input())\ns=[]\nfor i in range(n):\n x=input()\n y=[]\n fo...
['Wrong Answer', 'Accepted']
['s689806798', 's346962435']
[26228.0, 19484.0]
[2105.0, 479.0]
[227, 303]
p02947
u213868052
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["\nN = input()\nstrings = []\nfor i in range(N):\n strings.append(input())\n\n\nstrings = [''.join(sorted(s)) for s in strings]\nstrings.sort()\n\nfor s in strings:\n print(s)\n\n\nhashMap = {}\nfor string in strings:\n if string not in hashMap:\n hashMap[str(string)] = 1\n else:\n hashMap[st...
['Runtime Error', 'Accepted']
['s909715930', 's057690934']
[3064.0, 19852.0]
[18.0, 387.0]
[410, 381]
p02947
u219197917
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import defaultdict\nfrom itertools import combinations\nimport sys\ninput = sys.stdin.readline\n\nn = int(input())\ns = [input().split()[0] for _ in range(n)]\ncnt = defaultdict(int)\nfor i in range(n):\n s[i].sort()\n cnt["".join(s[i])] += 1\nresult = 0\nfor c in cnt:\n result += len(list(c...
['Runtime Error', 'Accepted']
['s046762677', 's859033910']
[10592.0, 25328.0]
[60.0, 279.0]
[350, 270]
p02947
u221280246
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import collections\n\nN = int(input())\ns = ["".join(sorted(input())) for _ in range(N)]\nc = collections.Counter(s)\nprint(s)\nans = 0\nfor si in set(s):\n n = c[si]\n ans += n * (n - 1) // 2\nprint(ans)', 'import collections\n\nN = int(input())\ns = ["".join(sorted(input())) for _ in range(N)]\nc = collection...
['Wrong Answer', 'Accepted']
['s452588048', 's512942401']
[24752.0, 19760.0]
[386.0, 348.0]
[200, 165]
p02947
u222138979
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import bisect\nn = int(input())\nwords = []\ncount = 1\ntotal = 0\nfor i in range(n):\n s = sorted(input())\n bisect.insort_right(words, s, lo=0, hi=len(words))\nprint(words)\nfor i in range(1,n):\n if words[i-1] == words[i]:\n count += 1\n elif count != 1:\n total += int(count * (count-1)/2...
['Wrong Answer', 'Accepted']
['s965406069', 's569447266']
[39436.0, 15812.0]
[2105.0, 407.0]
[446, 713]
p02947
u222668979
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n=int(input())\ns=[''.join(sorted(input())) for i in range(n)]\nans=0\ndict={}\nfor i in s:\n if i in dict:\n ans+=dict[s]\n dict[s]+=1\n else:\n dict[s]=1\nprint(ans)", "n=int(input())\ns=[''.join(sorted(input())) for i in range(n)]\nans=0\ndict={}\nfor i in s:\n if i in dict:\n ...
['Runtime Error', 'Accepted']
['s251556349', 's891498129']
[10208.0, 19400.0]
[318.0, 354.0]
[184, 184]
p02947
u223904637
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['n=int(input())\nli=[]\nfor i in range(n):\n s=list(input())\n s.sorted()\n li.append(s)\nli.sorted()\n\nans=0\nf=1\nfor i in range(n-1):\n if li[i]==li[i+1]:\n f+=1\n else:\n ans+=f*(f-1)//2\n f=1\nprint(ans+f*(f-1)//2)', 'n=int(input())\nli=[]\nfor i in range(n):\n s=list(input...
['Runtime Error', 'Accepted']
['s320915040', 's748945332']
[3064.0, 26256.0]
[17.0, 575.0]
[239, 236]
p02947
u224554402
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['from collections import Counter\nn = int(input())\ncount =0\nstore_list=[]\nans_list=[1]*n\nfor _ in range(n):\n s = input()\n dict_s =Counter(s)\n #print(dict_s)\n if dict_s in store_list:\n a = store_list.index(dict_s)\n #print(a)\n #print(dict_s)\n ans_list[a] += 1\n else...
['Wrong Answer', 'Accepted']
['s530439679', 's602776056']
[15224.0, 28548.0]
[2206.0, 277.0]
[443, 339]
p02947
u225020286
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['import collections\nN=int(input())\nS=[list(input()) for i in range(N)]\nx=[]\nfor i in S:\n a=collections.Counter(i)\n a=sorted(a)\n x.append(a)\nx=list(map(list,set(map(tuple,x))))\nprint(N-len(x)+1)', 'import collections\nN=int(input())\ns=[input() for i in range(N)]\nS=[]\nans=0\nfor i in s:\n a=sorted(i)\n ...
['Wrong Answer', 'Accepted']
['s829464146', 's104845520']
[79140.0, 26960.0]
[1150.0, 320.0]
[195, 231]
p02947
u225388820
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N=int(input())\nl=[]\nfor x in range(0,N):\n l.append(input())\nfor x in range(0,N):\n l[x]=sorted(list(l[x]))\nl=sorted(l)\ni=0\nx=0\ny=0\nwhile i<N:\n for j in range(i+1,N):\n if l[i]==l[j]:\n x=x+1\n else:\n y=y+sum(range(1,x+1))\n i=i+x\n x=0\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s271954397', 's745557777', 's827305278', 's886778252', 's624369876']
[25432.0, 24092.0, 25432.0, 26300.0, 10584.0]
[2105.0, 344.0, 2105.0, 2105.0, 377.0]
[333, 315, 331, 315, 287]
p02947
u225577738
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["N = int(input())\ns = []\nfor i in range(N):\n s.append(''.join(sorted(input())))\n\nans = 0\nfor i in range(N):\n for j in range(i+1, N):\n print(i, j)\n if s[i] == s[j]:\n ans += 1\nprint(ans)\n", "N = int(input())\ns = [''.join(sorted(input())) for i in range(N)]\n\nans = 0\nd = {}\n...
['Wrong Answer', 'Accepted']
['s203966028', 's556338627']
[22964.0, 19460.0]
[2104.0, 349.0]
[215, 186]
p02947
u225806616
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["# coding: utf-8\n\nn = int(input())\nwords = {}\nans = 0\n\nfor i in range(n):\n t = ''.join(sorted(input()))\n if t in words:\n ans += words[t]\n words[t] += 1\n else:\n words[t] += 1\n \nprint(ans)", "# coding: utf-8\n\nn = int(input())\nwords = {}\nans = 0\n\nfor i in range(n):\n t = ''.join(sorted...
['Runtime Error', 'Accepted']
['s545432746', 's601808140']
[3060.0, 17852.0]
[18.0, 378.0]
[200, 199]
p02947
u226912938
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
['N = int(input())\nS = []\nfor n in range(N):\n S.append(str(input()))\n\n#N = 2\n\n\nY=[]\nfor s in S:\n X = []\n for w in s:\n X.append(w)\n X.sort()\n Y.append(X)\n\nans_d = 0\n\nfor n in range(N):\n for i in range(N):\n if i == n:\n pass\n else:\n if...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s177446109', 's627020039', 's863132991', 's993946776']
[33308.0, 38336.0, 39800.0, 31680.0]
[2106.0, 1144.0, 1648.0, 1161.0]
[433, 541, 613, 517]
p02947
u227585789
2,000
1,048,576
We will call a string obtained by arranging the characters contained in a string a in some order, an _anagram_ of a. For example, `greenbin` is an anagram of `beginner`. As seen here, when the same character occurs multiple times, that character must be used that number of times. Given are N strings s_1, s_2, \ldots,...
["n = int(input())\nd = {}\nans = 0\nfor _ in range(n):\n s = ''.join(sorted(input()))\n print(s) \n if s in d.keys():\n d[s] += 1;\n ans += d[s]\n else:\n d.setdefault(s,0)\nprint(ans)", "n = int(input())\ns = [list(input()) for _ in range(n)]\nans = 0\nsd = dict([])\n\nfor i in s:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s626107759', 's726961236', 's911032468']
[22008.0, 36992.0, 37040.0]
[459.0, 269.0, 294.0]
[205, 231, 227]