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
p03126
u812587837
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['###B - Foods Loved by Everyone\nN, M = map(int, input().split())\nkaito = []\nfor i in range(N):\n kaito.append(list(map(int, input().split())))\n\ncnt = 0\nfor i in range(1, M+1):\n jlist = []\n for j in range(N):\n if i in kaito[j]:\n jlist.append(True)\n else:\n jlist.append(False)\n if all(jlist):\n cnt += 1\nprint(cnt)', '###B - Foods Loved by Everyone\nN, M = map(int, input().split())\nkaito = []\nfor i in range(N):\n kaito.append([int(i) for i in input().split()])\n\nprint(kaito)\ncnt = 0\nfor i in range(1, M+1):\n jlist = []\n for j in range(N):\n print(i,j)\n if i in kaito[j][1:]:\n jlist.append(True)\n else:\n jlist.append(False)\n if all(jlist):\n cnt += 1\n print(jlist)\nprint(cnt)', '###B - Foods Loved by Everyone\nN, M = map(int, input().split())\nkaito = []\nfor i in range(N):\n kaito.append([int(i) for i in input().split()])\n\ncnt = 0\nfor i in range(1, M+1):\n jlist = []\n for j in range(N):\n if i in kaito[j][1:]:\n jlist.append(True)\n else:\n jlist.append(False)\n if all(jlist):\n cnt += 1\n \nprint(cnt)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s118218574', 's631462710', 's829930421']
[3060.0, 3316.0, 3060.0]
[18.0, 20.0, 19.0]
[364, 419, 379]
p03126
u813450934
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n, m = list(map(int, input().split()))\na = []\nfor i in range(n) :\n a.extend(list(map(int, input().split()))[1:])\nprint(a)\nb = []\nfor i in range(1, m + 1) :\n if a.count(i) == n :\n b.append(i)\nprint(len(b))\n', 'n, m = list(map(int, input().split()))\na = []\nfor i in range(n) :\n a.extend(list(map(int, input().split()))[1:])\nb = []\nfor i in range(1, m + 1) :\n if a.count(i) == n :\n b.append(i)\nprint(len(b))\n']
['Wrong Answer', 'Accepted']
['s143414066', 's878188143']
[3060.0, 3060.0]
[19.0, 17.0]
[218, 209]
p03126
u814986259
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['import collections\nN,M=map(int,input().split())\n\ncounter=collections.defaultdict\nfor _ in range(N):\n text = list(input().split())\n for x in text[1:]:\n counter[x]+=1\nans=0\nfor _ in counter:\n if counter[x]== N:\n ans+=1\nprint(ans)', 'import collections\nN,M=map(int,input().split())\n\ncounter=collections.defaultdict(int)\nfor _ in range(N):\n text = list(input().split())\n for x in text[1:]:\n counter[x]+=1\nans=0\nfor _ in counter:\n if counter[x]== N:\n ans+=1\nprint(ans)', 'import collections\nN,M=map(int,input().split())\n\ncounter=collections.defaultdict(int)\nfor _ in range(N):\n text = list(input().split())\n for x in text[1:]:\n counter[x]+=1\nans=0\nfor x in counter:\n if counter[x]== N:\n ans+=1\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s110045437', 's821894324', 's731345096']
[3316.0, 3316.0, 3316.0]
[21.0, 21.0, 21.0]
[236, 241, 241]
p03126
u818724291
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m = map(int,input().split())\na = []\nfor i in range(n):\n a.append(list(map(int,input().split())))\n\nb = [x[1:] for x in a ]\n\nc = []\nfor j in range(1,31):\n for k in range(n):\n if j in b[k]:\n c.append(j)\n\nd = [x for x in set(c) if c.count(x) == n]', 'n,m = map(int,input().split())\na = []\nfor i in range(n):\n a.append(list(map(int,input().split())))\n\nb = [x[1:] for x in a ]\n\nc = []\nfor j in range(1,31):\n for k in range(n):\n if j in b[k]:\n c.append(j)\n\nd = [x for x in set(c) if c.count(x) == n]\n\nprint(len(d))']
['Wrong Answer', 'Accepted']
['s666336128', 's468704517']
[3064.0, 3064.0]
[18.0, 18.0]
[269, 284]
p03126
u819710930
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int,input().split())\nlike=[]\nfor i in range(n):\n like+=list(map(int,input().split()))\nans=0\nfor i in range(1,m+1):\n if like.count(i)==n:\n ans+=1\nprint(ans)', 'n,m=map(int,input().split())\nlike=[]\nfor i in range(n):\n like+=list(map(int,input()))\nprint(len(set(like)))', 'n,m=map(int,input().split())\nlike=[]\nfor i in range(n):\n k,*a=map(int,input().split())\n like+=a\nans=0\nfor i in range(1,m+1):\n if like.count(i)==n:\n ans+=1\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s219304354', 's362582016', 's652426815']
[3060.0, 2940.0, 3060.0]
[18.0, 17.0, 18.0]
[176, 110, 181]
p03126
u821775079
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M = map(int,input().split())\nK=[]\nans=0\nfor _ in range(N):\n K+=[input().split()]\nS=set(K)\nfor s in S:\n if K.count(s)==N:\n ans+=1\nprint(ans)', 'N,M = map(int,input().split())\nK=[]\nans=0\nfor _ in range(N):\n K+=input().split()[1:]\nS=set(K)\nfor s in S:\n if K.count(s)==N:\n ans+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s632791732', 's987250282']
[3060.0, 3188.0]
[17.0, 19.0]
[146, 148]
p03126
u827141374
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split())\n\nfrom collections import defaultdict\nfav = defaultdict(int)\nfor i in range(N):\n KA = list(map(int, input().split()))\n for i in range(1, KA[0]+1):\n fav[str(KA[i])] += 1\n\nfor i in sorted(fav.keys()):\n if fav[i] == N:\n print(i)', 'N, M = map(int, input().split())\n\nfrom collections import defaultdict\nfav = defaultdict(int)\nfor i in range(N):\n KA = list(map(int, input().split()))\n for i in range(1, KA[0]+1):\n fav[str(KA[i])] += 1\n\nans = 0\nfor i in fav.keys():\n if fav[i] == N:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s884766183', 's417018695']
[3316.0, 3316.0]
[21.0, 21.0]
[280, 291]
p03126
u830054172
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n, m = list(map(int,input().split()))\nk = [list(map(int,input().split())) for i in range(n)]\n\ndic = {}\nfor i in range(n):\n for j in range(1, k[i][0]+1):\n if k[i][j] in dic:\n dic[k[i][j]] += 1\n else:\n dic[k[i][j]] = 1\n\nprint(dic)\nans = 0\nfor i in dic.values():\n if n == i:\n ans += 1\nprint(ans)', 'n, m = list(map(int,input().split()))\nk = [list(map(int,input().split())) for i in range(n)]\n\ndic = {}\nfor i in range(n):\n for j in range(1, k[i][0]+1):\n if k[i][j] in dic:\n dic[k[i][j]] += 1\n else:\n dic[k[i][j]] = 1\n\nans = 0\nfor i in dic.values():\n if n == i:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s310738094', 's084523496']
[3064.0, 3064.0]
[18.0, 17.0]
[341, 330]
p03126
u831328139
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['import sys\n\nv = []\nfor line in sys.stdin:\n v.append([int(l) for l in line.split()])\n\nn, m = v[0]\nmin_k = -1\nmin_idx = -1\nfor idx, line in enumerate(v[1:]):\n if min_k == -1 or min_k > line[0]:\n min_k = line[0]\n min_idx = idx + 1\n\ncount = 0\nmin_v = line[min_idx, 1:]\nfor min_v_v in min_v:\n\tif n == sum(min_v_v in v[1:,1:]):\n count+=1\nprint(count)', 'import sys\n\nv = []\nfor line in sys.stdin:\n v.append([int(l) for l in line.split()])\n\nn = v[0][0]\nm = v[0][1]\n\na = None\nfor line in v[1:]:\n if a == None:\n a = line[1:]\n else:\n c = []\n for b in a:\n if b in line[1:]:\n c.append(b)\n a = c\nprint(len(a))']
['Runtime Error', 'Accepted']
['s044454920', 's639182969']
[3064.0, 3064.0]
[17.0, 18.0]
[357, 276]
p03126
u833492079
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M = map(int, input().split())\n\nA=[]\nfor i in range(N):\n x = [int(i) for i in input().split()]\n A = A + x[1:]\n\nans = 0\nfrom collections import Counter\nfor k,v in Counter(A).items():\n print(k,v)\n if v==N: ans += 1\n\nprint(ans)\n', 'N,M = map(int, input().split())\n\nA=[]\nfor i in range(N):\n x = [int(i) for i in input().split()]\n A = A + x[1:]\n\nans = 0\nfrom collections import Counter\nfor k,v in Counter(A).items():\n # print(k,v)\n if v==N: ans += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s917756965', 's680138112']
[9500.0, 9460.0]
[31.0, 29.0]
[230, 232]
p03126
u834153484
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split())\nList = list(range(1,M))\nanser = []\ndef judge(N,M,List,anser):\n for i in range(N):\n L = list(map(int, input().split()))\n anser.extend(L)\n anser = list(set(anser))\n print(anser)\n print(M - len(anser))\njudge(N,M,List,anser)\n ', 'N, M = map(int, input().split())\nList = list(range(1,M))\nanser = []\ndef judge(N,M,List,anser):\n for i in range(N):\n L = list(map(int, input().split()))\n anser.extend(L)\n anser = list(set(anser))\n print(anser)\n print(len(anser))\njudge(N,M,List,anser)', 'N, M = map(int, input().split())\nList = list(range(1,M))\nanser = []\ndef judge(N,M,List,anser):\n for i in range(N):\n L = list(map(int, input().split()))\n del L[0]\n if i==0:\n anser.extend(L)\n else:\n anser = list(set(L)&set(anser))\n \n \n print(len(anser))\njudge(N,M,List,anser)\n ']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s311786082', 's994794373', 's807083556']
[3060.0, 3060.0, 3060.0]
[19.0, 18.0, 17.0]
[272, 263, 308]
p03126
u835482198
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['from collections import defaultdict\n\n\nn, m = map(int, input().split())\nd = defaultdict(int)\nfor i in range(n):\n tmp = map(int, input().split())\n for a in tmp[1:]:\n d[a] += 1\ncnt = 0\nfor value in range(d.values()):\n if value == n:\n cnt += 1\nprint(cnt)', 'from collections import defaultdict\n\n\nn, m = map(int, input().split())\nd = defaultdict(int)\nfor i in range(n):\n tmp = list(map(int, input().split()))\n for a in tmp[1:]:\n d[a] += 1\ncnt = 0\nfor value in range(d.values()):\n if value == n:\n cnt += 1\nprint(cnt)\n', 'from collections import defaultdict\n\n\nn, m = map(int, input().split())\nd = defaultdict(int)\nfor i in range(n):\n tmp = list(map(int, input().split()))\n for a in tmp[1:]:\n d[a] += 1\ncnt = 0\nfor value in d.values():\n if value == n:\n cnt += 1\nprint(cnt)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s639803755', 's949301200', 's316810420']
[3316.0, 3444.0, 3316.0]
[20.0, 32.0, 21.0]
[273, 280, 273]
p03126
u844005364
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n, m = int(input())\n\nS = set(range(1, m+1))\n\nfor i in range(n):\n K, *a = map(int, input().split())\n S = S & set(A)\n\nprint(len(S))', 'n, m = map(int, input().split())\n \nS = set(range(1, m+1))\n \nfor i in range(n):\n K, *a = map(int, input().split())\n S = S & set(A)\n \nprint(len(S))', 'n, m = map(int, input().split())\n\na = [list(map(int, input().split())) for i in range(n)]\n\nx = [True] * m\n\nfor i in a:\n y = i[0]\n xx = [False] * m\n for j in range(y):\n x[i[j + 1]] = True\n for j in range(m):\n if xx[j] == False:\n x[j] = False\n\nprint(sum(x))\n', 'n, m = int(input())\na = [list(map(int, input().split())) for i in range(n)]\n\nx = [True] * m\n\nfor i in a:\n y = i[0]\n xx = [False] * m\n for j in range(y):\n x[i[j+1]] = True\n for j in range(m):\n if xx[j] = False:\n x[j] = False\n\nprint(sum(x))', 'n, m = int(input())\na = [list(map(int, input().split())) for i in range(n)]\n\nx = [True] * m\n\nfor i in a:\n y = i[0]\n xx = [False] * m\n for j in range(y):\n x[i[j + 1]] = True\n for j in range(m):\n if xx[j] == False:\n x[j] = False\n\nprint(sum(x))', 'n, m = map(int, input().split())\n\na = [list(map(int, input().split())) for i in range(n)]\n\nx = [True] * m\n\nfor i in a:\n y = i[0]\n xx = [False] * m\n for j in range(y):\n xx[i[j + 1] - 1] = True\n for j in range(m):\n if xx[j] == False:\n x[j] = False\n\nprint(sum(x))\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s044551272', 's208237411', 's745707085', 's971735774', 's981458964', 's485721089']
[3316.0, 3060.0, 3060.0, 2940.0, 3064.0, 3060.0]
[19.0, 18.0, 18.0, 18.0, 18.0, 18.0]
[131, 147, 293, 253, 278, 298]
p03126
u855781168
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['inp = input().split()\nn = int(inp[0])\nm = int(inp[1])\nfavorite = [] \nfor i in range(n):\n tmp = []\n tmp_inp = input().split()\n k = int(tmp_inp[0])\n for i in range(k):\n tmp.append(int(tmp_inp[i+1]))\n hyou.append(set(tmp))\n\n\ndef intersect_set(list): \n result = list[0]\n for i in range(len(list)-1):\n result = result.intersection(list[i+1])\n return result\n\nprint(len(intersect_set(hyou)))\n', 'inp = input().split()\nn = int(inp[0])\nm = int(inp[1])\nfavorite = [] \nfor i in range(n):\n tmp = []\n tmp_inp = input().split()\n k = int(tmp_inp[0])\n for i in range(k):\n tmp.append(int(tmp_inp[i+1]))\n favorite.append(set(tmp))\n\n\ndef intersect_set(list): \n result = list[0]\n for i in range(len(list)-1):\n result = result.intersection(list[i+1])\n return result\n\nprint(len(intersect_set(favorite)))\n']
['Runtime Error', 'Accepted']
['s209458779', 's632727517']
[3064.0, 3064.0]
[18.0, 18.0]
[551, 559]
p03126
u856169020
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split())\n\nlike = list(map(int, input().split()))\nall_like = set()\nfor l in like:\n\tall_like.add(l)\n \nfor i in range(N-1):\n like = list(map(int, input().split()))\n for l in like:\n if l not in all_like:\n all_like.remove(l);\nprint(len(all_like))', 'N, M = map(int, input().split())\n\nlike = list(map(int, input().split()))\nall_like = set()\nfor l in like:\n\tall_like.add(l)\nfor i in range(N):\n like = list(map(int, input().split()))\n for l in like:\n if l not in all_like:\n all_like.remove(l);\nprint(len(all_like))', 'import copy\n\nN, M = map(int, input().split())\n\nlike = list(map(int, input().split()))\nlike.pop(0)\nall_like = set()\nfor l in like:\n\tall_like.add(l)\n \nfor i in range(N-1):\n like = list(map(int, input().split()))\n like.pop(0)\n tmp = copy.deepcopy(all_like)\n for l in all_like:\n if l not in like:\n tmp.remove(l);\n all_like = tmp\nprint(len(all_like))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s176613585', 's277405545', 's708800213']
[3060.0, 3060.0, 3444.0]
[20.0, 18.0, 24.0]
[278, 271, 361]
p03126
u859897687
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int,input().split())\na=[0 for i in range(m)]\nfor i in range(n):\n k=list(map(int,input().split()))\n for j in range(1,k[0]):\n a[k[j]-1]=1\n \nprint(m.count(0))', 'n,m=map(int,input().split())\na=[0 for i in range(m)]\nfor i in range(n):\n b=list(map(int,input().split()))\n for i in range(b[0]):\n a[b[i+1]-1]+=1\nans=0\nfor i in a:\n if i==n:\n ans+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s407713576', 's908284567']
[3060.0, 3064.0]
[18.0, 19.0]
[171, 200]
p03126
u863150907
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['import numpy as np\nN, M =map(int,input().split())\nsearch = np.zeros(M+1)\nfor i in range(N):\n K = list(map(int,input().split()))\n for j in range(1,K[0]+1):\n search[K[j]]+=1\nplace = np.where(search==N)\nprint(search)\nprint(place)\nprint(len(place[0]))', 'import numpy as np\nN, M =map(int,input().split())\nsearch = np.zeros(M+1)\nfor i in range(N):\n K = list(map(int,input().split()))\n for j in range(1,K[0]+1):\n search[K[j]]+=1\nplace = np.where(search==N)\nprint(len(place[0]))']
['Wrong Answer', 'Accepted']
['s585631091', 's746643921']
[21760.0, 21764.0]
[344.0, 312.0]
[260, 233]
p03126
u866769581
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M = map(int,input().split())\nkind = [0]\nfor res in range (0,M):\n kind.append(0)\nfor x in range (0,N):\n like = map(int,input().split())\n like = list(like)\n for i in range (0,len(like)):\n kind[like[i]] += 1\nprint(kind.count(N))\n', 'N,M = map(int,input().split())\nK = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n\nfor person in range(0,N):\n L = list(map(int,input().split()))\n for kind in range(1,L[0]+1):\n K[L[kind]] += 1\nprint(K.count(N))\n']
['Wrong Answer', 'Accepted']
['s756776798', 's209573078']
[3060.0, 3064.0]
[18.0, 18.0]
[247, 253]
p03126
u868767877
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split(" "))\ndata = []\nfor i in range(N):\n A = list(map(int, input().split(" ")))\n A_ = A[1:].sort()\n data.append(A_)\n \ncounter = 0 \nfor m in range(M):\n flag = 1\n for d in data:\n if m in d:\n flag *= 1\n else:\n flag *= 0\n if flag == 1:\n counter += 1\n\nprint(counter)\n \n ', 'N, M = map(int, input().split(" "))\ndata = []\nfor i in range(N):\n A = list(map(int, input().split(" ")))\n A_ = sorted(A[1:])\n data.append(A_)\n \ncounter = 0 \nfor m in range(M):\n flag = 1\n for d in data:\n if m+1 in d:\n flag *= 1\n else:\n flag *= 0\n if flag == 1:\n counter += 1\n\nprint(counter)\n ']
['Runtime Error', 'Accepted']
['s290075115', 's587048459']
[3060.0, 3060.0]
[18.0, 18.0]
[325, 323]
p03126
u873269440
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['\n\ndef main():\n A,B = map(int,input().split())\n \n originalList = set(list(map(int,input().split()))[1:])\n print(originalList)\n for i in range(A-1):\n list1=set(list(map(int,input().split()))[1:])\n print(list1)\n print(type(list1))\n originalList = originalList & list1\n print(originalList)\n print(type(originalList))\n\n print(len(originalList))\n\n\n\n\n\n\n\n\n\n\nif __name__== "__main__":\n main() ', '\n\ndef main():\n A,B = map(int,input().split())\n \n originalList = set(list(map(int,input().split()))[1:])\n for i in range(A-1):\n list1=set(list(map(int,input().split()))[1:])\n originalList = originalList & list1\n\n print(len(originalList))\n\n\nif __name__== "__main__":\n main() ']
['Wrong Answer', 'Accepted']
['s211316064', 's638723854']
[3064.0, 3060.0]
[18.0, 17.0]
[447, 305]
p03126
u882359130
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = [int(nm) for nm in input().split()]\nfor n in range(N):\n KA = [int(ka) for ka in input().split()]\n for ka in range(len(KA)-1):\n L.append(KA[ka+1])\nlike = 0\nfor m in range(M):\n if L.count(m+1) == N:\n like += 1\nprint(like)', 'N, M = [int(nm) for nm in input().split()]\nL = []\nfor n in range(N):\n KA = [int(ka) for ka in input().split()]\n for ka in range(len(KA)-1):\n L.append(KA[ka+1])\nlike = 0\nfor m in range(M):\n if L.count(m+1) == N:\n like += 1\nprint(like)']
['Runtime Error', 'Accepted']
['s262080812', 's005277945']
[3064.0, 3060.0]
[19.0, 18.0]
[235, 242]
p03126
u883203948
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['\ndata = input().split()\nn = int(data[0]) \nm = int(data[1]) \nans = 0\n\n\nj = 1 \ni = 1 \nc = [0] * (m + 1)\n \n\nwhile i <= n:\n tmp = [int(s) for s in input().split()]\n td = tmp[1:] \n tn = tmp[0] \n print(td)\n \n while j <= m: \n \n if j in td: \n j = int(j) \n print(j)\n c[j] += 1 \n j = int(j) \n j += 1\n j = 1 \n i += 1 \n\n\n\nfor x in c:\n if x == n:\n ans += 1\n\n\n\nprint(ans)\n', '\ndata = input().split()\nn = int(data[0]) \nm = int(data[1]) \nans = 0\n\n\nj = 1 \ni = 1 \nc = [0] * m \n \n\nwhile i <= n:\n tmp = input()\n td = tmp[1:] \n tn = tmp[0] \n print(td)\n \n while j <= m: \n j = str(j)\n if j in td: \n j = int(j) \n c[j] += 1 \n j = int(j) \n j += 1\n j = 1 \n i += 1 \n\n\n\nfor x in c:\n if x == n:\n ans += 1\n\nprint(c)\n\nprint(ans)\n', '\ndata = input().split()\nn = int(data[0]) \nm = int(data[1]) \nans = 0\n\n\nj = 1 \ni = 1 \nc = [0] * (m + 1)\n \n\nwhile i <= n:\n tmp = [int(s) for s in input().split()]\n td = tmp[1:] \n tn = tmp[0] \n \n \n while j <= m: \n \n if j in td: \n j = int(j) \n \n c[j] += 1 \n j = int(j) \n j += 1\n j = 1 \n i += 1 \n\n\n\nfor x in c:\n if x == n:\n ans += 1\n\n\n\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s127845822', 's596684601', 's065258675']
[3064.0, 3064.0, 3064.0]
[20.0, 18.0, 18.0]
[1065, 1055, 1048]
p03126
u886112691
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int, input().split())\n\nka=[]\nfor i in range(n):\n atmp=list(input().split())\n ka.append(atmp)\n\n\nlike=ka[0][1::]\nans=len(like)\n\nif n>1:\n for i in range(1,n):\n liketmp=ka[i][1::]\n print(liketmp)\n for j in range(0,len(liketmp)-1):\n if liketmp[j] not in like:\n ans-=1\n\nprint(ans)', 'n,m=map(int, input().split())\n\nka=[]\nfor i in range(n):\n atmp=list(input().split())\n ka.append(atmp)\n\n\nlike=ka[0][1::]\nans=len(like)\n\nif n>1:\n for i in range(1,n):\n liketmp=ka[i][1::]\n for j in range(0,len(liketmp)-1):\n if liketmp[j] not in like:\n if ans>0:\n ans-=1\n if ans==0:\n break\n\n for k in range(0,len(like)):\n if like[k] not in liketmp:\n if ans>0:\n ans-=1\n if ans==0:\n break\n\nprint(ans)\n', 'n,m=map(int, input().split())\n\nka=[]\nfor i in range(n):\n atmp=list(input().split())\n ka.append(atmp)\n\n\nlike=ka[0][1::]\nans=len(like)\n\nif n>1:\n for i in range(1,n):\n liketmp=ka[i][1::]\n for k in range(0,len(like)):\n if like[k] not in liketmp:\n if ans>0:\n ans-=1\n del like[k]\n if ans==0:\n break\n\nprint(ans)\n', "n,m=map(int, input().split())\n\nka=[]\nans=0\n\nfor i in range(n):\n atmp=list(input().split())\n ka.append(atmp)\n\n\nlike=ka[0][1::]\n\nif n>1:\n for i in range(1,n):\n liketmp=ka[i][1::]\n for k in range(0,len(like)):\n if like[k] not in liketmp:\n like[k]='0'\n\nfor j in range(len(like)):\n if like[j]!='0':\n ans+=1\nprint(ans)\n"]
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s111464469', 's209024827', 's589737365', 's337119301']
[3064.0, 3064.0, 3064.0, 3064.0]
[18.0, 18.0, 17.0, 18.0]
[338, 603, 440, 377]
p03126
u891217808
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = input().split(" ")\nS = set(str(i) for i in range(1, int(M)+1))\nprint(S)\n\nfor _ in range(int(N)):\n S = S & set(input().split(" ")[1:])\nprint(len(S))', 'N, M = input().split(" ")\nS = set(str(i) for i in range(1, int(M)+1))\nfor _ in range(int(N)):\n S = S & set(input().split(" ")[1:])\nprint(len(S))']
['Wrong Answer', 'Accepted']
['s292362836', 's734691451']
[3060.0, 3060.0]
[18.0, 17.0]
[157, 147]
p03126
u894258749
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['(N,M) = map(int,input().split())\nr = int32(-1)\nfor i in range(M):\n A = list(map(int,input().split()))\n A.pop(0)\n c = 0\n for a in A:\n c |= (1 << (a-1))\n d &= c\n\nans = sum([(d>>n)&1 for n in range(n)])\nprint(ans)', 'inpl = lambda: list(map(int,input().split()))\nN, M = inpl()\nfav = [1]*M\nfor _ in range(N):\n A = inpl()[1:]\n for m in range(M):\n if m+1 in A:\n pass\n else:\n fav[m] = 0\nprint(sum(fav))']
['Runtime Error', 'Accepted']
['s115576156', 's893321295']
[3060.0, 3060.0]
[18.0, 18.0]
[218, 223]
p03126
u901447859
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['import collections\n\nn,m=list(map(int,input().split()))\n\narr=[]\nfor _ in range(n):\n k,*a=list(map(int,input().split()))\n arr.extend(a)\n \nc = collections.Counter(a)\n\ncnt=0\nfor c_ in c.most_common():\n if n == c_[1]:\n cnt+=1\nprint(cnt)', 'import collections\nn,m=list(map(int,input().split()))\n\narr=[]\nfor _ in range(n):\n k,*a=list(map(int,input().split()))\n arr.extend(a)\n\nc = collections.Counter(arr)\n\ncnt=0\nfor c_ in c.most_common():\n if n == c_[1]:\n cnt+=1\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s992627936', 's796987332']
[3316.0, 3316.0]
[21.0, 21.0]
[238, 237]
p03126
u902468164
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n, m = [int(i) for i in input().split(" ")]\n\npre_res = [0 for i in range(m)]\n\nfor i in range(n):\n sel = [int(i-1) for i in input().split(" ")][1:]\n for s in sel:\n pre_res[s] += 1\n\nres = 0\nfor i in range(m):\n if pre_res[s] == n:\n res += 1\n\nprint(res)\n\n', 'n, m = [int(i) for i in input().split(" ")]\n\npre_res = [0 for i in range(m)]\n\nfor i in range(n):\n sel = [int(i)-1 for i in input().split(" ")][1:]\n for s in sel:\n pre_res[s] += 1\n\nres = 0\nfor i in range(m):\n if pre_res[s] == n:\n res += 1\n\nprint(res)\n', 'import numpy as np\nn, m = [int(i) for i in input().split(" ")]\n\npre_res = np.array([0 for i in range(m)])\n\nfor i in range(n):\n sel = [int(i-1) for i in input(().split(" "))][1:]\n for s in sel:\n pre_res[s] += 1\n\nres = 0\nfor i in range(m):\n if pre_res[s] == n:\n res += 1\n\nprint(res)\n', 'n, m = [int(i) for i in input().split(" ")]\n\npre_res = [0 for i in range(m)]\n\nfor i in range(n):\n sel = [int(i)-1 for i in input().split(" ")][1:]\n for s in sel:\n pre_res[s] += 1\n\nres = 0\nfor i in range(m):\n if pre_res[i] == n:\n res += 1\n\nprint(res)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s168513631', 's439815017', 's483604923', 's461915264']
[3060.0, 3060.0, 21644.0, 3060.0]
[17.0, 17.0, 296.0, 18.0]
[274, 273, 304, 273]
p03126
u912318491
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['import sys\n\nN,M = map(int,input().split())\nmember = dict()\nfor i in range(1,N+1,1):\n j=int(input())\n member[i] = set(int(input()) for _ in range(j))\nif(N==1):\n print(member(1))\n sys.exit(0)\n\nmatch_set=member[1]\nfor i in range(2,N+1,1):\n match_set = match_set & member[i]\n\nprint(match_set.length)\n \n', 'import sys\n\nN,M = map(int,input().split())\nmember = dict()\nfor i in range(1,N+1,1):\n ilist = list(map(int,input().split()))\n ilist.pop(0)\n member[i]=set(ilist)\n\nmatch_set=member[1]\n\nfor i in range(2,N+1,1):\n match_set = match_set & member[i]\n\nprint(len(match_set))\n \n']
['Runtime Error', 'Accepted']
['s735325365', 's103571701']
[3060.0, 3060.0]
[19.0, 18.0]
[367, 333]
p03126
u922769680
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M = map(int,input().split())\nans = []\nfor i in range(N):\n KA = list(map(int,input().split()))\n for j in range(1,len(KA)):\n ans[[KA[j]-1]] += 1\nprint(ans.count(N))', 'N,M = map(int,input().split())\nans = [0]*M\nfor i in range(N):\n KA = list(map(int,input().split()))\n for j in range(1,len(KA)):\n ans[[KA[j]-1]] += 1\nprint(ans.count(N))', 'N,M = map(int,input().split())\nans = [0]*M\nfor i in range(N):\n KA = list(map(int,input().split()))\n for j in range(1,len(KA)):\n ans[KA[j]-1] += 1\nprint(ans.count(N))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s258773651', 's486131569', 's417583673']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[177, 180, 178]
p03126
u931636178
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M = map(int,input().split())\nans = [0 for _ in range(M)]\nfor _ in range(N):\n like = list(map(int,input().split()))\n for i in like:\n ans[i-1] += 1\nprint(ans.count(N))', 'N,M = map(int,input().split())\nans = [0 for _ in range(M)]\nfor _ in range(N):\n like = list(map(int,input().split()))\n like[0].pop()\n for i in like:\n ans[i-1] += 1\nprint(ans.count(N))', 'N,M = map(int,input().split())\nans = [0 for _ in range(M)]\nfor _ in range(N):\n like = list(map(int,input().split()))\n del like[0]\n for i in like:\n ans[i-1] += 1\nprint(ans.count(N))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s574531415', 's625972141', 's219797764']
[2940.0, 3060.0, 3060.0]
[18.0, 17.0, 18.0]
[172, 188, 186]
p03126
u932868243
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int,input().split())\nlists=[list(map(int,input().split())) for x in range(n)]\nans=[0]*m\nfor x in range(n):\n k=lists[x][0]\n for t in range(k):\n ans[lists[x][t+1]-1]+=1\ncount=0\nfor y in range(m):\n if ans[x]==n:\n count+=1\nprint(count)', 'n,m=map(int,,input().split())\nans=[0]*m\nl=[list(map(int,input().split())) for i in range(n)]\nfor i in range(n):\n k=l[i][0]\n for j in (1,k+1):\n ans[l[i][j]-1]+=1\ncnt=0\nfor aa in ans:\n if aa==n:\n cnt+=1\nprint(cnt)', 'n,m=map(int,input().split())\nans=[0]*m\nl=[list(map(int,input().split())) for i in range(n)]\nfor i in range(n):\n k=l[i][0]\n for j in range(1,k+1):\n ans[l[i][j]-1]+=1\ncnt=0\nfor aa in ans:\n if aa==n:\n cnt+=1\nprint(cnt)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s158909971', 's892785334', 's796276222']
[3064.0, 2940.0, 3064.0]
[18.0, 17.0, 18.0]
[248, 220, 224]
p03126
u940279019
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m = map(int,input())\nsum = {}\nans = 0\n\nfor i in range(n):\n k = list(map(int,input().split()))\n for j in range(1,k[0] + 1):\n if k[j] not in sum:\n sum[k[j]] = 1\n else:\n sum[k[j]] += 1\nfor l in sum:\n if sum[l] == n:\n ans += 1\nprint(ans)', 'n,m = map(int,input().split())\nsum = {}\nans = 0\n\nfor i in range(n):\n k = list(map(int,input().split()))\n for j in range(1,k[0] + 1):\n if k[j] not in sum:\n sum[k[j]] = 1\n else:\n sum[k[j]] += 1\nfor l in sum:\n if sum[l] == n:\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s136771934', 's953068961']
[3064.0, 3064.0]
[17.0, 18.0]
[257, 265]
p03126
u947327691
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m= map(int,input().split())\n\nt1=list(map(int,input().split()))\nans=set(t1[1:])\nfor _ in range(n-1):\n t2=list(map(int,input().split()))\n ans &= set(t2[1:])\n\nprint(ans)', 'n,m= map(int,input().split())\n\nt1=list(map(int,input().split()))\nans=set(t1[1:])\nfor _ in range(n-1):\n t2=list(map(int,input().split()))\n ans &= set(t2[1:])\n\nprint(len(ans))']
['Wrong Answer', 'Accepted']
['s497485352', 's688744149']
[3060.0, 3064.0]
[18.0, 17.0]
[174, 179]
p03126
u954488273
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=list(map(int,input().split()))\nt=np.zeros(m)\nfor i in range(n):\n tmp=list(map(int,input().split())) \n for j in range(tmp[0]):\n t[tmp[j+1]-1] += 1\n \nmaxIndex = [i for i, x in enumerate(a) if x == max(tmp)]\nprint(len(maxIndex)', 'n,m=list(map(int,input().split()))\nt=np.zeros(m)\nfor i in range(n):\n tmp=list(map(int,input().split())) \n for j in range(tmp[0]):\n t[tmp[j+1]-1] += 1\n \nmaxIndex = [i for i, x in enumerate(t) if x == max(t)]\nprint(len(maxIndex)', 'import numpy as np\n\nn,m=list(map(int,input().split()))\nt=np.zeros(m)\nfor i in range(n):\n tmp=list(map(int,input().split())) \n for j in range(tmp[0]):\n t[tmp[j+1]-1] += 1\n \nmaxIndex = [i for i, x in enumerate(t) if x == n]\nprint(len(maxIndex))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s375691019', 's714851796', 's311272371']
[3060.0, 3060.0, 21780.0]
[17.0, 17.0, 315.0]
[235, 233, 249]
p03126
u957722693
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int,input().split())\nchecks=[0 for i in range(m)]\nprint(len(checks))\nfor i in range(n):\n l=list(map(int,input().split()))\n for j in range(1,len(l)):\n checks[l[j]-1]+=1\nans=checks.count(n)\nprint(ans)', 'n,m=map(int,input().split())\nchecks=[0 for i in range(m)]\nprint(len(checks))\nfor i in range(n):\n l=list(map(int,input().split()))\n print(len(l))\n for j in range(1,len(l)):\n print(l[j])\n checks[l[j]-1]+=1\nans=checks.count(n)\nprint(ans)', 'n,m=map(int,input().split())\nchecks=[0 for i in range(m)]\nfor i in range(n):\n l=list(map(int,input().split()))\n for j in range(1,len(l)):\n checks[l[j]-1]+=1\nans=checks.count(n)\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s588061848', 's720105287', 's736491276']
[3060.0, 3064.0, 3060.0]
[20.0, 18.0, 17.0]
[211, 243, 192]
p03126
u957957759
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
["import itertools\nn,m=map(int,input().split())\ns=list(input().split() for i in range(n))\nl=[]\nc=0\nfor j in range(n):\n l.append(s[j][1:])\nl=list(itertools.chain.from_iterable(l)) \n\nfor i in range(1,m+1):\n if l.count('i')==n:\n c+=1\nprint(c) \n ", 'import itertools\nn,m=map(int,input().split())\ns=list(input().split() for i in range(n))\nl=[]\nc=0\nfor j in range(n):\n l.append(s[j][1:])\nl=list(itertools.chain.from_iterable(l)) \n\nfor i in range(1,m+1):\n if l.count(str(i))==n:\n c+=1\nprint(c) \n ']
['Wrong Answer', 'Accepted']
['s817423739', 's514265740']
[3060.0, 3060.0]
[18.0, 18.0]
[270, 273]
p03126
u963915126
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m = map(int,input().split())\n\npref = [0] * (m+1)\nfor i in range(n):\n ka = list(map(int,input().split()))\n for j in range(1,ka[0]):\n pref[ka[j]]+=1\n\nans = 0\nfor p in pref:\n if p == n:\n ans += 1\n\nprint(ans)\n', 'n,m = map(int,input().split())\n\npref = [0] * (m+1)\nfor i in range(n):\n ka = list(map(int,input().split()))\n for j in range(1,ka[0]):\n pref[ka[j]]+=1\n\n\nprint(sum([1 for k in pref if k == n]))\n', 'n,m = map(int,input().split())\n\npref = [0] * m\nfor i in range(n):\n k, *a = map(int,input().split())\n for j in range(k):\n pref[a[j]-1] += 1\n\n\nprint(sum([1 for k in pref if k == n]))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s669081512', 's923640084', 's536840166']
[3060.0, 2940.0, 3060.0]
[17.0, 17.0, 19.0]
[230, 204, 194]
p03126
u970899068
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['n,m=map(int, input().split())\na= [list(map(int,input().split())) for i in range(n)]\nfor i in range(n):\n del a[i][0]\nprint(a)\nv=[]\n\nx=0\nfor i in range(31):\n for j in range(n):\n v.append(a[j].count(i))\nprint(v)\nfor i in range(0,31,n):\n print(v[i:i+n])\n if v[i:i+n].count(1)==n:\n x+=1\n\n \nprint(x)', 'n=int(input())\ns=[int(input()) for i in range(n)]\n \nprint(sum(s)-max(s)//2)', 'n,m=map(int, input().split())\na= [list(map(int,input().split())) for i in range(n)]\nfor i in range(n):\n del a[i][0]\nv=[]\n\nx=0\nfor i in range(1,m+1):\n for j in range(n):\n v.append(a[j].count(i))\n\nfor i in range(0,m*n,n):\n \n if v[i:i+n].count(1)==n:\n x+=1\n\n \nprint(x)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s196277374', 's506233881', 's357322299']
[3064.0, 2940.0, 3064.0]
[18.0, 17.0, 18.0]
[320, 75, 290]
p03126
u972474792
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M=map(int,input().split())\nKA=[]\nA=[]\na=0\nfor i in range(N):\n KA.append(list(map(int,input().split())))\nfor i in range(N):\n KA[i].remove(KA[i][0])\nfor i in range(N):\n for j in range(len(KA[i])):\n A.append(KA[i][j])\nprint(A)\nfor i in range(1,M+1):\n if N==A.count(i):\n a+=1\nprint(a)', 'N,M=map(int,input().split())\nKA=[]\nA=[]\na=0\nfor i in range(N):\n KA.append(list(map(int,input().split())))\nfor i in range(N):\n KA[i].remove(KA[i][0])\nfor i in range(N):\n for j in range(len(KA[i])):\n A.append(KA[i][j])\nfor i in range(1,M+1):\n if N==A.count(i):\n a+=1\nprint(a)']
['Wrong Answer', 'Accepted']
['s176141340', 's379819422']
[8984.0, 9200.0]
[31.0, 34.0]
[308, 299]
p03126
u974935538
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['X,Y = map(int,input().split())\nA = list(map(int,input().split()))\nA = set(A[1:])\nfor i in range(X-1):\n A = list(map(int,input().split()))\n B = B & set(A[1:])\nprint(len(B))', 'x,y = map(int,input().split())\na = list(map(int,input().split()))\nb = set(a[1:])\nfor i in range(x-1):\n a = list(map(int,input().split()))\n b = b & set(a[1:])\nprint(len(b))\n\n']
['Runtime Error', 'Accepted']
['s884820316', 's156212282']
[3060.0, 3060.0]
[18.0, 17.0]
[177, 179]
p03126
u982198202
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split())\ndata = []\nfor i in range(N):\n data.append(list(map(int, input().split())))\n#print(data)\ncounter2 = 0\nfor i in range(1, M + 1):\n counter1 = 0\n for ans in data:\n num = ans[0]\n if i in ans[1 : num + 1]:\n counter1 += 1\n print("{} {}".format(i, counter1))\n else:\n counter1 = 0\n break\n if counter1 == N:\n counter2 += 1\nprint(counter2)', 'N, M = map(int, input().split())\ndata = []\nfor i in range(N):\n data.append(list(map(int, input().split())))\n#print(data)\ncounter1 = 0\ncounter2 = 0\nfor i in range(1, M + 1):\n for ans in data:\n num = ans[0]\n \n if i in ans[1 : num + 1]:\n counter1 += 1\n else:\n counter1 = 0\n break\n if counter1 == N:\n print(i)\n counter2 += 1\nprint(counter2)', 'data = []\nfor i in range(N):\n data.append(list(map(int, input().split())))\n#print(data)\ncounter1 = 0\ncounter2 = 0\nfor i in range(1, M + 1):\n for ans in data:\n num = ans[0]\n \n if i in ans[1 : num + 1]:\n counter1 += 1\n else:\n counter1 = 0\n break\n if counter1 == N:\n print(i)\n counter2 += 1\nprint(counter2)\n', 'N, M = map(int, input().split())\ndata = []\nfor i in range(N):\n data.append(list(map(int, input().split())))\n#print(data)\ncounter2 = 0\nfor i in range(1, M + 1):\n counter1 = 0\n for ans in data:\n num = ans[0]\n if i in ans[1 : num + 1]:\n counter1 += 1\n else:\n counter1 = 0\n break\n if counter1 == N:\n counter2 += 1\nprint(counter2)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s624153704', 's735963458', 's957976000', 's429144010']
[3188.0, 3316.0, 2940.0, 3064.0]
[19.0, 19.0, 17.0, 18.0]
[445, 444, 412, 398]
p03126
u986985627
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
["from sys import stdin, exit\nfrom math import factorial\ninput = stdin.readline\nlmi = lambda: list(map(int, input().split()))\nmi = lambda: map(int, input().split())\nsi = lambda: input().strip('\\n')\nssi = lambda: input().strip('\\n').split()\n\nn, m = mi()\nfoods = [0 for i in range(m+1)]\nfor i in range(n):\n arr = lmi()\n for j in arr:\n foods[j] += 1\ncnt= 0\nfor i in range(1, m+1):\n if foods[i] == n:\n cnt += 1\nprint(cnt)", "from sys import stdin, exit\nfrom math import factorial\ninput = stdin.readline\nlmi = lambda: list(map(int, input().split()))\nmi = lambda: map(int, input().split())\nsi = lambda: input().strip('\\n')\nssi = lambda: input().strip('\\n').split()\n\nn, m = mi()\nfoods = [0 for i in range(m+1)]\nfor i in range(n):\n arr = lmi()\n for j in arr[1:]:\n foods[j] += 1\ncnt= 0\nprint(foods)\nfor i in range(1, m+1):\n if foods[i] == n:\n cnt += 1\nprint(cnt)", "from sys import stdin, exit\nfrom math import factorial\ninput = stdin.readline\nlmi = lambda: list(map(int, input().split()))\nmi = lambda: map(int, input().split())\nsi = lambda: input().strip('\\n')\nssi = lambda: input().strip('\\n').split()\n\nn, m = mi()\nfoods = [0 for i in range(m+1)]\nfor i in range(n):\n arr = lmi()\n for j in arr[1:]:\n foods[j] += 1\ncnt= 0\nfor i in range(1, m+1):\n if foods[i] == n:\n cnt += 1\nprint(cnt)"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s372534058', 's921490963', 's015924345']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 18.0]
[438, 455, 442]
p03126
u989326345
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N,M=map(int,input().split())\ns=0\na = [list(input().split())for i in range(N)]\nfor i in range(N):\n del a[i][0]\nb=set(a)\nprint(len(b))', 'N,M=map(int,input().split())\ns=0\na = [list(input().split())for i in range(N)]\nfor i in range(N):\n del a[i][0]\n a[i]=set(a[i])\nc=a[0]\nfor i in range(N):\n c=c&a[i]\nprint(len(c))\n']
['Runtime Error', 'Accepted']
['s214142787', 's149136696']
[3060.0, 3060.0]
[17.0, 17.0]
[135, 185]
p03126
u997641430
2,000
1,048,576
Katsusando loves omelette rice. Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone. To prove that hypothesis, he conducted a survey on M kinds of foods and asked N people whether they like these foods or not. The i-th person answered that he/she only likes the A_{i1}-th, A_{i2}-th, ..., A_{iK_i}-th food. Find the number of the foods liked by all the N people.
['N, M = map(int, input().split())\nK = []\nA = []\nfor n in range(N):\n INPUT = list(map(int, input().split()))\n K.append(INPUT[0])\n A.append(INPUT[1:])\nintersection=set(A[0])\nprint(A)\nfor a in A:\n intersection=intersection&set(a)\nprint(len(intersection))', 'N, M = map(int, input().split())\nK = []\nA = []\nfor n in range(N):\n INPUT = list(map(int, input().split()))\n K.append(INPUT[0])\n A.append(INPUT[1:])\nintersection=set(A[0])\nfor a in A:\n intersection=intersection&set(a)\nprint(len(intersection))']
['Wrong Answer', 'Accepted']
['s047711922', 's621640274']
[3064.0, 3064.0]
[19.0, 17.0]
[262, 253]
p03127
u000557170
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['# -*- coding: utf-8 -*-\n\nimport sys\nimport math\n\ndef parse_input(lines_as_string = None):\n\n lines = []\n if lines_as_string is None:\n for line in sys.stdin:\n lines.append(line)\n else:\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n\n \n nm = lines[0].split(" ")\n n = int(nm[0])\n\n rows = []\n for i in range(1, 2):\n rows.append([int(e) for e in lines[i].split(" ")])\n\n return (n, rows[0])\n\ndef solve(n, monsters):\n\n g = monsters[0]\n for i in range(1, n):\n g = math.gcd(g, monsters[i])\n\n\n return g\n\ndef main():\n\n n, m, rows = parse_input()\n print("%d" % solve(n, m, rows))\n\nif __name__ == \'__main__\':\n\n main()\n', '# -*- coding: utf-8 -*-\n\nimport sys\n\ndef gcd(a, b):\n\n c = min(a, b)\n d = max(a, b)\n r = 0 \n while True:\n r = d % c\n if r == 0:\n break\n d = c\n c = r\n\n return c\n\ndef parse_input(lines_as_string = None):\n\n lines = []\n if lines_as_string is None:\n for line in sys.stdin:\n lines.append(line)\n else:\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n\n \n nm = lines[0].split(" ")\n n = int(nm[0])\n\n rows = []\n for i in range(1, 2):\n rows.append([int(e) for e in lines[i].split(" ")])\n\n return (n, rows[0])\n\ndef solve(n, monsters):\n\n g = monsters[0]\n for i in range(1, n):\n g = gcd(g, monsters[i])\n\n\n return g\n\ndef main():\n\n print("%d" % solve(*parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n']
['Runtime Error', 'Accepted']
['s526906487', 's872248453']
[15136.0, 15140.0]
[45.0, 101.0]
[705, 841]
p03127
u007991836
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\na = list(map(int,input().split()))\n\nx = [a[1],a[0],a[1] % a[0]]\na.sort()\nfor i in range(1,n+1):\n while x[2] > 0:\n x[0] = x[1]\n x[1] = x[2]\n x[2] = x[0] % x[1]\n x[0] = a[i+1]\n x[2] = x[0] % x[1]\n\nprint(x[1])\n', 'n = int(input())\na = list(map(int,input().split()))\n\na.sort()\nx = [a[1],a[0],a[1] % a[0]]\nfor i in range(1,n):\n while x[2] > 0:\n x[0] = x[1]\n x[1] = x[2]\n x[2] = x[0] % x[1]\n if i != n - 1:\n x[0] = a[i+1]\n x[2] = x[0] % x[1]\n\nprint(x[1])\n']
['Runtime Error', 'Accepted']
['s481262087', 's783394559']
[14224.0, 14252.0]
[114.0, 122.0]
[254, 279]
p03127
u013408661
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['number=int(input())\nhitpoint=list(map(int,input().split()))\nxyz=[]\npng=[]\nm=min(hitpoint)\nfor i in range(len(hitpoint)):\n xyz.append(hitpoint[i]%2)\nif hitpoint.count(hitpoint[0])==len(hitpoint):\n print(hitpoint[0])\nelif hitpoint[len(hitpoint)]%m==0:\n for i in range(len(hitpoint)):\n png.append(hitpoint[i]%m)\n if png.count(0)==len(png):\n print(min(hitpoint))\n else:\n if hitpoint.count(1)!=0:\n print(1)\n elif xyz.count(0)!=len(xyz):\n print(1)\n elif xyz.count(1)==len(xyz):\n print(1)\n else:\n print(2)\nelif hitpoint.count(1)!=0:\n print(1)\nelif xyz.count(0)!=len(xyz):\n print(1)\nelif xyz.count(1)==len(xyz):\n print(1)\nelse:\n print(2)', 'number=int(input())\nhitpoint=list(map(int,input().split()))\nxyz=[]\npng=[]\nm=min(hitpoint)\nfor i in range(len(hitpoint)):\n xyz.append(hitpoint[i]%2)\nif hitpoint.count(hitpoint[0])==len(hitpoint):\n print(hitpoint[0])\nelif hitpoint[len(hitpoint)]%m==0:\n for i in range(len(hitpoint)):\n png.append(hitpoint[i]%m)\n if png.count(0)==len(png):\n print(min(hitpoint))\nelif hitpoint.count(1)!=0:\n print(1)\nelif xyz.count(0)!=len(xyz):\n print(1)\nelif xyz.count(1)==len(xyz):\n print(1)\nelse:\n print(2)', 'n=int(input())\ndef gcd(x,y):\n if y==0:\n return x\n else:\n return gcd(y,x%y)\na=list(map(int,input().split()))\nstack=a.pop()\nfor i in a:\n stack=gcd(i,stack)\nprint(stack)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s202047426', 's284810876', 's977177203']
[14436.0, 14480.0, 14252.0]
[63.0, 64.0, 74.0]
[742, 527, 175]
p03127
u016182925
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nmonsters = list(map(int, input().split()))\ndef gcd(a, b):\n\tif b > 0 :\n return gcd(b , a % b)\n else :\n return x\nif len(monster) == 1 :\n\tprint(monster[0])\nelse :\n mon = gcd(monster[0], monster[1])\n if len(monster) >= 2\n for i in range(2 , N) :\n mon = gcd(mon, monster[i])\nprint(mon)\n \n \n \n \n', 'N = int(input())\nmonster = list(map(int, input().split()))\ndef gcd(a, b):\n\tif b > 0 :\n\t\treturn gcd(b, a % b)\n\telse:\n\t\treturn a\nif len(monster) == 1 :\n\tprint(monster[0])\nelse:\n\tmon = gcd(monster[0], monster[1])\n\tif len(monster) != 2 :\n\t\tfor i in range(2, N) :\n\t\t\tmon = gcd(mon, monster[i])\nprint(mon)']
['Runtime Error', 'Accepted']
['s894005127', 's811352338']
[2940.0, 14252.0]
[17.0, 89.0]
[346, 299]
p03127
u033602950
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import numpy as np\nN = int(input())\nA = np.array(list(map(int, input().split())))\nwhile True:\n\tprint(A)\n\tmin_a = A.min()\n\tnew_A = np.where(A%min_a==0,min_a,A%min_a)\n\tA = new_A\n\tif (np.all(A == A[0])):\n\t\tbreak\nprint(A.min())\n', 'import numpy as np\nN = int(input())\nA = np.array(list(map(int, input().split())))\nwhile True:\n\tmin_a = A.min()\n\tnew_A = np.where(A%min_a==0,min_a,A%min_a)\n\tA = new_A\n\tif (np.all(A == A[0])):\n\t\tbreak\nprint(A.min())\n']
['Wrong Answer', 'Accepted']
['s952967296', 's730753924']
[23120.0, 23120.0]
[193.0, 189.0]
[224, 214]
p03127
u044964932
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['from fractions import gcd\n\n\ndef main():\n n = int(input())\n As = list(map(int, input().split()))\n print(n)\n print(As)\n ans = gcd(As[0], As[1])\n for i in range(2, n):\n ans = gcd(ans, As[i])\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', 'import math\n\n\ndef main():\n n = int(input())\n As = sorted(list(map(int, input().split())))\n\n ans = math.gcd(As[0], As[1])\n for i in range(2, n):\n ans = math.gcd(ans, As[i])\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n']
['Wrong Answer', 'Accepted']
['s675746304', 's055525606']
[16284.0, 20376.0]
[93.0, 78.0]
[268, 246]
p03127
u062621835
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input()) \na = [int(i) for i in input().split() ]\n\na = list(set(a))\na.sort()\nwhile len(a) > 1:\n while (a[0] < a[1]):\n a[1] -= a[0]\n a = list(set(a))\n a.sort()\n if a[0] == 1:\n break\n if len(a) == 2:\n a[0] = a[1]%a[0]\n break\nprint(a[0])', 'n = int(input()) \na = [int(i) for i in input().split() ]\n\na = list(set(a))\na.sort()\nwhile len(a) > 1:\n while (a[0] < a[1]):\n a[1] %= a[0]\n x = a[1]\n a[1] = a[0]\n a[0] = x\n if a[0] == 0:\n a.pop(0)\n if a[0] == 1:\n break\nprint(a[0])']
['Wrong Answer', 'Accepted']
['s525818382', 's532686063']
[14984.0, 14224.0]
[2104.0, 317.0]
[291, 275]
p03127
u062847046
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nlist_A = list(map(int,input().split()))\nfor _ in range(100):\n min_A = min(list_A)\n list_A.remove(min_A)\n l = np.array([list_A]) % min_A\n lr = list(l.ravel())\n lr.append(min_A)\n list_A = [x for x in lr if x != 0]\n if len(list_A) <= 1:\n break\nprint(list_A[0])', 'import numpy as np\nN = int(input())\nlist_A = list(map(int,input().split()))\nfor _ in range(100):\n min_A = min(list_A)\n list_A.remove(min_A)\n l = np.array([list_A]) % min_A\n lr = list(l.ravel())\n lr.append(min_A)\n list_A = [x for x in lr if x != 0]\n if len(list_A) <= 1:\n break\nprint(list_A[0])']
['Runtime Error', 'Accepted']
['s508119352', 's564172838']
[14224.0, 23124.0]
[44.0, 326.0]
[302, 321]
p03127
u063052907
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\nlst_a = list(map(int, input().split()))\n\ndef gcd(a, b):\n if b==0:\n return a\n else:\n gcd(b, a%b)\n\nans = lst_a[0]\nfor a in lst_a:\n \n ans = gcd(ans, a)\n\nprint(ans)', 'n = int(input())\nlst_a = list(map(int, input().split()))\n\ndef gcd(a, b):\n if b==0:\n return a\n else:\n return gcd(b, a%b)\n\nans = lst_a[0]\nfor a in lst_a:\n \n ans = gcd(ans, a)\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s111293403', 's392550132']
[15020.0, 14224.0]
[43.0, 84.0]
[286, 293]
p03127
u070449185
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\n2.b = list(map(int,input().split()))\n3.b.sort()\n4. \n5.d = b[0] + 0\n6. \n7.while len(b) > 1 :\n8. for i in range(1,len(b)) :\n9. b[i] = b[i] % b[0]\n10. if b.count(0) == len(b)-1 :\n11. d = b[0]\n12. break\n13. else :\n14. b.sort()\n15. for j in range(b.count(0)) :\n16. b.remove(0)\n17.print(d)\n', 'def gcd(a,b):\n if(a%b==0):\n return b\n else:\n return gcd(b,a%b)\nN = int(input())\ns = [int(x) for x in input().split()]\ntmp = s[0]\nfor i in s[1:]:\n tmp = gcd(tmp,i)\nprint(tmp)']
['Runtime Error', 'Accepted']
['s523043828', 's375227773']
[2940.0, 14252.0]
[17.0, 85.0]
[360, 196]
p03127
u077141270
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
["from sys import stdin\n\ndef fun():\n n = (int(i) for i in input().split())\n\n l = [int(x) for x in stdin.readline().rstrip().split()]\n\n l = list(set(l))\n\n while 1 < len(l):\n for i in range(1, len(l)):\n if l[i]%l[0] == 0:\n l[i] = l[0]\n elif l[i] - l[i-1] == 1:\n print(1)\n return\n else:\n l[i] = l[i]%l[0]\n \n l = list(set(l))\n #l.sort()\n\n if l[0]==1:\n print(1)\n return\n\n print(l[0])\n return\n\nif __name__ == '__main__':\n fun()\n", "from sys import stdin\n\ndef fun():\n n = (int(i) for i in input().split())\n\n l = [int(x) for x in stdin.readline().rstrip().split()]\n\n l.sort()\n\n while 1 < len(l):\n for i in range(1, len(l)):\n if l[i]%l[0] == 0:\n l[i] = l[0]\n elif l[i] - l[i-1] == 1:\n print(1)\n return\n else:\n l[i] = l[i]%l[0]\n l = [e for e in l if e != 0]\n l.sort()\n\n if l[0]==1:\n print(1)\n return\n\n print(l[0])\n return\n\nif __name__ == '__main__':\n fun()\n", "from sys import stdin\n\ndef fun():\n n = (int(i) for i in input().split())\n\n l = [int(x) for x in stdin.readline().rstrip().split()]\n\n l = list(set(l))\n l.sort()\n\n while 1 < len(l):\n print(l)\n k = len(l)\n for i in range(1, k):\n if l[k-i]%l[0] == 0:\n l.pop(k-i)\n elif l[k-i] - l[k-i-1] == 1:\n print(1)\n return\n else:\n l[k-i] = l[k-i]%l[0]\n \n l = list(set(l))\n\n if l[0]==1:\n print(1)\n return\n\n print(l[0])\n return\n\nif __name__ == '__main__':\n fun()\n", "from sys import stdin\n\ndef fun():\n n = (int(i) for i in input().split())\n\n l = [int(x) for x in stdin.readline().rstrip().split()]\n\n l = list(set(l))\n l.sort()\n\n while 1 < len(l):\n k = len(l)\n for i in range(1, k):\n if l[k-i]%l[0] == 0:\n l.pop(k-i)\n elif l[k-i] - l[k-i-1] == 1:\n print(1)\n return\n else:\n l[k-i] = l[k-i]%l[0]\n \n l = list(set(l))\n l.sort()\n\n if l[0]==1:\n print(1)\n return\n\n print(l[0])\n return\n\nif __name__ == '__main__':\n fun()\n"]
['Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s354847596', 's788160519', 's989763043', 's402907097']
[14428.0, 14428.0, 18548.0, 14480.0]
[2104.0, 2104.0, 2103.0, 99.0]
[620, 585, 655, 655]
p03127
u080880358
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['\nN=int(input())\nA=sorted(map(int,input().split()))\nwhile len(A) != 1:\n\tB_nonzeros=[A[0]]\n\tfor n in range(len(A)):\n\t\ti = A[n]%A[0]\n\t\tif i != 0:\n\t\t\tB_nonzeros.append(i)\n\tB_nonzeros.sort()\n\tA=B_nonzeros\n\tprint(A)\nprint(A[0])', '\nN=int(input())\nA=sorted(map(int,input().split()))\nwhile len(A) != 1:\n\tB_nonzeros=[A[0]]\n\tfor n in range(len(A)):\n\t\ti = A[n]%A[0]\n\t\tif i != 0:\n\t\t\tB_nonzeros.append(i)\n\tB_nonzeros.sort()\n\tA=B_nonzeros\nprint(A[0])']
['Wrong Answer', 'Accepted']
['s515458797', 's841004062']
[14252.0, 14252.0]
[164.0, 156.0]
[234, 224]
p03127
u083960235
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n=int(input())\na=list(map(int,input().split()))\nb=[]\ne=False\nwhile e==False:\n b=[]\n a_m=[]\n for i in a:\n if i!=0:\n a_m.append(i)\n print(a_m)#a=m a of positive\n temp=min(a_m)\n #5\n for i in a:\n g=i%temp\n if i==temp:\n b.append(i)#myself\n elif g!=0:\n b.append(i%temp)\n \n #b is only positive\n print("temp:",temp)\n print("b",b)\n if not b:#if empty \n ans=temp\n e=True\n \n else:\n if temp==min(b):\n ans=temp\n e=True\n else:\n a=b\n print(a)\n \nprint(ans)\n\n\n\n\n', 'n=int(input())\na=list(map(int,input().split()))\nb=[]\ne=False\nwhile e==False:\n b=[]\n a_m=[]\n for i in a:\n if i!=0:\n a_m.append(i)\n #print(a_m)#a=m a of positive\n temp=min(a_m)\n #5\n for i in a:\n g=i%temp\n if i==temp:\n b.append(i)#myself\n elif g!=0:\n b.append(i%temp)\n \n #b is only positive\n #print("temp:",temp)\n #print("b",b)\n if not b:#if empty \n ans=temp\n e=True\n \n else:\n if temp==min(b):\n ans=temp\n e=True\n else:\n a=b\n # print(a)\n \nprint(ans)\n\n\n\n\n']
['Wrong Answer', 'Accepted']
['s186881467', 's266948443']
[15544.0, 14252.0]
[157.0, 136.0]
[644, 648]
p03127
u092620892
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n=input()\na=list(map(int,input().split()))\nfor i in range(0,len(a)):\n a[i]=a[i]%min(a)\n a.append(min(a))\n for j in range(len(a)):\n if a[j]==0:\n a.remove(a[j])\nprint(a[0])', 'n=input()\na=list(map(int,input().split()))\nk=[0,99999999]\nfor i in range(0,n):\n a[i]=a[i]%min(a)\n a.append(min(a))\n for j in range(n+1):\n if a[j]==0:\n a.remove(a[j])\n n-=1\nprint(a[0])', 'n=int(input())\na=list(map(int,input().split()))\nwhile len(a)>1:\n m=min(a)\n def f(n):\n return n%m\n a=map(f,a)\n a=set(a)\n a.add(m)\n a.remove(0)\n a=list(a)\nprint(a[0])\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s525104635', 's780455051', 's680999751']
[14224.0, 14252.0, 15020.0]
[168.0, 45.0, 62.0]
[197, 221, 193]
p03127
u096820121
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\na = input().split()\nfor i in range(n):\n a[i] = int(a[i])\na = sorted(a)\nwhile len(a) > 1:\n for i in range(1:len(a)):\n if a[len(a)-1-i] % a[0] == 0:\n a.pop()\n else: a[len(a)-1-i] %= a[0]\n a = sorted(a)\nprint(a[0])', 'n = int(input())\na = input().split()\nfor i in range(n):\n a[i] = int(a[i])\ndef gcm(a,b):\n if a >= b:\n if a % b == 0:\n return b \n else:\n return gcm(b,a%b)\n else: return gcm(b,a)\nfor i in range(1,len(a)):\n a[0] = gcm(a[0],a[i])\nprint(a[0]) ']
['Runtime Error', 'Accepted']
['s339868728', 's245337506']
[2940.0, 11096.0]
[17.0, 102.0]
[262, 285]
p03127
u101742684
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import fraction\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(fraction.gcd, numbers)\n\n\nN = input()\nA = input().split()\nfor i in range(len(A)):\n A[i] = int(A[i]) \nprint("{}".format(gcd_list(A)))', 'from functools import reduce\n\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\nN = input()\nA = input().split()\nfor i in range(len(A)):\n A[i] = int(A[i])\nanswer = gcd_list(A)\nprint("{}".format(answer))']
['Runtime Error', 'Accepted']
['s472425537', 's128767863']
[2940.0, 11596.0]
[17.0, 84.0]
[222, 265]
p03127
u116233709
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n=int(input())\na=list(map(int,input().split()))\na.sort()\n\nwhile len(a)>=2:\n for i in range(1,len(a)):\n a[i]=a[i]%a[0]\n if 0 in a:\n a.remove(0)\n a.sort()\n \n\nprint(a[0])', 'n=int(input())\na=list(map(int,input().split()))\ndef gcd(x,y):\n if x%y==0:\n return y\n else:\n return(y,x%y)\n \nx=a[0]\n \nfor i in range(1,n):\n x=gcd(x,a[i])\n \nprint(x) \n ', 'n=int(input())\na=list(map(int,input().split()))\ndef gcd(x,y):\n if x%y==0:\n return y\n else:\n return gcd(y,x%y)\n \nb=a[0]\n \nfor i in range(1,n):\n b=gcd(b,a[i])\n \nprint(b) \n ']
['Runtime Error', 'Runtime Error', 'Accepted']
['s008815100', 's029304471', 's482230197']
[14252.0, 14252.0, 14224.0]
[135.0, 66.0, 84.0]
[179, 180, 184]
p03127
u119982147
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\na = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n if a <= b:\n if b % a == 0:\n return a\n else:\n return(gcd(b % a, a))\n else:\n if a % b == 0:\n return b\n else:\n return(gcd(a % b, b))\n\n\nans = 0\n\nfor i in range(len(a)):\n for j in range(i+1, len(a)):\n x = gcd(a[i], a[j])\n if x == 1:\n print(1)\n break\n\n elif ans == 0:\n ans = x\n elif x < ans:\n ans = x\n if x == 1:\n break\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif len(set(a)) == 1:\n print(a[0])\nelse:\n a.sort()\n for i in range(1, 10 ^ 9+1):\n count = i\n for i in range(1, len(a)):\n x = a[i] + count\n for j in range(i):\n x = x % a[i-1-j]\n if x == 0:\n break\n\n print(count)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nif len(set(a)) == 1:\n print(a[0])\nelse:\n def gcd(a, b):\n if b % a == 0:\n return a\n else:\n return(gcd(b % a, a))\n\n a.sort()\n ans = 0\n\n for i in range(len(a)):\n for j in range(i+1, len(a)):\n x = gcd(a[i], a[j])\n if x == 1:\n print(1)\n break\n\n elif ans == 0:\n ans = x\n elif x < ans:\n ans = x\n if x == 1:\n break\n', 'n = int(input())\na = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n if a <= b:\n if b % a == 0:\n return a\n else:\n return(gcd(b % a, a))\n else:\n if a % b == 0:\n return b\n else:\n return(gcd(a % b, b))\n\n\nans = gcd(a[0], a[1])\n\nfor i in range(2, len(a)):\n ans = gcd(ans, a[i])\n\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s329362380', 's660657211', 's723141271', 's405961651']
[14252.0, 14480.0, 14228.0, 14252.0]
[2104.0, 84.0, 2104.0, 71.0]
[548, 344, 541, 368]
p03127
u119983020
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nA = [int(n) for n in input().split()]\n\ndef gcd(a,b):\n while b>0:\n a, b = b, a%b \n return a\n\ntemp_gcm = gcm(A[0],A[1])\n for i in range(2,N):\n temp_gcm = gcm(A[i],temp_gcm)\nprint(temp_gcm)\n', 'N = int(input())\nA = [int(n) for n in input().split()]\n\ndef gcd(a,b):\n while b>0:\n a, b = b, a%b \n return a\n\ntemp_gcm = gcm(A[0],A[1])\nfor i in range(2,N):\n temp_gcm = gcm(A[i],temp_gcm)\nprint(temp_gcm)\n', 'N = int(input())\nA = [int(n) for n in input().split()]\n\ndef gcd(a,b):\n while b>0:\n a, b = b, a%b \n return a\n\ntemp_gcd = gcd(A[0],A[1])\nfor i in range(2,N):\n temp_gcd = gcd(A[i],temp_gcd)\nprint(temp_gcd)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s159948012', 's639407933', 's662684445']
[2940.0, 14252.0, 14224.0]
[18.0, 47.0, 74.0]
[221, 209, 219]
p03127
u129492036
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['# -*- coding: utf-8 -*-\nfrom functools import reduce\n\ndef gcd(a, b):\n x = max(a, b)\n y = min(a, b)\n z = y\n while x%y != 0:\n z = x%y\n x = y\n y = z\n else:\n return z\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\n\nN = int(input())\n\nA = list(map(int, input().split()))\n\nprint(gcd_list(A))', '# -*- coding: utf-8 -*-\nfrom functools import reduce\n\ndef gcd(a, b):\n x = max(a, b)\n y = min(a, b)\n z = y\n while x%y != 0:\n z = x%y\n x = y\n y = z\n else:\n return z\n \n\ndef gcd_list(numbers):\n return reduce(gcd, numbers)\n\n\nN = int(input())\n\nA = list(map(int, input().split()))\n\nprint(gcd_list(A))']
['Runtime Error', 'Accepted']
['s172099357', 's776243558']
[14748.0, 14596.0]
[48.0, 96.0]
[342, 350]
p03127
u144980750
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n=int(input())\na=[map(int,input().split()) for i in range(n)]\nb=a[0]\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\n\nfor i in a:\n b=gcd(b,i)\nprint(b)', 'n=int(input())\na=[int(i) for i in input().split()]\nb=a[0]\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\n\nfor i in a:\n b=gcd(b,i)\nprint(b)']
['Runtime Error', 'Accepted']
['s502075953', 's072645172']
[11096.0, 14252.0]
[28.0, 70.0]
[153, 142]
p03127
u163320134
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['def gcd(a,b):\n a,b=max(a,b),min(a,b)\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n \nn=int(input())\narr=list(map(int,input().split()))\nfor i in range(n-1):\n tmp=gcd(arr[i],arr[i+1])\nprint(tmp)', 'def gcd(a,b):\n a,b=max(a,b),min(a,b)\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n\nn=int(input())\narr=list(map(int,input()))\nfor i in range(n-1):\n tmp=gcd(arr[i],arr[i+1])\nprint(tmp)', 'def gcd(a,b):\n a,b=max(a,b),min(a,b)\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n \nn=int(input())\narr=list(map(int,input()))\ntmp=gcd(arr[0],arr[1])\nfor i in range(1,n):\n tmp=gcd(tmp,arr[i])\nprint(tmp)', 'def gcd(a,b):\n a,b=max(a,b),min(a,b)\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n \nn=int(input())\narr=list(map(int,input().split()))\ntmp=gcd(arr[0],arr[1])\nfor i in range(1,n):\n tmp=gcd(tmp,arr[i])\nprint(tmp)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s139551292', 's738962305', 's803478458', 's917615552']
[15020.0, 5028.0, 5132.0, 14224.0]
[956.0, 19.0, 19.0, 147.0]
[202, 193, 212, 220]
p03127
u169350228
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['from math import gcd\nn = int(input())\na = list(map(int,input().split()))\n\ng = a[0]\nfor i in a:\n g = gcd(g,i)\n\nprint(i)\n', 'from math import gcd\nn = int(input())\na = list(map(int,input().split()))\n\ng = a[0]\nfor i in a:\n g = gcd(g,i)\n\nprint(g)\n']
['Wrong Answer', 'Accepted']
['s175917561', 's054333299']
[20392.0, 20356.0]
[52.0, 54.0]
[122, 122]
p03127
u177756077
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N=int(input())\nA=list(map(int,input().split()))\n\nwhile len(A)!=1:\n\n A.sort()\n if A.count(0):A.remove(0)\n for i in range(len(A)-1): \n A[i+1]=A[i+1]%A[0]\n\nprint(max(A))', 'N=int(input())\nA=list(map(int,input().split()))\n\nwhile len(set(A)) != 1:\n A.sort()\n print(A)\n B=list(map(lambda i:i%min(A), A[1:]))\n B.append(A[0])\n print(B)\n while B.count(0):\n B.remove(0)\n print(B)\n A=B\nprint(max(A))', 'N=int(input())\nA=list(map(int,input().split()))\n\ndef gcd(a,b):\n while b:\n a,b=b,a%b\n return a\n\nA.sort()\ny=A[0]\nfor i in range(1,N):\n y=gcd(y,A[i])\nprint(y)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s340319525', 's924294718', 's039539688']
[14252.0, 14224.0, 14224.0]
[158.0, 2104.0, 114.0]
[212, 249, 171]
p03127
u193927973
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N=int(intput())\nM=list(map(int, input().split()))\nans=min(M)\nfor m in M:\n if m%ans!=0:\n ans=1\n break\nprint(ans)', 'N=int(input())\nM=list(map(int, input().split()))\nans=min(M)\nmn=Min(M)\nfrom math import gcd\nfor m in M:\n if m%ans!=0:\n ans=min(ans, gcd(mn,m))\nprint(ans)', 'N=int(input())\nM=list(map(int, input().split()))\nans=min(M)\nmn=Min(M)\nfrom math import gcd\nfor m in M:\n if m%ans!=0:\n ans=min(ans, gcd(mn,m))\n break\n', 'N=int(input())\nM=list(map(int, input().split()))\nans=min(M)\nmn=Min(M)\nfor m in M:\n if m%ans!=0:\n ans=min(ans, gcd(mn,m))\n break', 'N=int(input())\nM=list(map(int, input().split()))\nans=min(M)\nmn=min(M)\nfrom math import gcd\nfor m in M:\n if m%mn!=0:\n ans=min(ans, gcd(mn,m))\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s488596823', 's558413219', 's566294205', 's660504585', 's593187261']
[8996.0, 20028.0, 19944.0, 20036.0, 20064.0]
[26.0, 51.0, 50.0, 51.0, 92.0]
[118, 156, 156, 134, 156]
p03127
u201856486
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['# coding: utf-8\nimport sys\n\n\n# import math\n# import itertools\n\nimport numpy as np\n\n\n"""Template"""\n\n\nclass IP:\n \n\n def __init__(self):\n self.input = sys.stdin.readline\n\n def I(self):\n \n return int(self.input())\n\n def S(self):\n \n return self.input()\n\n def IL(self):\n \n return list(map(int, self.input().split()))\n\n def SL(self):\n \n return list(map(str, self.input().split()))\n\n def ILS(self, n):\n \n return [int(self.input()) for _ in range(n)]\n\n def SLS(self, n):\n \n return [self.input() for _ in range(n)]\n\n def SILS(self, n):\n \n return [self.IL() for _ in range(n)]\n\n def SSLS(self, n):\n \n return [self.SL() for _ in range(n)]\n\n\nclass Idea:\n def __init__(self):\n pass\n\n def HF(self, p):\n \n return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))\n\n def Bfs2(self, a):\n \n \n # https://blog.rossywhite.com/2018/08/06/bit-search/\n \n value = []\n for i in range(1 << len(a)):\n output = []\n\n for j in range(len(a)):\n if self.bit_o(i, j):\n \n # output.append(a[j])\n output.append(a[j])\n value.append([format(i, \'b\').zfill(16), sum(output)])\n\n value.sort(key=lambda x: x[1])\n bin = [value[k][0] for k in range(len(value))]\n val = [value[k][1] for k in range(len(value))]\n return bin, val\n\n def S(self, s, r=0, m=-1):\n \n r = bool(r)\n if m == -1:\n s.sort(reverse=r)\n else:\n s.sort(reverse=r, key=lambda x: x[m])\n\n def bit_n(self, a, b):\n \n return bool((a >> b & 1) > 0)\n\n def bit_o(self, a, b):\n \n return bool(((a >> b) & 1) == 1)\n\n def ceil(self, x, y):\n \n return -(-x // y)\n\n def ave(self, a):\n \n return sum(a) / len(a)\n\n def gcd(self, x, y):\n if y == 0:\n return x\n else:\n return self.gcd(y, x % y)\n\n\n\n\n\ndef main():\n \n r, e = range, enumerate\n ip = IP()\n id = Idea()\n\n \n n = ip.I()\n a = ip.IL()\n a = np.array(a)\n i = 2\n k = a\n while k.dtype == "int32":\n k = a / [i] * n\n i += 1\n\n print(i - 1)\n \n\nmain()\n', 'def gcd(x, y):\n \n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\n\nn = int(input())\na = list(map(int, input().split()))\n\n\n\nans = min(gcd(a[0], x) for x in a)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s588724522', 's515816730']
[23312.0, 14224.0]
[180.0, 318.0]
[4793, 393]
p03127
u224554402
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n= int(input())\na_list = list(map(int, input().split()))\ngcd = a_list[0]\nfor i in range(1,n):\n gcd = math.gcd(gcd,a_list[i])\n \n \nprint(gcd)', 'import math\nn= int(input())\na_list = list(map(int, input().split()))\ngcd = a_list[0]\nfor i in range(1,n):\n gcd = math.gcd(gcd,a_list[i])\n \n \nprint(gcd)']
['Runtime Error', 'Accepted']
['s601855343', 's855400350']
[19832.0, 20432.0]
[48.0, 68.0]
[148, 160]
p03127
u227476288
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import math\n \nN = int(input())\nA = [int(i) for i in input().split()] \n\n \nprint(math.gcd(A))', 'def gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\nN = int(input())\nA = [int(i) for i in input().split()]\ng = A[0]\nfor n in range(1,N):\n g = gcd(g,A[n])\n\nprint(g)']
['Runtime Error', 'Accepted']
['s418029183', 's070345652']
[14252.0, 14224.0]
[46.0, 77.0]
[91, 168]
p03127
u231936499
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N=int(input())\na_list=[]\na_list = list(map(int, input().split())) \nmin_num=min(a_list)\nnokori_list=[i%min_num for i in a_list if i%min_num!=0]\nanswer=0\nif len(nokori_list)==0:\n print(min_num)\nelse:\n can_min=min(nokori_list)\n futuer_min=min_num%can_min\n while futuer_min>0:\n big=max(can_min,futuer_min)\n small=min(can_min,futuer_min)\n futuer_min=big%small\n if futuer_min==0:\n answer=small\n break\n \tanswer=small\n print(answer)', 'N=int(input())\na_list=[]\na_list = list(map(int, input().split())) \nmin_num=min(a_list)\nnokori_list=[i%min_num for i in a_list if i%min_num!=0]\nif len(nokori_list)==0:\n print(min_num)\nelse: \n while len(nokori_list)!=0:\n if len(nokori_list)==0:\n answer=min_num\n break\n else:\n nokori_list.append(min_num)\n min_num=min(nokori_list)\n new_list=[i%min_num for i in nokori_list if i%min_num!=0]\n nokori_list=new_list\n answer=min_num\n print(answer)']
['Runtime Error', 'Accepted']
['s778427194', 's582729848']
[3064.0, 14224.0]
[17.0, 71.0]
[510, 556]
p03127
u246820565
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\nA = list(map(int,input().split()))\n\n\n\n\ndef gcd(a,b):\n\tif b == 0:\n\t\treturn a\n\treturn gcd(b,a%b)\n\n\nx = A[0]\nfor i in a[1:]:\n\tx = gcd(x,i)\nprint(x)', 'n = int(input())\nA = list(map(int,input().split()))\n\n\n\n\ndef gcd(a,b):\n\tif b == 0:\n\t\treturn a\n\treturn gcd(b,a%b)\n\n\nx = A[0]\nfor i in A[1:]:\n\tx = gcd(x,i)\nprint(x)']
['Runtime Error', 'Accepted']
['s634899270', 's266476238']
[14252.0, 14252.0]
[43.0, 84.0]
[416, 416]
p03127
u249987458
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input())\na = list(map(int, input().split()))\nif max(a) != min(a):\n while a.count(0) != len(a)-1:\n print(a)\n a.sort()\n b = [a[0]]\n for i in a[1:]:\n if i%a[0] != 0:\n b.append(i%a[0])\n a = b\n print(max(a))\nelse:\n print(a[0])', 'n = int(input())\na = list(map(int, input().split()))\nif max(a) != min(a):\n while a.count(0) != len(a)-1:\n a.sort()\n b = [a[0]]\n for i in a[1:]:\n if i%a[0] != 0:\n b.append(i%a[0])\n a = b\n print(max(a))\nelse:\n print(a[0])']
['Wrong Answer', 'Accepted']
['s590233766', 's234300440']
[20000.0, 20004.0]
[125.0, 112.0]
[299, 282]
p03127
u252828980
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import math\nfrom functools import reduce\nn = int(input())\nli = list(map(int,input().split())\nprint(reduce(math.gcd,li))\n', 'n = int(input())\nL = list(map(int,input().split()))\n\ndef gcd(x,y):\n if y > x:\n x,y = y,x\n if x%y == 0:\n return y\n else:\n return gcd(y,x%y)\n \nfrom functools import reduce\nans = reduce(gcd,L)\nprint(ans)']
['Runtime Error', 'Accepted']
['s166255069', 's470492646']
[2940.0, 19936.0]
[17.0, 64.0]
[120, 237]
p03127
u253527353
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import numpy as np\n\nn = int(input())\n\na = input().split(\' \')\n\na = np.array(a).astype(int)\n\n\nwhile a[a>0].shape[0] > 1:\n not_0_a = a[a!=0]\n min_ = not_0_a.min()\n min_i = np.where(a == min_)\n a = a % min_\n a[min_i[0][0]] = min_\n print(a)\n\n """\n if a[a>0].shape[0] == 1:\n not_0_a = a[a!=0]\n min_ = not_0_a.min()\n """\n \nprint(min_)', 'import numpy as np\n\nn = int(input())\n\na = input().split(\' \')\n\na = np.array(a).astype(int)\n\n\nwhile a[a>0].shape[0] > 1:\n not_0_a = a[a!=0]\n min_ = not_0_a.min()\n min_i = np.where(a == min_)\n a = a % min_\n a[min_i[0][0]] = min_\n\n """\n if a[a>0].shape[0] == 1:\n not_0_a = a[a!=0]\n min_ = not_0_a.min()\n """\n \nprint(min_)']
['Wrong Answer', 'Accepted']
['s440811101', 's841843232']
[27420.0, 27424.0]
[205.0, 202.0]
[397, 386]
p03127
u278356323
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['# ABC118c\nfrom fractions import gcd\nimport sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\nn = int(input())\na = list(map(int, input().split()))\n#from functools import reduce\n\n\ndef gcds(*numbers):\n return reduce(gcd, numbers)\n\n\nprint(gcds(a))\nexit(0)\n\n\ndef solve(l):\n m = min(l)\n nl = list()\n for i in l:\n if i % m != 0:\n nl.append(i % m)\n nl.append(m)\n # print(nl)\n if len(nl) == 1:\n return m\n return solve(nl)\n\n\nprint(solve(a))\n', '# ABC118c\nfrom functools import reduce\nfrom fractions import gcd\nimport sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\nn = int(input())\na = list(map(int, input().split()))\n\n\ndef gcds(*numbers):\n return reduce(gcd, numbers)\n\n\nprint(gcds(a))\nexit(0)\n\n\ndef solve(l):\n m = min(l)\n nl = list()\n for i in l:\n if i % m != 0:\n nl.append(i % m)\n nl.append(m)\n # print(nl)\n if len(nl) == 1:\n return m\n return solve(nl)\n\n\nprint(solve(a))\n', '# ABC118c\nimport sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\nn = int(input())\na = list(map(int, input().split()))\n\n\ndef solve(l):\n m = min(l)\n nl = list()\n for i in l:\n if i % m != 0:\n nl.append(i % m)\n nl.append(m)\n # print(nl)\n if len(nl) == 1:\n return m\n return solve(nl)\n\n\nprint(solve(a))\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s293117994', 's675180387', 's134137428']
[16304.0, 16244.0, 14252.0]
[61.0, 71.0, 74.0]
[491, 490, 356]
p03127
u286955577
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['def f(a, m):\n if a % m == 0:\n return m\n else:\n return a % m\n\ndef solve():\n N = int(input())\n A = list(map(int, input().split()))\n while True:\n m = min(A)\n print(list(map(lambda a: f(a, m), A)))\n A = list(map(lambda a: f(a, m), A))\n if all([a == m for a in A]): return m\n\nprint(solve())\n', 'def f(a, m):\n if a % m == 0:\n return m\n else:\n return a % m\n\ndef solve():\n N = int(input())\n A = list(map(int, input().split()))\n while True:\n m = min(A)\n A = list(map(lambda a: f(a, m), A))\n if all([a == m for a in A]): return m\n\nprint(solve())\n']
['Wrong Answer', 'Accepted']
['s372222384', 's527888890']
[14252.0, 15020.0]
[175.0, 104.0]
[309, 266]
p03127
u289036437
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input()) \na = list(map(int, input().split()))\ny = a[0]\nfor i in range(1,n):\n x = a[i]\n if(x < y):\n c = x\n x = y\n y = c\n while(y != 0):\n print(x,y)\n c = x % y\n x = y\n y = c\n y = x\n if(y == 1):\n break\nprint(y)', 'n = int(input()) \na = list(map(int, input().split()))\ny = a[0]\nfor i in range(1,n):\n x = a[i]\n if(x < y):\n c = x\n x = y\n y = c\n while(y != 0):\n c = x % y\n x = y\n y = c\n y = x\n if(y == 1):\n break\nprint(y)']
['Wrong Answer', 'Accepted']
['s614961003', 's400936080']
[14252.0, 14252.0]
[203.0, 88.0]
[286, 267]
p03127
u305018585
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
["import numpy as np\ni = input()\nN = list(map(int, input().split(' ')))\ndef one_turn(l):\n l.sort()\n n = l[0]\n n2 = l[1]\n \n return np.array([n,n2]+[ i-n for i in l[2:] if ((i%n != 0)or(i%n2 != 0)) ])\n\nif len(set(N)) == 1 :\n print(N[0])\nelse :\n N = np.array(N)\n while True :\n N = one_turn(N)\n if N[0] == 1 :\n print(1)\n break\n if len(N) == 1 :\n print(N[0])\n break", 'import numpy as np\n\nN= int(input())\n\nA=list(map(int,input().split()))\nA.sort()\n\ndef gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n \n\nr = 0\nfor i in A:\n r = gcd(i,r)\nprint(r)\n ']
['Time Limit Exceeded', 'Accepted']
['s013705161', 's160034700']
[23320.0, 38064.0]
[2110.0, 173.0]
[395, 196]
p03127
u320567105
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import math', 'def main():\n input()\n A = list(map(int,input().split()))\n\n b = min(A)\n for a in A:\n while True:\n if a%b == 0:\n break\n a,b = b, a%b\n print(b)\n\nmain()']
['Wrong Answer', 'Accepted']
['s399079747', 's178558616']
[2940.0, 14224.0]
[17.0, 54.0]
[11, 207]
p03127
u321035578
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
["import fractions\ndef main():\n n = int(input())\n a = list(map(int,input().split()))\n a.sort()\n ans = a[0]\n for i,a_i in enumerate(a,1):\n if ans == a_i:\n continue\n elif ans % a_i == 0 or a_i % ans == 0:\n ans = min(ans, fractions.gcd(ans,a_i))\n elif ans % 2 == 0 and a_i % 2 == 0:\n ans = 2\n else:\n ans = 1\n print(ans)\n return\n print(ans)\nif __name__=='__main__':\n main()\n", "import math\ndef main():\n n = int(input())\n a = list(map(int,input().split()))\n a.sort()\n ans = a[0]\n tmp = 0\n while True:\n for i in range(1,n):\n\n a[i] %= ans\n if a[i] != 0:\n tmp = min(ans,a[i])\n if sum(a) == ans:\n print(ans)\n return\n a.sort()\n ans = tmp\n a[0] = tmp\n\nif __name__=='__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s435934077', 's186776160']
[16292.0, 15148.0]
[155.0, 379.0]
[483, 415]
p03127
u327619396
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nmonsters = list(map(int, input().split()))\n\nmonsters.sort(reverse=True)\nprint(monsters)\nans = min(monsters)\n\nwhile ans > 0:\n maxnum = max(monsters)\n minnum = min(monsters)\n maxidx = monsters.index(maxnum)\n\n if maxnum % minnum == 0:\n del monsters[maxidx]\n if len(monsters) == 1:\n print(monsters[0])\n quit()\n else:\n ans = maxnum % minnum\n monsters[maxidx] = ans', "N = int(input())\nmonsters = list(map(int, input().split()))\n\nmonsters.sort() \nminnum = monsters[0]\n\ncnt = len(monsters)\nminidx = 0\nwhile cnt > 1:\n for i in range(cnt - 1, 0, -1):\n monsters[i] = monsters[i] % monsters[0]\n\n if monsters[i] == 0:\n del monsters[i]\n\n elif monsters[i] == 1:\n print('1')\n quit()\n\n workmin = min(monsters)\n minidx = monsters.index(min(monsters))\n monsters[minidx] = monsters[0]\n monsters[0] = workmin\n\n cnt = len(monsters)\n\nprint(monsters[0])"]
['Wrong Answer', 'Accepted']
['s626234565', 's872862584']
[14252.0, 14252.0]
[2104.0, 112.0]
[441, 548]
p03127
u336721073
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nA = list(map(int, input().split(" ")))\nA = [a for a in A if a >= 1]\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\ntemp = A[0]\nfor i in range(N-1):\n temp = gcd(A[i], A[i+1])\n if temp == 1:\n break\nprint(temp)', 'N = int(input())\nA = list(map(int, input().split(" ")))\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\ntemp = A[0]\nfor i in range(N-1):\n temp = gcd(A[i], A[i+1])\n if temp == 1:\n break\nprint(temp)', 'N = int(input())\nA = list(map(int, input().split(" ")))\nA = [a for a in A if a >= 1]\n\ndef gcd(x, y):\n while y != 0:\n x, y = y, x % y\n return x\n\ntemp = A[0]\nfor i in range(N-1):\n temp = gcd(temp, A[i+1])\n if temp == 1:\n break\nprint(temp)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s276359331', 's633332223', 's436553841']
[14224.0, 15020.0, 14224.0]
[149.0, 146.0, 84.0]
[262, 233, 262]
p03127
u347452770
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['n = int(input()) # the num of monster\n\nls = list(map(int, input().split()))\n\nls.sort()\n\nfor i in range(len(ls)-1):\n if(len(ls)==1):\n print(len[0])\n for j in range(1, len(ls)):\n if(ls[j] % ls[i] == 0):\n ls.remove(ls[j])\n\n', 'n = int(input()) # the num of monster\n \nls = list(map(int, input().split()))\nn = len(ls)\nans = math.gcd(ls[0], ls[1])\n\nfor i in range(n):\n ans = math.gcd(ans, ls[i])\n \nprint(ans)', 'n = int(input()) # the num of monster\n \nls = list(map(int, input().split()))\nn = len(ls)\n\ndef gcd(a,b):\n while b != 0:\n a,b = b, a % b\n return a\n\nans = gcd(ls[0], ls[1])\n \nfor i in range(n):\n ans = gcd(ans, ls[i])\n \nprint(ans)\n\n ']
['Runtime Error', 'Runtime Error', 'Accepted']
['s626780272', 's984813759', 's292214389']
[14252.0, 14224.0, 14224.0]
[2108.0, 42.0, 75.0]
[233, 184, 241]
p03127
u350997995
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['from fractions import gcd\nn = int(input())\na = list(map(int,input().split()))\nmina = max(a)\na.sort()\nfor i in range(n-1):\n mina = min(mina,math.gcd(a[i],a[i+1]))\nprint(mina)\n', 'from fractions import gcd\nn = int(input())\na = list(map(int,input().split()))\nmina = max(a)\nfor i in range(n-1):\n mina = min(mina,math.gcd(a[i],a[i+1]))\nprint(mina)\n', 'n = int(input())\na = list(map(int,input().split()))\nmina = max(a)\ndef gcd(x,y):\n if y==0:\n return x\n else:\n return gcd(y,x%y)\na.sort()\nfor i in range(n-1):\n mina = min(mina,gcd(a[i],a[i+1]))\nprint(mina)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s291421584', 's953025499', 's351215856']
[16284.0, 16280.0, 14224.0]
[100.0, 64.0, 263.0]
[177, 168, 225]
p03127
u353797797
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['while len(h)>1:\n kh=[]\n for i in range(len(h)):\n mn = min(h)\n md=h[i]%mn\n if md!=0:\n kh.append(md)\n kh.append(mn)\n h=list(set(kh))\nprint(mn)', 'def gcd(x,y):\n while y:\n x,y=y,x%y\n return x\n\nn=int(input())\na=list(map(int,input().split()))\nans=a[0]\nfor ak in a[1:]:\n ans=gcd(ans,ak)\nprint(ans)']
['Runtime Error', 'Accepted']
['s195471316', 's570760495']
[2940.0, 14224.0]
[17.0, 69.0]
[188, 163]
p03127
u365364616
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['from fraction import gcd\n\nn = int(input())\na = list(map(int, input().split()))\nx = a[0]\nfor i in range(1, n):\n x = gcd(x, a[i])\n if x == 1:\n break\nprint(x)\n', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nn = int(input())\na = list(map(int, input().split()))\nx = a[0]\nfor i in range(1, n):\n x = gcd(x, a[i])\nprint(x)\n']
['Runtime Error', 'Accepted']
['s055748890', 's291820330']
[2940.0, 14252.0]
[18.0, 72.0]
[169, 180]
p03127
u365858785
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import math\nn=int(input())\nlis=list(map(int,input().split()))\ni=0\nwhile len(lis)<i:\n lis+=math.gcd(lis[i],lis[i+1])\nprint(lis[-1])', 'def gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\nn=int(input())\nlis=list(map(int,input().split()))\ni=0\nwhile len(lis)-1>i:\n lis+=[gcd(lis[i],lis[i+1])]\n i+=2\nprint(lis[-1])']
['Wrong Answer', 'Accepted']
['s098803353', 's847204290']
[15020.0, 14224.0]
[42.0, 242.0]
[131, 193]
p03127
u374103100
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['\n\ndef main():\n N = int(input())\n A = list(map(int, input().split())) \n\n while True:\n A.sort()\n print(A)\n min_diff = A[0]\n diff_index = -1\n for i in range(1, N):\n diff = A[i] - A[i - 1]\n # print("{} - {} == {}".format(A[i], A[i - 1], diff))\n if diff < min_diff and diff != 0:\n min_diff = diff\n diff_index = i\n # print("{}, index = {}".format(min_diff, diff_index))\n # exit()\n\n if diff_index == -1: \n print(A[0])\n exit()\n else:\n A[diff_index] = min_diff\n\n\nmain()\n', '\n\ndef main():\n N = int(input())\n A = list(map(int, input().split())) \n\n while True:\n A.sort()\n\n before_min = A[0]\n after_min = before_min\n for i in range(1, N):\n A[i] = (A[i] % A[0]) if A[i] % A[0] != 0 else A[i]\n after_min = min(after_min, A[i])\n\n # print(A)\n if before_min == after_min:\n print(before_min)\n exit()\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s085749005', 's091506802']
[14252.0, 14224.0]
[130.0, 188.0]
[753, 479]
p03127
u375542418
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import numpy as np\n\nN = int(input())\n\nA = [int(i) for i in input().split()]\nA = np.array(A)\nprint(N,A)\n\nmin_amari = min(A)\nwhile 0==0:\n amari = A%min_amari\n amari = amari[amari!=0]\n if len(amari)==0:\n print(min_amari)\n break\n else:\n min_amari = min(amari)', 'import numpy as np\n\nN = int(input())\n\nA = [int(i) for i in input().split()]\nA = np.array(A)\n\nmin_amari = min(A)\nwhile 0==0:\n amari = A%min_amari\n amari = amari[amari!=0]\n if len(amari)==0:\n print(min_amari)\n break\n else:\n min_amari = min(amari)\n\n']
['Wrong Answer', 'Accepted']
['s386544653', 's328321740']
[23128.0, 23124.0]
[203.0, 200.0]
[268, 259]
p03127
u382748202
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef gcd_arr(a):\n ans = a[0]\n for i, a_i in enumerate(a):\n ans = gcd(ans, a_i)\n return ans\n\nprint(gcd_arr(A))', 'N = int(input())\nA = list(map(int, input().split()))\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef gcd_arr(a):\n ans = a[0]\n for i, a_i in enumerate(a):\n ans = gcd(ans, a_i)\n return ans\n\nprint(gcd_arr(A))']
['Runtime Error', 'Accepted']
['s410751839', 's078651714']
[2940.0, 14252.0]
[17.0, 81.0]
[198, 253]
p03127
u384793271
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import heapq\n\nn = int(input())\nA = list(map(lambda x: int(x) * (-1), input().split()))\n\nheapq.heapify(A)\n\nwhile len(A) > 1:\n print(A)\n Amax1 = heapq.heappop(A) * (-1)\n Amax2 = heapq.heappop(A) * (-1)\n pushA = Amax1 % Amax2\n if pushA == 0:\n heapq.heappush(A, Amax2 * (-1))\n else:\n heapq.heappush(A, pushA * (-1))\n heapq.heappush(A, Amax2 * (-1))\n\nprint(A[0] * (-1))', 'import heapq\n\nn = int(input())\nA = list(map(lambda x: int(x) * (-1), input().split()))\n\nheapq.heapify(A)\n\nwhile len(A) > 1:\n Amax1 = heapq.heappop(A) * (-1)\n Amax2 = heapq.heappop(A) * (-1)\n pushA = Amax1 % Amax2\n if pushA == 0:\n heapq.heappush(A, Amax2 * (-1))\n else:\n heapq.heappush(A, pushA * (-1))\n heapq.heappush(A, Amax2 * (-1))\n\nprint(A[0] * (-1))']
['Runtime Error', 'Accepted']
['s169240443', 's585594248']
[142680.0, 14184.0]
[1520.0, 492.0]
[403, 390]
p03127
u412179193
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['def gcd(a,b):\n lt,gt = sorted([a,b])\n if lt == 0:\n return gt\n else:\n return gcd(gt % lt,lt)\n\ndef q3():\n N = int(input())\n A = list(map(int,input().split()))\n assert(N == len(A))\n ret = A[0]\n for n in range(1,N):\n ret = gcd(ret,A[n])\n print(ret)', 'def gcd(a,b):\n lt,gt = sorted([a,b])\n if lt == 0:\n return gt\n else:\n return gcd(gt % lt,lt)\n\ndef q3():\n N = int(input())\n A = list(map(int,input().split()))\n assert(N == len(A))\n ret = A[0]\n for n in range(1,N):\n ret = gcd(ret,A[n])\n print(ret)\n \nq3()']
['Wrong Answer', 'Accepted']
['s022390668', 's518704925']
[3064.0, 14252.0]
[17.0, 140.0]
[292, 302]
p03127
u416773418
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N=int(input())\nA=[i for i in map(int,input().split())]\nmini=min(A)\nwhile mini>0:\n for i in range(len(A)):\n if A[i]!=mini:\n A[i]=A[i]%mini\n z=A.count(0)\n A=sorted(A)[z:]\n m=A[0]\n if m==1:\n break\nprint(A[0])', 'N=int(input())\nA=[int for i in input().split()]\nmini=min(A)\nwhile mini>0:\n for i in range(len(A)):\n if A[i]!=mini:\n A[i]=A[i]%mini\n z=A.count(0)\n A=sorted(A)[z:]\n m=A[0]\n if m==1:\n break\n else:\n if [i%m for i in A]==[0]*len(A):\n break\nprint(A[0])\n', 'N = int(input())\nA = [int(_) for _ in input().split()]\nm = min(A)\nwhile m > 0:\n for i in range(0,len(A)):\n if A[i] != m:\n A[i] = A[i]%m\n z = A.count(0)\n A = sorted(A)[z:]\n m = A[0]\n if m == 1:\n break\n else:\n if [_%m for _ in A] == [0]*len(A):\n break\nprint(m)']
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s090584133', 's670355469', 's784171168']
[14224.0, 11096.0, 14252.0]
[2104.0, 31.0, 109.0]
[245, 308, 319]
p03127
u417027396
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['import numpy as np\nn = int(input()) \n#n=3\nlst = [int(i) for i in input().split()]\n#lst = [2, 10, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [1000000000, 1000000000, 1000000000]\nhps = np.array(lst)\nwhile(1):\n hps = sorted(hps)\n print(hps)\n if(hps[0]==0): break\n if(hps[0]==hps[n-1]): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'import numpy as np\nn = int(input()) \n#n=4\nlst = [int(input()) for i in range(n)]\n#lst = [2, 10, 8, 40]\n#lst = [5, 13, 8, 1000000000]\nhps = np.array(lst)\nwhile(1):\n hps = sorted(hps)\n print(hps)\n if(hps[0]==0): break\n if(hps[0]==hps[n-1]): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'n = int(input()) \nlst = [int(input()) for i in range(n)]\nwhile(1):\n hps = sorted(hps)\n #print(hps)\n if(hps[0]==0): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'n = int(input()) \n#n=3\nlst = [int(i) for i in input().split()]\n#lst = [2, 10, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [1000000000, 1000000000, 1000000000]\nhps = set(lst)\nwhile(1):\n hps = sorted(hps)\n print(hps)\n if(hps[0]==0): break\n if(hps[0]==hps[n-1]): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'import numpy as np\nn = int(input()) \n#n=3\nlst = [int(i) for i in input().split()]\n#lst = [2, 10, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [1000000000, 1000000000, 1000000000]\nhps = np.array(lst)\nwhile(1):\n hps = np.array(sorted(hps))\n #print(hps)\n #print(hps!=0)\n #print(sum(hps!=0))\n if(sum(hps==0)!=1):\n hps[1] = hps[len(hps)-1]\n break\n if(hps[0]==0): break\n if(hps[0]==hps[len(hps)-1]): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'n = int(input()) \nlst = [int(i) for i in input().split()]\nwhile(1):\n hps = sorted(hps)\n #print(hps)\n if(hps[0]==0): break\n hps[1] = hps[1] - hps[0]\nprint(hps[1])', 'n = int(input()) \n#n=4\nhps = [int(i) for i in input().split()]\n#lst = [2, 2, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [0, 1, 0]\n ##2 4 5 -> 1\n \nhps = sorted(hps)\nfor i in range(1,n):\n hps[0] = gcd(hps[i], hps[0])\n#print(hps)\nfor i in range(len(hps)):\n if(hps[i]==0): continue\n print(hps[i])\n break', 'import numpy as np\nn = int(input()) \n#n=4\nlst = [int(i) for i in input().split()]\n#lst = [2, 2, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [0, 1, 0]\nhps = np.array(lst)\nwhile(1):\n hps = sorted(hps)\n #print(hps)\n if(hps[0]==0): break\n if(hps[0]==hps[len(hps)-1]): break\n hps[1] = hps[1] - hps[0]\nfor i in range(len(hps)):\n if(hps[i]==0): continue\n print(hps[i])', 'def gcd(a,b):\n r = a%b\n #print(a,b,r)\n if(r==0): return b\n return gcd(b,r)\nn = int(input()) \n#n=4\nhps = [int(i) for i in input().split()]\n#lst = [2, 2, 8, 40]\n#lst = [5, 13, 8, 1000000000]\n#lst = [0, 1, 0]\n ##2 4 5 -> 1\n \nhps = sorted(hps)\nfor i in range(1,n):\n hps[0] = gcd(hps[i], hps[0])\n#print(hps)\nfor i in range(len(hps)):\n if(hps[i]==0): continue\n print(hps[i])\n break']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s003379176', 's340021880', 's348878023', 's376422837', 's459678655', 's711252887', 's727741779', 's895927863', 's668280836']
[31604.0, 22460.0, 5028.0, 14252.0, 23888.0, 14252.0, 14224.0, 23120.0, 14224.0]
[2109.0, 299.0, 22.0, 105.0, 564.0, 46.0, 80.0, 825.0, 113.0]
[344, 299, 172, 320, 476, 173, 348, 382, 435]
p03127
u432333240
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['N = int(input())\nHP_list = [int(i) for i in input().split()]\nwhile len(set(HP_list))>1:\n for i in range(0, len(set(HP_list))):\n min_HP = min(HP_list)\n if HP_list[i] > min_HP:\n HP_list[i] = HP_list%min_HP\n if HP_list[i]==0:\n HP_list[i] += min_HP\nprint(list(set(HP_list))[0])', 'import numpy as np\nN = int(input())\nHPs = np.array([int(i) for i in input().split()])\nnp.sort(HPs)\nwhile len(HPs) > 1:\n HPs[1:] %= HPs[0]\n HPs[HPs==0] = HPs[0]\n HPs=np.unique(HPs)\nprint(HPs[0])']
['Runtime Error', 'Accepted']
['s111134372', 's443505048']
[14252.0, 23100.0]
[61.0, 216.0]
[327, 202]
p03127
u434872492
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['def solve(m_list):\n m_val = m_list[0]\n for i in m_list:\n m_val = min(m_val,gcd(min_val,m))\n return m_val\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef main():\n n = int(input())\n m_list = list(map(int,input().split()))\n\n ans = solve(m_list)\n print(ans)\n\nmain()', 'def solve(m_list):\n m_val = m_list[0]\n for i in m_list:\n m_val = min(m_val,gcd(m_val,m))\n return m_val\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef main():\n n = int(input())\n m_list = list(map(int,input().split()))\n\n ans = solve(m_list)\n print(ans)\n\nmain()', "def solve(m_list):\n m_val = m_list[0]\n for i in m_list:\n m_val = min(m_val,gcd(min_val,m))\n return min_val\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef main():\n n = int(input())\n m_list = list(map(int,input().split()))\n\n ans = solve(m_list)\n print(ans)\n\nif __name__ == '__main__':\n main()", 'def solve(m_list):\n m_val = m_list[0]\n for i in m_list:\n m_val = min(m_val,gcd(min_val,m))\n return min_val\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef main():\n n = int(input())\n m_list = list(map(int,input().split()))\n\n ans = solve(m_list)\n print(ans)\n\nmain()', 'def solve(m_list):\n m_val = m_list[0]\n for i in m_list:\n m_val = min(m_val,gcd(m_val,i))\n return m_val\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef main():\n n = int(input())\n m_list = list(map(int,input().split()))\n\n ans = solve(m_list)\n print(ans)\n\nmain()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s203344500', 's593996173', 's691681403', 's916868938', 's956404847']
[14252.0, 14224.0, 14224.0, 14252.0, 14224.0]
[42.0, 42.0, 42.0, 42.0, 76.0]
[307, 305, 340, 309, 305]
p03127
u436335113
2,000
1,048,576
There are N monsters, numbered 1, 2, ..., N. Initially, the health of Monster i is A_i. Below, a monster with at least 1 health is called alive. Until there is only one alive monster, the following is repeated: * A random alive monster attacks another random alive monster. * As a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking. Find the minimum possible final health of the last monster alive.
['# gcd\ndef gcd(a, b):\n\treturn gcd(b, a % b) if b != 0 else a\n\nL = [int(x) for x in input().split()]\n\nmax_gcd = L[0]\n\nfor i in range(1, N):\n max_gcd = gcd(max_gcd, L[i])\n\nprint(max_gcd)\n', '# gcd\ndef gcd(a, b):\n\treturn gcd(b, a % b) if b != 0 else a\n\nN = int(input())\nL = [int(x) for x in input().split()]\n\nmax_gcd = L[0]\n\nfor i in range(1, N):\n max_gcd = gcd(max_gcd, L[i])\n\nprint(max_gcd)\n']
['Runtime Error', 'Accepted']
['s719819318', 's793892045']
[3060.0, 14252.0]
[17.0, 90.0]
[187, 204]