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
p03125
u774985302
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B = map(int,input().split())\nif A % B == 0:\n print(A + B)\nelse:\n print(A-B)\n ', 'A,B = map(int,input().split())\nif round(A % B) == 0:\n print(A + B)\nelse:\n print(A-B)\n ', 'A,B = map(int,input().split())\nif A % B = 0:\n print(A + B)\nelse:\n print(A-B)\n ', 'A,B = map(int,input().split())\nif round(A % B) = 0:\n print(A + B)\nelse:\n print(A-B)\n ', 'A,B = map(int,input().split())\nif round(B%A) == 0:\n print(A + B)\nelse:\n print(B-A)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s005402119', 's528708731', 's628675747', 's748023583', 's781965750']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[82, 89, 81, 88, 84]
p03125
u777028980
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['n=int(input())\nhoge=list(map(int,input().split()))\n###\ndef huga(a,b):\n x=max(a,b)\n y=min(a,b)\n z=1\n for i in range(y):\n wa=y-i\n if(x%wa==0 and y%wa==0):\n z=wa\n break\n return z\n###\nhoge.sort(reverse=True)\nans=hoge[0]\nfor i in range(n-1):\n ans=huga(ans,hoge[i+1])\n \nprint(ans)', 'a,b=map(int,input().split())\n\nif(b%a==0):\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s441370578', 's763366224']
[3064.0, 2940.0]
[17.0, 18.0]
[297, 73]
p03125
u777394984
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B = map(int, input())\nif isinstance(A / B, int):\n print(A + B)\nelse:\n print(B - A)\n', 'a,b=map(int,input().split())\nprint(a+b if b%a==0 else b-a)']
['Runtime Error', 'Accepted']
['s780687485', 's527745562']
[2940.0, 2940.0]
[17.0, 17.0]
[87, 58]
p03125
u778700306
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['\na,b=map(int,input().split())\nprint(a+b if a%b==0 else b-a)', '\na,b=map(int,input().split())\nprint(a+b if b%a==0 else b-a)']
['Wrong Answer', 'Accepted']
['s895861568', 's808381002']
[3064.0, 2940.0]
[17.0, 19.0]
[59, 59]
p03125
u783420291
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input().split())\nif B % A == 0:\n print(B%A)\nelse :\n print(B - A)', 'A, B = map(int, input().split())\nif B % A == 0:\n print(B+A)\nelse :\n print(B - A)']
['Wrong Answer', 'Accepted']
['s474601549', 's227044809']
[2940.0, 2940.0]
[17.0, 18.0]
[86, 86]
p03125
u784169501
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
["A, B = [int(s) for in input().split(' ')]\n\nif A % B:\n print(A + B)\nelse:\n print(B - A)", "A, B = [int(s) for s in input().split(' ')]\n\nif A % B == 0:\n print(A + B)\nelse:\n print(B - A)", "A, B = [int(s) for s in input().split(' ')]\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s018300901', 's618960311', 's174305576']
[2940.0, 2940.0, 3060.0]
[18.0, 17.0, 20.0]
[88, 95, 95]
p03125
u795323188
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int,input().split())\nif b//a ==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b = map(int,input().split())\nif b%a ==0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s721355690', 's872461211']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 78]
p03125
u797016134
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int(input().split()))\nif b%a :\n print(b-a)\nelse:\n print(a+b)', 'a,b = map(int,input().split())\nif b%a :\n print(b-a)\nelse:\n print(a+b)']
['Runtime Error', 'Accepted']
['s721873765', 's767473611']
[2940.0, 2940.0]
[17.0, 17.0]
[76, 75]
p03125
u797550216
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int,input().split())\n\nif b / a == 0:\n print(a + b)\nelse:\n print(b - a)', 'a,b = map(int,input().split())\n \nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)']
['Wrong Answer', 'Accepted']
['s409580777', 's162449281']
[2940.0, 2940.0]
[18.0, 17.0]
[82, 83]
p03125
u798316285
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input(),split())\nprint(a+b if b%a==0 else b-a)', 'a,b=map(int,input().split())\nprint(a+b if b%a==0 else b-a)']
['Runtime Error', 'Accepted']
['s270068578', 's704884207']
[2940.0, 2940.0]
[18.0, 17.0]
[58, 58]
p03125
u798894056
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = list(map(int, input()))\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)\n', 'A, B = list(map(int, input().split()))\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)\n']
['Runtime Error', 'Accepted']
['s504979530', 's885632480']
[2940.0, 2940.0]
[17.0, 17.0]
[87, 95]
p03125
u801106491
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\n\nif type(b/a) is not int:\n print(b-a)\nelse:\n print(a+b)', 'a,b=map(int,input().split())\nc=b/a\nif c.is_integer()==True:\n print(b+a)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s026139468', 's053018862']
[2940.0, 2940.0]
[17.0, 18.0]
[90, 95]
p03125
u802963389
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B =map(int, input())\nif B % A == 0:\n print(A+B)\nelse:\n print(B-A)', 'A,B =map(int, input().split())\nif B % A == 0:\n print(A+B)\nelse:\n print(B-A)\n']
['Runtime Error', 'Accepted']
['s244305501', 's259281338']
[2940.0, 2940.0]
[17.0, 17.0]
[69, 78]
p03125
u812587837
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['###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)', '###A - B +/- A\nA, B = map(int, input().split())\nif B % A == 0:\n print(int(A+B))\nelse:\n print(int(B-A))']
['Runtime Error', 'Accepted']
['s993227157', 's019402839']
[3060.0, 2940.0]
[17.0, 18.0]
[379, 108]
p03125
u813102292
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['\nusing namespace std;\nint main(void){\n\tint a,b;\n\tcin >> a >> b;\n\tif (b%a==0) {\n\t\tcout << a+b << endl;\n\t}else {\n\t\tcout << b-a << endl;\n\t}\n\treturn 0;\n}', 'a,b = (int(i) for i in input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s535710841', 's071050401']
[2940.0, 2940.0]
[18.0, 18.0]
[168, 86]
p03125
u814265211
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = [int(i) for i in input().split()]\n\nprint(a+b if a % b == 0 else b-a)\n', 'a, b = [int(i) for i in input().split()]\n\nprint(a+b if b%a == 0 else b-a)\n']
['Wrong Answer', 'Accepted']
['s132151226', 's117491510']
[2940.0, 2940.0]
[17.0, 17.0]
[76, 74]
p03125
u814986259
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B=map(int,input().split())\nif A % B == 0:\n print(A+B)\nelse:\n print(A-B)', 'A,B=map(int,input().split())\nif A % B == 0:\n print(A+B)\nelse:\n print(B-A)', 'A,B=map(int,input().split())\nif B % A== 0:\n print(A+B)\nelse:\n print(B-A)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s864013329', 's986233532', 's023630724']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[75, 75, 74]
p03125
u816919571
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = int(input().split(" "))\nif (b%a == 0):\n print(a-b)\nelse :\n print(b-a)', 'a,b = map(int,input().split(" "))\nif (b%a == 0):\n print(a+b)\nelse :\n print(b-a)']
['Runtime Error', 'Accepted']
['s267668272', 's792426853']
[2940.0, 2940.0]
[17.0, 17.0]
[77, 81]
p03125
u819068380
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
["\ndef main(A, B):\n\t\n\tif A%B == 0:\n\t\treturn A+B\n\telse:\n\t\treturn B-A\n\n\nstdin = input().split(' ')\nstdin = [ int(c) for c in stdin]\nprint(main(stdin[0], stdin[1]))", "# your code goes here\n\ndef main(A, B):\n\t\n\tif B%A == 0:\n\t\treturn A+B\n\telse:\n\t\treturn B-A\n\n\nstdin = input().split(' ')\nstdin = [ int(c) for c in stdin]\nprint(main(stdin[0], stdin[1]))"]
['Wrong Answer', 'Accepted']
['s719911866', 's847811751']
[2940.0, 2940.0]
[17.0, 18.0]
[159, 181]
p03125
u827261928
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B=map(int(input().split()))\nif A%B==0:\n print(A+B)\nelse:\n print(A-B)', 'A,B=map(int(input().split()))\nif B%A==0:\n print(A+B)\nelse:\n print(A-B)', 'A,B=map(int,input().split())\nif B%A==0:\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s560017344', 's821927838', 's532754690']
[8876.0, 9056.0, 8876.0]
[24.0, 31.0, 28.0]
[76, 76, 75]
p03125
u831328139
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['import sys\n\nv = []\nfor line in sys.stdin:\n v.append(int(line))\n\nif v[1] % v[0] == 0:\n print(v[1] + v[0])\nelse:\n print(v[0] - v[1])', 'import sys\n\nv = []\nfor line in sys.stdin:\n v = [int(l) for l in line.split()]\n\nif v[1] % v[0] == 0:\n print(v[0] + v[1])\nelse:\n print(v[1] - v[0])\n ']
['Runtime Error', 'Accepted']
['s012146772', 's365792956']
[2940.0, 2940.0]
[17.0, 17.0]
[133, 151]
p03125
u834153484
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input().split())\ndef judge(A,B):\n if A%B == 0:\n print(A+B)\n else:\n print(B-A)\njudge(A,B)', 'A, B = map(int, input().split())\ndef judge(A,B):\n\n if B%A == 0:\n print(A+B)\n else:\n print(B-A)\njudge(A,B)']
['Wrong Answer', 'Accepted']
['s487138433', 's364755787']
[2940.0, 2940.0]
[17.0, 17.0]
[120, 121]
p03125
u835283937
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['def main():\n A, B = map(int, input().split())\n if A % B == 0:\n print(A+B)\n else:\n print(B-A)\nif __name__ == "__main__":\n main()', 'def main():\n A, B = map(int, input().split())\n if B % A == 0:\n print(A+B)\n else:\n print(B-A)\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Accepted']
['s433436109', 's546864636']
[2940.0, 2940.0]
[17.0, 17.0]
[153, 153]
p03125
u835482198
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int, input().split())\nif a % b == 0:\n print(a + b)\nelse:\n print(b - a)', 'a, b = map(int, input().split())\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)\n']
['Wrong Answer', 'Accepted']
['s135938525', 's550743022']
[3064.0, 2940.0]
[17.0, 17.0]
[87, 88]
p03125
u835732324
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = int(input().split())\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)\n ', 'a,b = map(int,input().split())\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s772858652', 's099475142']
[2940.0, 2940.0]
[18.0, 18.0]
[82, 81]
p03125
u843533351
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['def divisor(A, B):\n if A==1:\n return A + B\n if B==1:\n return B-A\n if B % A == 0:\n return A + B\n return B - A\n \n A, B = map(int, input().split(" "))\n print(divisor(A, B))', 'def divisor(A, B):\n if A==1:\n return A + B\n if B==1:\n return B-A\n if B % A == 0:\n return A + B\n return B - A', 'def divisor(A, B):\n if A==1 or B==1:\n return B-A\n if B % A == 0:\n return A + B\n return B - A', 'def divisor(A, B):\n if A==1:\n return A + B\n if B==1:\n return B-A\n if B % A == 0:\n return A + B\n return B - A', 'def divisor(A, B):\n if A==1:\n return A + B\n if B==1:\n return B-A\n if B % A == 0:\n return A + B\n return B - A\n\nA, B = map(int, input().split(" "))\nprint(divisor(A, B))']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s241681035', 's524309691', 's918035773', 's959589644', 's445184156']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[205, 141, 115, 141, 199]
p03125
u844789719
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = [int(_) for _ in input().split()]\nif A % B:\n print(B - A)\nelse:\n print(A + B)\n', 'A, B = [int(_) for _ in input().split()]\nif B % A:\n print(B - A)\nelse:\n print(A + B)\n']
['Wrong Answer', 'Accepted']
['s540446708', 's284256584']
[2940.0, 2940.0]
[17.0, 17.0]
[91, 91]
p03125
u846150137
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\nprint(a+b if b%a else b-a)', 'a,b=map(int,input().split())\nprint(a+b if b%a==0 else b-a)']
['Wrong Answer', 'Accepted']
['s867428354', 's434401874']
[2940.0, 2940.0]
[18.0, 17.0]
[55, 58]
p03125
u847033024
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int, input().split())\nif b / a == 0:\n print(a + b)\nelse:\n print(b - a)', 'a, b = map(int, input().split())\nif b & a == 0:\n print(a + b)\nelse:\n print(b - a)', 'a, b = map(int, input().split())\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s085988209', 's353064632', 's322354457']
[9068.0, 9076.0, 9096.0]
[29.0, 28.0, 26.0]
[83, 83, 83]
p03125
u850028278
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = int(input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)\n', 'a,b = map(int(input().split()))\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)\n', 'a, b = map(int, input().split())\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s132395310', 's961117201', 's562668089']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[74, 79, 84]
p03125
u852360042
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int, input().split())\n\nif a % b == 0:\n ans = a + b\nelse:\n ans = a - b\n\nprint(str(ans))', 'a, b = map(int, input().split())\n\nif a % b == 0:\n ans = a + b\nelse:\n ans = b - a\n\nprint(str(ans))', 'a, b = map(int, input().split())\n\nif b % a == 0:\n ans = a + b\nelse:\n ans = b - a\n\nprint(str(ans))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s081386424', 's939232125', 's782707743']
[2940.0, 2940.0, 2940.0]
[17.0, 19.0, 17.0]
[103, 103, 103]
p03125
u853185302
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B = map(int,input().split())\nprint(A+B if A%B==0 else B-A)', 'A,B = map(int,input().split())\nprint(A+B if B%A==0 else B-A)']
['Wrong Answer', 'Accepted']
['s229638936', 's138533736']
[2940.0, 2940.0]
[18.0, 18.0]
[60, 60]
p03125
u857428111
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input())\nans = a+b if (b%a==0) else b-a\nprint(ans)', 'a,b=map(int,input().split())\nans = a+b if (b%a==0) else b-a\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s345133516', 's434506241']
[2940.0, 2940.0]
[17.0, 17.0]
[62, 71]
p03125
u857673087
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B = map(int,input().split())\n\nprint(A+B if A%B==0 else B-A)', 'A,B = map(int,input().split())\n\nif A%B==0:\n print(A+B)\nelse:\n print(B-A)\n', 'A,B = map(int,input().split())\n\nprint(A+B if B%A==0 else B-A)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s370769230', 's708292611', 's791432270']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[61, 75, 62]
p03125
u859897687
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\nif a%b==0:\n print(a+b)\nelse:\n print(b-a)\n', 'a,b=map(int,input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)\n']
['Wrong Answer', 'Accepted']
['s966001417', 's262697670']
[2940.0, 2940.0]
[17.0, 20.0]
[72, 72]
p03125
u863397945
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B = map(int,input().split())\n \nif B//A==0:\n print(A+B)\nelse:\n print(A-B)', 'A,B = map(int,input().split())\n \nif A%B==0:\n print(A+B)\nelse:\n print(A-B)', 'A,B = map(int,input().split())\n \nif B%A==0:\n print(A+B)\nelse:\n print(B-A)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s706485502', 's997340887', 's118257909']
[9076.0, 8992.0, 8952.0]
[29.0, 31.0, 27.0]
[76, 75, 75]
p03125
u864667985
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['\nusing namespace std;\n\nint main() {\n int A, B;\n cin >> A >> B;\n if (B % A == 0) cout << (A+B) << endl;\n else cout << (B-A) << endl;\n}\n', '\nusing namespace std;\n\nint main() {\n int A, B;\n cin >> A >> B;\n if (B % A == 0) cout << A+B << endl;\n else cout << B-A << endl;\n}\n', 'A, B = list(map(int, input().split()))\n\nif (B % A == 0):\n print(A+B)\nelse:\n print(B-A)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s573481192', 's787886778', 's862527802']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[165, 161, 93]
p03125
u865413330
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['n, m = map(int, input().split())\nfavFood = [input().split() for i in range(n)]\nfor i in favFood:\n del i[:1]\n\nif not(n == 1):\n count = 0\n for i in range(1, m):\n check = True\n for j in range(n):\n if not (str(i) in favFood[j]):\n check = False\n if check:\n count += 1\n print(count)\n\nelse:\n print(len(favFood))\n\n', 'n, m = map(int, input().split())\nfavFood = [input().split() for i in range(n)]\nfor i in favFood:\n del i[:1]\n \ncount = 0\n\nfor i in range(1, m):\n check = True\n for j in range(n):\n if not (str(i) in favFood[j]):\n check = False\n if check:\n count += 1\n\nprint(count)\n', 'a, b = map(int, input().split())\n\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s212604396', 's661762911', 's917728425']
[3060.0, 3060.0, 2940.0]
[17.0, 17.0, 18.0]
[379, 301, 88]
p03125
u866769581
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['N = int(input())\nA = list(map(int,input().split()))\nwhile len(A) > 1:\n a_ = A[0]\n for x in range(1,len(A)):\n A[x] %= a_\n A = [ans for ans in A if ans > 0]\n A.sort()\nprint(A[0])', 'N = int(input())\nA = list(map(int,input().split()))\nfor main_loop in range (0,N): \n A.sort()\n de = A.count(0)\n del A[:de]\n li = len(A)\n if A[0] == 1:\n break\n for x in range(1,li):\n A[x] = A[x]%A[0]\nprint(A[0])\n', 'A,B = map(int,input().split())\nif B%A == 0:\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s418618042', 's544698305', 's586614253']
[3060.0, 3060.0, 2940.0]
[18.0, 17.0, 18.0]
[195, 245, 79]
p03125
u867848444
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A,B=int(input())\nif B%A==0:\n print(A+B)\nelse:\n print(B-A)', 'a,b=input()\nif b%a==0:\n print(a+b)\nelse:\n\tprint(b-a)', '#-*-coding:utf-8-*-\n\nA,B=input()\nif B%A==0:\n print(A+B)\nelse:\n\tprint(B-A)', 'if B%A==0:\n print(A+B)\nelse:\n\tprint(B-A)', "a=int(input('A'))\nb=int(input('B'))\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)\n", 'n=int(input().split())\nif n[1]%n[0]==0:\n print(n[0]+n[1])\nelse:\n print(n[1]-n[0])', 'a,b=map(int,input().split())\nprint(a+b if b%a==0 else b-a)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s352228799', 's423345600', 's660809995', 's874468081', 's917531058', 's935123114', 's852060515']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 20.0, 17.0, 18.0, 17.0, 20.0, 17.0]
[63, 55, 76, 43, 81, 87, 58]
p03125
u868767877
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input())\nif B % A == 0:\n print(A + B)\nelse:\n print(A - B)', 'A, B = map(int, input().split(" "))\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)\n']
['Runtime Error', 'Accepted']
['s752596203', 's475380109']
[2940.0, 2940.0]
[17.0, 17.0]
[75, 87]
p03125
u882620594
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a = list(map(int,input().split()))\nA = a[0]\nB = a[1]\nif A % B == 0:\n print(str(A+B))\nelse:\n print(str(B-A))', 'a = list(map(int,input().split()))\nA = a[0]\nB = a[1]\nif B % A == 0:\n print(str(A+B))\nelse:\n print(str(B-A))']
['Wrong Answer', 'Accepted']
['s492415495', 's787684317']
[2940.0, 2940.0]
[18.0, 17.0]
[113, 113]
p03125
u883203948
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['\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', 'data = input().split()\na = int(data[0])\nb = int(data[1])\n\nif b%a == 0:\n print(a+b)\n else:\n print(b-a)', '\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', 'data = input().split()\na = int(data[0])\nb = int(data[1])\n\nif b%a == 0:\n print(a+b)\nelse:\n print(b-a)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s102803069', 's388910654', 's651454918', 's808665793']
[3064.0, 2940.0, 3064.0, 2940.0]
[19.0, 17.0, 18.0, 17.0]
[1055, 106, 1047, 103]
p03125
u883820415
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['n = int(input())\ntmp = input()\nan = []\nfor t in tmp.split():\n an.append(int(t))\n\nwhile True:\n \n \n min_tmp = 0\n for i in range(len(an)):\n if(an[i] < an[min_tmp] and an[i] > 0):\n min_tmp = i\n\n # i_min = an.index(min(an))\n i_min = min_tmp\n for i in range(len(an)):\n if i == i_min:\n continue\n an[i] = an[i] - int(an[i]/an[i_min]) * an[i_min]\n\n flag = True\n for i in range(len(an)):\n if(an[i] > 0 and not i == i_min):\n flag = False\n if flag:\n break\n\nprint(an[i_min])', 'a,b = [int(x) for x in input().split()]\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s419755714', 's326301384']
[3064.0, 2940.0]
[17.0, 17.0]
[651, 90]
p03125
u884323674
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input().split())\n\nif A % B == 0:\n print(A + B)\nelse:\n print(B - A)', 'A, B = map(int, input().split())\n\nif B % A == 0:\n print(A + B)\nelse:\n print(B - A)']
['Wrong Answer', 'Accepted']
['s221677108', 's433595988']
[2940.0, 2940.0]
[17.0, 17.0]
[88, 88]
p03125
u884982181
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['import numpy as np\nn,m = map(int,input().split())\nif b%a == 0:\n print(b+a)\nelse:\n print(b-a)', 'import numpy as np\na,b = map(int,input().split())\nif b%a == 0:\n print(b+a)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s694171751', 's103824070']
[12392.0, 12392.0]
[148.0, 148.0]
[98, 98]
p03125
u886902015
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\nif a%b==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b=map(int,input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s165620189', 's785477325']
[9136.0, 9100.0]
[29.0, 26.0]
[75, 75]
p03125
u887207211
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['def ans():\n a, b = map(int,input().split())\n if(a%b == 0):\n print(a+b)\n else:\n print(b-a)\nans()', 'a, b = map(int,input().split())\nif b%a == 0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s498679880', 's428207443']
[2940.0, 2940.0]
[18.0, 17.0]
[104, 76]
p03125
u897328029
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['from sys import stdin\n\na, b = stdin.readline().rstrip().split()\n\nfor i in range(1, 21):\n if a * i > b:\n break\n\n if b % (a * i) == 0:\n print(a + b)\n break\nelse:\n print(b - a)', 'for i in range(1, 21):\n if a * i > b:\n break\n\n if b % (a * i) == 0:\n print(a + b)\n break\nelse:\n print(b - a)', 'from sys import stdin\n\na, b = stdin.readline().rstrip().split()\na, b = int(a), int(b)\n\nfor i in range(1, 21):\n if a * i > b:\n print(b - a)\n break\n\n if b % (a * i) == 0:\n print(a + b)\n break\nelse:\n print(b - a)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s383902197', 's700539849', 's509620100']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[203, 138, 246]
p03125
u904943473
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['N = int(input())\nlst = list(map(int, input().split()))\nboolean = False\nupdated_lst = []\nminimum = min(lst)\nmin_num = 0\nfor i in lst:\n num = i % minimum\n if (i != minimum):\n updated_lst.append(num)\n else:\n updated_lst.append(minimum)\n min_num += 1\n if (num % 2 == 1):\n boolean = True\n\nif (min_num == len(lst)):\n print(minimum)\nelse:\n if (boolean):\n print(1)\n else:\n print(min(updated_lst))\n', 'A, B = map(int, input().split())\nif (B % A == 0):\n print(A + B)\nelse:\n print(B - A)']
['Runtime Error', 'Accepted']
['s627015077', 's853914670']
[3064.0, 2940.0]
[17.0, 17.0]
[414, 85]
p03125
u905582793
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = int(input())\nif b%a:\n print(b-a)\nelse:\n print(b+a)', 'a,b = map(int,input().split())\nif b%a:\n print(b-a)\nelse:\n print(b+a)']
['Runtime Error', 'Accepted']
['s659976840', 's747960693']
[2940.0, 3064.0]
[18.0, 17.0]
[58, 70]
p03125
u912318491
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A=int(input())\nB=int(input())\nif(A>0 and B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A B = map(int(),input().split())\nif(A>0 && B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A,B = map(int,input().split())\nif(A>0 && B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A=int(input())\nB=int(input())\nif(A>0 & B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A B = map(int(),input().split())\nif(B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A=int(input())\nB=int(input())\nif(A>0 && B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ', 'A,B=map(int,input().split())\nif(A>0 and B%A==0):\n print(B+A)\nelse:\n print(B-A)\n ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s043764290', 's162878655', 's490724172', 's567322471', 's639760251', 's871637383', 's970224487']
[2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 18.0]
[84, 86, 84, 82, 79, 83, 83]
p03125
u918123058
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\nif a%b==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b=map(int,input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s545914321', 's664388594']
[2940.0, 2940.0]
[17.0, 18.0]
[75, 75]
p03125
u921811474
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['from math import ceil\nN = int(input())\na = [int(input()) for i in range(5)]\ni = a.index(min(a))\nans = i-1 + ceil(N/min(a)) + 5 -i\nprint(ans)', 'A, B = map(int,input().split())\nif B%A==0:\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Accepted']
['s207722222', 's753127766']
[3060.0, 2940.0]
[18.0, 17.0]
[140, 78]
p03125
u924467864
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int, input().split())\n\nif a % b == 0:\n print(a + b)\nelse:\n print(a - b)\n', 'a, b = map(int, input().split())\n\nif b % a == 0:\n print(a + b)\nelse:\n print(b - a)\n']
['Wrong Answer', 'Accepted']
['s250562920', 's632588354']
[2940.0, 2940.0]
[17.0, 17.0]
[89, 89]
p03125
u924770834
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = input().split()\n\nif b % a == 0:\n\tprint(a+b)\nelse:\n\tprint(b-a)\n', 'a,b = input().split()\na = int(a)\nb = int(b)\n\nif b % a == 0:\n\tprint(a+b)\nelse:\n\tprint(b-a)\n']
['Runtime Error', 'Accepted']
['s369176809', 's990533096']
[2940.0, 2940.0]
[17.0, 17.0]
[68, 90]
p03125
u940279019
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A = int(input())\nB = int(input())\nif(B%A == 0):\n print(A+B)\nelse:\n print(B-A)', 'A, B = map(int,input().split())\nif(B%A == 0):\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Accepted']
['s448795199', 's773106534']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 77]
p03125
u941284420
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input().split())\nif B%A=0:\n print(A+B)\nelse:\n print(B-A)', 'A, B =map(int, input().split())\nif B%A=0:\n print(A+B)\nelse:\n print(B-A)', 'A, B = map(int, input().split())\nif B%A==0:\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s197756131', 's774252037', 's323531513']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[74, 77, 75]
p03125
u942767171
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int,input().split())\n\nif a%b==0 :\n print(a+b)\nelse :\n print(b-a)', 'a,b = map(int,input().split())\n\nif b%a==0 :\n print(a+b)\nelse :\n print(b-a)']
['Wrong Answer', 'Accepted']
['s514839686', 's517924127']
[2940.0, 2940.0]
[17.0, 17.0]
[78, 78]
p03125
u945228737
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['\n\n\ndef solve():\n \n num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]\n N, M = map(int, input().split())\n A = [int(i) for i in input().split()]\n A.sort(reverse=True)\n \n \n dp = [-1 * float("inf")] * (N + 1)\n\n \n dp[0] = 0\n for a in A:\n if num[a] <= N:\n dp[num[a]] = 1\n \n for n in range(1, N + 1):\n for a in A:\n if n - num[a] >= 0:\n \n \n \n dp[n] = max(dp[n], dp[n - num[a]] + 1)\n \n # print(dp)\n\n \n ans = \'\'\n for i in range(dp[N]): \n for a in A:\n \n \n \n \n \n \n \n if dp[N] - 1 == dp[N - num[a]]:\n ans += str(a)\n N -= num[a]\n break\n \n\n print(ans)\n\n\nif __name__ == \'__main__\':\n solve()\n', "\ndef solve():\n A, B = [int(i) for i in input().split()]\n result = 0\n if B % A == 0:\n result = B + A\n else:\n result = B - A\n print(result)\n\n\nif __name__ == '__main__':\n solve()\n"]
['Runtime Error', 'Accepted']
['s560825991', 's155877534']
[3188.0, 2940.0]
[20.0, 17.0]
[2065, 208]
p03125
u945761460
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int, input().split())\nif b/a==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b=map(int, input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)\n']
['Wrong Answer', 'Accepted']
['s826744386', 's058805172']
[9068.0, 9156.0]
[31.0, 27.0]
[72, 73]
p03125
u945945701
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(in(),input().split())\nif(b%2 == 0):\n print(a+b)\nelse:\n print(b-a)', 'a,b = map(int,input().split())\nif(b%a == 0):\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s396925937', 's465065192']
[2940.0, 3064.0]
[18.0, 18.0]
[77, 76]
p03125
u947327691
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b=map(int,input().split())\n\nif B%A==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b=map(int,input().split())\n\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)']
['Runtime Error', 'Accepted']
['s733410967', 's133105846']
[3064.0, 2940.0]
[18.0, 17.0]
[76, 76]
p03125
u959651981
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int,input().split())\nif a % b == 0:\n print(a+b)\nelse:\n print(b-a)', 'A,B= map(int,input().split())\nprint(A+B if B%A==0 else B-A)\n']
['Wrong Answer', 'Accepted']
['s797342103', 's138561030']
[2940.0, 2940.0]
[17.0, 17.0]
[81, 60]
p03125
u963084713
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['nums = input().spilt(" ")\nnum1 = int(nums[0])\nnum2 = int(nums[1])\nif num2 % num1 == 0:\n print(num1+num2)\nelse:\n print(num2-num1)', 'nums = input().spilt(" ")\nnum1 = int(nums[0])\nnum2 = int(nums[1])\nif num2 % num1 == 0:\n print(num1+num2)\nelse:\n print(num2-num1)', 'nums = input().split(" ")\nnum1 = int(nums[0])\nnum2 = int(nums[1])\nif num2 % num1 == 0:\n print(num1+num2)\nelse:\n print(num2-num1)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s651250001', 's659221087', 's756306391']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0]
[130, 134, 130]
p03125
u965033073
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = input()\nif b%a ==0:\n print(a+b)\n else:\n print(b-a)', 'a,b = input()\nif b%a ==0:\n print(a+b)\nelse:\n print(b-a)\n', 'x,y=map(int,input().split())\nif y%x ==0:\n print(x+y)\nelse:\n print(y-x)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s098906723', 's435979135', 's837893743']
[2940.0, 3060.0, 2940.0]
[17.0, 18.0, 17.0]
[62, 58, 72]
p03125
u965602776
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
["I = lambda: map(int, input().split())\nnums = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]\nminf = -10**9\nn, _ = I()\n*A, = sorted(I(), reverse = True)\ndigs = [0]*(n+1)\nfor i in range(1, n+1):\n d = []\n for a in A :\n before = i-nums[a]\n d.append(minf if before < 0 else digs[before]+1)\n digs[i] = max(d)\nans = []\nwhile n > 0:\n for a in A:\n if digs[n-nums[a]] == digs[n]-1:\n ans.append(a)\n n -= nums[a]\n break\nprint(*ans, sep = '')", "I = lambda: map(int, input().split())\nnums = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]\nminf = -float('inf')\nn, _ = I()\n*A, = sorted(I(), reverse = True)\ndigs = [0]*(n+1)\nfor i in range(1, n+1):\n d = []\n for a in A :\n before = i-nums[a]\n d.append(minf if before < 0 else digs[before]+1)\n digs[i] = max(d)\nans = []\nwhile n > 0:\n for a in A:\n if digs[n-nums[a]] == (digs[n]-1):\n ans.append(a)\n n -= nums[a]\n break\nprint(*ans, sep = '')", "I = lambda: map(int, input().split())\nnums = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]\nminf = -float('inf')\nn, _ = I()\n*A, = sorted(I(), reverse = True)\ndigs = [0]*(n+1)+[-1]*9\nfor i in range(1, n+1):\n d = []\n for a in A :\n before = i-nums[a]\n d.append(minf if before < 0 else digs[before]+1)\n digs[i] = max(d)\nans = []\nwhile n > 0:\n for a in A:\n if digs[n-nums[a]] == digs[n]-1:\n ans.append(a)\n n -= nums[a]\n break\nprint(*ans, sep = '')", 'a, b = map(int, input().split())\nprint((-1)**(b%a != 0)*a+b)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s329950438', 's778378957', 's781008713', 's972058230']
[3064.0, 3064.0, 3064.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[478, 487, 492, 60]
p03125
u966695411
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int, input())\nprint([b+a,b-a][b%a>0])', 'a, b = map(int, input().split())\nprint([b+a,b-a][b%a>0])']
['Runtime Error', 'Accepted']
['s173533676', 's624977842']
[2940.0, 2940.0]
[17.0, 18.0]
[48, 56]
p03125
u970197315
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int,input().split())\nprint(a+b if a%b == 0 else b-a)', 'a,b = map(int,input().split())\nprint(a+b if b%a == 0 else b-a)']
['Wrong Answer', 'Accepted']
['s780542012', 's107364025']
[2940.0, 2940.0]
[17.0, 17.0]
[62, 62]
p03125
u970348538
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = [int(i) for i in input().split(" ")]\nif(b//a == 0):\n print(a+b)\nelse:\n print(b-a)', 'a,b = [int(i) for i in input().split(" ")]\nif(b%a == 0):\n print(a+b)\nelse:\n print(b-a)\n']
['Wrong Answer', 'Accepted']
['s851487684', 's209598408']
[2940.0, 2940.0]
[17.0, 17.0]
[89, 89]
p03125
u972892985
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a, b = map(int,input().split())\nif a % b == 0:\n print(a+b)\nelse:\n print(a-b)', 'a, b = map(int,input().split())\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s376608125', 's021735099']
[3068.0, 2940.0]
[17.0, 17.0]
[78, 78]
p03125
u975884051
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['A, B = map(int, input().split())\n\nif A % B ==0:\n print(A + B)\nelse:\n print(B - A)\n', 'A, B = map(int, input().split())\n\nif B % A ==0:\n print(A + B)\nelse:\n print(B - A)\n']
['Wrong Answer', 'Accepted']
['s363481727', 's774997975']
[2940.0, 2940.0]
[17.0, 17.0]
[88, 88]
p03125
u978494963
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['a,b = map(int, input().split())\nif a%b==0:\n print(a+b)\nelse:\n print(b-a)', 'a,b = map(int, input().split())\nif b%a==0:\n print(a+b)\nelse:\n print(b-a)']
['Wrong Answer', 'Accepted']
['s595602087', 's681313147']
[3064.0, 2940.0]
[17.0, 17.0]
[74, 74]
p03125
u978769341
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
['import collections\nN = int(input())\nmli = sorted(list(map(int,input().split())), reverse = False)\nhp_min = mli[0]\nindex = 1\nfor i in range(1,N):\n if mli[index] % hp_min == 0:\n mli.pop(index)\n else:\n mli[index] = mli[index] % hp_min\n hp_min = mli[index]\n index += 1\n \n#if mli[i] % hp_min != 0:\n #hp_min = mli[i] % hp_min \nprint(hp_min)', 'A,B = map(int, input().split())\nif B % A == 0:\n print(A+B)\nelse:\n print(B-A)']
['Runtime Error', 'Accepted']
['s818861073', 's940244081']
[3316.0, 2940.0]
[21.0, 17.0]
[352, 78]
p03125
u986985627
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
["from sys import stdin, exit\n\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\na, b = mi()\nif a / b % 1 == 0:\n print(a+b)\nelse:\n print(b-a)", "from sys import stdin, exit\n\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\na, b = mi()\nif b / a % 1 == 0:\n print(a+b)\nelse:\n print(b-a)"]
['Wrong Answer', 'Accepted']
['s652880155', 's650877825']
[3060.0, 3060.0]
[17.0, 17.0]
[279, 279]
p03125
u993461026
2,000
1,048,576
You are given positive integers A and B. If A is a divisor of B, print A + B; otherwise, print B - A.
["import copy\n\nn, m = map(int, input().rstrip().split())\nnumber_list = list(map(int, input().rstrip().split()))\nnumber_list.sort()\nmatch = [2, 5, 5, 4, 5, 6, 3, 7, 6]\nnew_match = []\nanswer = []\n\nfor i in number_list:\n new_match.append(match[i-1])\n\n\nfor index in range(m):\n value = new_match[index]\n new_match_tmp = copy.copy(new_match)\n new_match_tmp.remove(value)\n maximum = max(new_match_tmp)\n \n quotient = int(n / value)\n remainder = n % value\n answer_tmp = [number_list[index]] * quotient\n \n if remainder != 0:\n while True:\n quotient -= 1\n remainder += value\n answer_tmp.pop(0)\n if remainder in new_match:\n answer_tmp.append(number_list[new_match.index(remainder)])\n break\n elif remainder > maximum:\n try:\n minimum = min(new_match_tmp)\n remainder -= minimum\n answer_tmp.append(number_list[new_match.index(minimum)])\n except:\n answer_tmp = []\n break\n if remainder == n:\n answer_tmp = []\n break\n\n if len(answer_tmp) != 0:\n answer.append(answer_tmp)\n\nanswer.sort(key=lambda x:len(x), reverse=True)\nans = reversed(answer[0])\n\nprint(*ans, sep='')\nprint()\n", 'a,b = map(int, input().rstrip().split())\n\nif b % a == 0:\n print(a+b)\nelse:\n print(b-a)\n']
['Runtime Error', 'Accepted']
['s085183930', 's700064127']
[3444.0, 2940.0]
[22.0, 18.0]
[1451, 89]
p03126
u000557170
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.
['# -*- coding: utf-8 -*-\n\ndef parse_input():\n\n \n nm = input().split(" ")\n n = int(nm[0])\n m = int(nm[1])\n\n rows = []\n for i in range(0, n):\n rows.append([int(e) for e in line.split(" ")])\n\n return (n, m, rows)\n\ndef solve(n, m, rows):\n\n result = []\n for k in range(1, m + 1):\n tmp = []\n for i in range(0, n):\n# print(rows[i])\n r = rows[i]\n# print(r[1:r[0] + 1])\n if k in r[1:r[0]+1]:\n tmp.append(i+1)\n if len(tmp) == n:\n result.append(k)\n\n return str(len(result))\n\ndef main():\n\n print(solve(parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n', '# -*- coding: utf-8 -*-\n\ndef parse_input():\n\n \n params = []\n nm = input().split(" ")\n n = int(nm[0])\n m = int(nm[1])\n params.append(n)\n params.append(m)\n\n for i in range(0, n):\n params.append(input()) \n\n rows = []\n for line in lines:\n rows.append([int(e) for e in line.split(" ")])\n\n return (n, m, rows)\n\ndef solve(n, m, rows):\n\n result = []\n for k in range(1, m + 1):\n tmp = []\n for i in range(0, n):\n# print(rows[i])\n r = rows[i]\n# print(r[1:r[0] + 1])\n if k in r[1:r[0]+1]:\n tmp.append(i+1)\n if len(tmp) == n:\n result.append(k)\n\n return str(len(result))\n\ndef main():\n\n print(solve(parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n', '# -*- coding: utf-8 -*-\n\ndef parse_input():\n\n \n nm = input().split(" ")\n n = int(nm[0])\n m = int(nm[1])\n\n rows = []\n for i in range(0, n):\n rows.append([int(e) for e in input().split(" ")])\n\n return (n, m, rows)\n\ndef solve(n, m, rows):\n\n result = []\n for k in range(1, m + 1):\n tmp = []\n for i in range(0, n):\n# print(rows[i])\n r = rows[i]\n# print(r[1:r[0] + 1])\n if k in r[1:r[0]+1]:\n tmp.append(i+1)\n if len(tmp) == n:\n result.append(k)\n\n return str(len(result))\n\ndef main():\n\n print(solve(parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n', '# -*- 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 m = int(nm[1])\n\n rows = []\n for i in range(1, n+1):\n rows.append([int(e) for e in lines[i].split(" ")])\n\n return (n, m, rows)\n\ndef solve(n, m, rows):\n\n result = []\n for k in range(1, m + 1):\n tmp = []\n for i in range(0, n):\n# print(rows[i])\n r = rows[i]\n# print(r[1:r[0] + 1])\n if k in r[1:r[0]+1]:\n tmp.append(i+1)\n if len(tmp) == n:\n result.append(k)\n\n return len(result)\n\ndef main():\n\n print("%d" % solve(*parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s147232163', 's295071520', 's823891982', 's703576049']
[3064.0, 3064.0, 3064.0, 3064.0]
[19.0, 19.0, 18.0, 19.0]
[683, 799, 686, 922]
p03126
u007991836
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 = 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,m = map(int,input().split())\nka = list(list(map(int,input().split())) for _ in range(n))\n\nlike = [0]*m\nfor i in range(n):\n for j in range(1,ka[i][0]+1):\n like[ka[i][j]-1] += 1\n\nanswer = 0\nfor i in range(m):\n if like[i] == n:\n answer += 1\n\nprint(answer)\n']
['Runtime Error', 'Accepted']
['s741132497', 's203435175']
[3064.0, 3060.0]
[20.0, 18.0]
[254, 275]
p03126
u013408661
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.
['number=list(map(int,input().split()))\nlikes=[]\nresult=0\nfor i in number[0]:\n for j in number[1]:\n rawdata=list(map(int,input().split()))\n for k in rawdata[0]:\n likes.append(rawdata[k+1])\nfor i in number[1]:\n if likes.count(i+1):\n result+=1\nprint(result)', 'number=list(map(int,input().split()))\nlikes=[]\nresult=0\nfor i in range(number[0]):\n rawdata=list(map(int,input().split()))\n for k in range(rawdata[0]):\n likes.append(rawdata[k+1])\nfor i in range(number[1]):\n if likes.count(i+1):\n result+=1\nprint(result)', 'number=list(map(int,input().split()))\nlikes=[]\nresult=0\nfor i in range(number[0]):\n for j in range(number[1]):\n rawdata=list(map(int,input().split()))\n for k in range(rawdata[0]):\n likes.append(rawdata[k+1])\nfor i in range(number[1]):\n if likes.count(i+1):\n result+=1\nprint(result)', 'number=list(map(int,input().split()))\nlikes=[]\nresult=0\nfor i in range(number[0]):\n rawdata=list(map(int,input().split()))\n for k in range(rawdata[0]):\n likes.append(rawdata[k+1])\nfor i in range(number[1]):\n if likes.count(i+1)==number[0]:\n result+=1\nprint(result)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s231356491', 's373945223', 's825742279', 's650738857']
[3060.0, 3060.0, 3064.0, 3060.0]
[17.0, 18.0, 19.0, 18.0]
[291, 276, 319, 288]
p03126
u016567570
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 = [list(map(int, input().split())) for i in N]\n\nx_set = set(A_list[0][1:])\nfor i in range(1, N):\n x_set = x_set | set(A_list[i][1:])\nprint(len(x_set))\n ', 'N, M = map(int, input().split())\nA_list = [list(map(int, input().split())) for i in range(N)]\n\nx_set = set(A_list[0][1:])\nfor i in range(1, N):\n x_set = x_set & set(A_list[i][1:])\nprint(len(x_set))\n ']
['Runtime Error', 'Accepted']
['s861455957', 's278300485']
[2940.0, 3060.0]
[17.0, 17.0]
[194, 201]
p03126
u025463382
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.
['man,food = map ( int ,input ().split())\nnum = set(range(food+1))\nfor i in range(man) :\n a = list ( map ( int () , input . split ()))\n del a[0]\n num = num & a\nplint (len (num) )\n', 'man,food = map ( int ,input().split())\nnum = set(range(food+1))\nfor i in range(man) :\n a = list ( map ( int , input().split ()))\n del a[0]\n a = set (a)\n num = num & a\nprint (len (num) )\n']
['Runtime Error', 'Accepted']
['s468768260', 's973616981']
[2940.0, 3060.0]
[17.0, 18.0]
[186, 199]
p03126
u033524082
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())\nl=[]\nfor i in range(n):\n a=len(l)\n l.append(map(str,input().split()))\n b=len(l)-a\n l.pop(-b)\ns=[]\ni=0\nwhile i<m:\n i+=1\n i=str(i)\n s.append(l.count(i))\n i=int(i)\nprint(s.count(m))', 'n,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a=list(map(str,input().split()))\n v=int(a[0])\n a.pop(0)\n for i in range(v):\n l.append(a[i])\ns=[]\ni=0\nwhile i<m:\n i+=1\n i=str(i)\n s.append(l.count(i))\n i=int(i)\nprint(s.count(n))']
['Wrong Answer', 'Accepted']
['s199603888', 's510792701']
[3064.0, 3064.0]
[17.0, 18.0]
[231, 262]
p03126
u034128150
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\nproduct = set(i for i in range(1, m+1))\nfor i in range(0, n):\n\tAs = set(input().split()[1:])\n\tproduct &= As\n\t\nprint(len(product))\n\t', 'n, m = map(int, input().split())\n\nproduct = set(i for i in range(1, m+1))\n\nfor i in range(0, n):\n\tAs = set(map(int, input().split()[1:]))\n\tproduct = product.intersection(As)\n\t\nprint(len(product))\n\t']
['Wrong Answer', 'Accepted']
['s048366875', 's022792136']
[2940.0, 2940.0]
[17.0, 17.0]
[165, 197]
p03126
u036340997
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())\na = list(map(int, input().split()))[1:]\nfor i in range(n - 1):\n foods = list(map(int, input().split()))[1:]\n for food in a:\n if not food in foods:\n a.remove(food)\nprint(len(a))', 'n, m = map(int, input().split())\nlikes = [0 for i in range(m + 1)]\n\nfor i in range(n):\n for food in list(map(int, input().split()))[1:]:\n likes[food] += 1\nprint(len(list(filter(lambda x: x==n, likes))))']
['Runtime Error', 'Accepted']
['s901040042', 's613854393']
[3060.0, 3060.0]
[17.0, 17.0]
[211, 206]
p03126
u037074041
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\n\n\ndef count_samples_of_like_same_food(samples_and_like_foods):\n all_samples_count = len(samples_and_like_foods)\n like_foods_num_dict = {}\n for like_foods in samples_and_like_foods:\n like_foods_set = tuple(set(like_foods))\n #print(like_foods_set)\n for like_food in like_foods_set:\n if like_food not in like_foods_num_dict:\n like_foods_num_dict[like_food] = 1\n else:\n like_foods_num_dict[like_food] += 1\n\n same_like_food_samples_count = 0\n for key, value in like_foods_num_dict.items():\n if value == all_samples_count:\n same_like_food_samples_count += 1\n return same_like_food_samples_count\n\n\ndef main():\n input_line_list = stdin.readlines()[1:]\n #print(input_line_list)\n samples_and_like_foods = [like_foods_string.split() for like_foods_string in input_line_list]\n #print(samples_and_like_foods)\n print(count_samples_of_like_same_food(samples_and_like_foods))\n\n\nif __name__ == '__main__':\n main()\n", "from sys import stdin\n\n\ndef count_samples_of_like_same_food(samples_and_like_foods):\n all_samples_count = len(samples_and_like_foods)\n like_foods_num_dict = {}\n for like_foods in samples_and_like_foods:\n for like_food in like_foods:\n if like_food not in like_foods_num_dict:\n like_foods_num_dict[like_food] = 0\n else:\n like_foods_num_dict[like_food] += 1\n\n same_like_food_samples_count = 0\n for key, value in like_foods_num_dict.items():\n if value == all_samples_count:\n same_like_food_samples_count += 1\n return same_like_food_samples_count\n\n\ndef main():\n input_line_list = stdin.readlines()\n samples_and_like_foods = [like_foods_string.split() for like_foods_string in input_line_list]\n print(samples_and_like_foods)\n print(count_samples_of_like_same_food(samples_and_like_foods))\n\n\nif __name__ == '__main__':\n main()\n", "from sys import stdin\n\n\ndef count_samples_of_like_same_food(n, m, samples_and_like_foods):\n #all_samples_count = len(samples_and_like_foods)\n like_foods_num_dict = {}\n for samples_like_foods in samples_and_like_foods:\n #like_foods_set = tuple(set(like_foods))\n sample = samples_like_foods[0]\n like_foods = samples_like_foods[1:]\n #print(like_foods_set)\n for like_food in like_foods:\n if like_food not in like_foods_num_dict:\n like_foods_num_dict[like_food] = 1\n else:\n like_foods_num_dict[like_food] += 1\n\n same_like_food_samples_count = 0\n for key, value in like_foods_num_dict.items():\n #print(value, n)\n if value == n:\n same_like_food_samples_count += 1\n else:\n \n pass\n\n #print(same_like_food_samples_count)\n return same_like_food_samples_count\n\n\ndef main():\n input_line_list = stdin.readlines()\n input_line_list = [y.rstrip() for y in input_line_list]\n n, m = [int(z) for z in input_line_list[0].split()]\n samples_and_like_foods = [x.split() for x in input_line_list[1:]]\n #print(n, m)\n #print(samples_and_like_foods)\n #print(input_line_list)\n #samples_and_like_foods = [like_foods_string.split() for like_foods_string in input_line_list]\n #print(samples_and_like_foods)\n print(count_samples_of_like_same_food(n, m, samples_and_like_foods))\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s104626930', 's972243898', 's068894903']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[1046, 930, 1483]
p03126
u038216098
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=[]*N\nfor i in ragne(N):\n A[i]=list(map(int,input().split()))', 'N,M=map(int,input().split())\nKA=[0]*N\ncount=[0]*(M+1)\nfor i in range(N):\n KA[i]=list(map(int,input().split()))\nfor i in range(N):\n for j in range(1,len(KA[i])):\n count[KA[i][j]]+=1\nans=0\nfor i in range(1,M+1):\n if count[i]==N :\n ans+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s368751020', 's588649964']
[9188.0, 9140.0]
[26.0, 28.0]
[92, 255]
p03126
u039860745
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())\nC = [0] * (M+1)\nfor i in range(N):\n K = list(map(int, input().split()))\n for k in range(len(k)):\n C[K[k]] += 1\ncount = 0\n\nfor c in C:\n if c == N:\n count += 1\n\nprint(count)', 'N,M = map(int,input().split())\nC = [0] * (M+1)\nfor i in range(N):\n K = list(map(int, input().split()))\n for k in range(len(K)):\n if k != 0:\n C[K[k]] += 1\ncount = 0\n\nfor c in C:\n if c == N:\n count += 1\n\nprint(count)']
['Runtime Error', 'Accepted']
['s079001762', 's139950784']
[9044.0, 9104.0]
[25.0, 29.0]
[225, 248]
p03126
u050698451
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\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\nl = []\nfor i in range(N):\n l.append(stdin.readline().rstrip().split())\nk = l[0]\nfor i in range(N):\n k = k&l[i]\nprint(len(k))', 'from sys import stdin\nN, M = [int(x) for x in stdin.readline().rstrip().split()]\nl = []\nm = []\nfor i in range(N):\n l.append(stdin.readline().rstrip().split())\n l[i].pop(0)\nk = l[N-1]\nfor i in range(N-1):\n k = set(k)&set(l[i])\nprint(len(k))']
['Runtime Error', 'Accepted']
['s386210170', 's941444472']
[3060.0, 3060.0]
[17.0, 17.0]
[211, 248]
p03126
u054825571
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())\nh={i for i in range(1,M+1)}\nfor _ in range(N):\n a=list(map(int,input().split()))\n a=set(a[1:])\n h-=a\nprint(len(a))', 'N,M=map(int,input().split())\nh={i for i in range(1,M+1)}\nfor _ in range(N):\n a=list(map(int,input().split()))\n a=set(a[1:])\n h&=a\nprint(len(h))']
['Wrong Answer', 'Accepted']
['s033619372', 's717937147']
[9164.0, 9168.0]
[30.0, 30.0]
[146, 146]
p03126
u058348416
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())\nfood = [0 for i in range(m+1)]\nfor i in range(n):\n a = input().split()\n for j in range(1,int(a[0])):\n food[int(a[j])] += 1\ncount = 0\nfor i in food:\n if i == n:\n count += 1\nprint(count)', 'n,m = map(int,input().split())\nfood = [0 for i in range(m+1)]\nfor i in range(n):\n a = input().split()\n for j in range(1,int(a[0])):\n food[int(a[j])] += 1\ncount = 0\nfor i in food:\n if i = n:\n count += 1\nprint(count)', 'n,m = map(int,input().split())\nfood = [0 for i in range(m+1)]\nfor i in range(n):\n a = input().split()\n for j in range(0,int(a[0])):\n food[int(a[j])] += 1\ncount = 0\nfor i in food:\n if i = n:\n count += 1\nprint(count)', 'n,m = map(int,input().split())\nfood = [0 for i in range(m)]\nfor i in range(n):\n k = int(input())\n for j in range(k):\n food[int(input())] = 1\nprint(food.index(0))', 'n,m = map(int,input().split())\nfood = [0 for i in range(m+1)]\nfor i in range(n):\n a = input().split()\n for j in range(1,int(a[0])+1):\n food[int(a[j])] += 1\ncount = 0\nfor i in food:\n if i == n:\n count += 1\nprint(count)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s082717960', 's743993383', 's813263068', 's836608157', 's089008048']
[3060.0, 2940.0, 3064.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[238, 237, 237, 174, 240]
p03126
u063073794
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())\nc = [0] * M\nfor i in range(N):\n a = [int(i) for i in input().split()]\n for j in a[1:]:\n c[j-1] += 1\n print(c)', 'yandy\nN, M = map(int, input().split())\nc = [0] * M\nfor i in range(N):\n a = [int(i) for i in input().split()]\n for j in a[1:]:\n c[j-1] += 1\n\nprint(c.count(N))\n\nn, m = map(int, input().split())\na = [list(map(int, input().split())) for i in range(n)]\nfor i in a:\n i.pop(0)\nfor i in range(n-1):\n a[i+1] = set(a[i]) & set(a[i+1])\nprint(len(a[n-1]))', 'N, M = map(int, input().split())\nc = [0] * M\nfor i in range(N):\n a = [int(i) for i in input().split()]\n\n for j in a[1:]:\n c[j-1] += 1\n \nprint(c.count(N))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s057561670', 's534166205', 's941167455']
[3060.0, 3064.0, 2940.0]
[21.0, 18.0, 17.0]
[162, 362, 166]
p03126
u068750695
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)]\ny=0\nif n!=1:\n for i in range(m):\n x=0\n for j in range(n):\n print(a[j][1:a[j][0]+1])\n if i+1 in a[j][1:a[j][0]+1]:\n x+=1\n print(x)\n else:\n x+=0\n print(x)\n if x==n:\n y+=1\n print(y)\nelse:\n for i in range(2,a[0][0]+1):\n if a[0][1]!=a[0][i]:\n y+=1\n print(y+1)', 'n,m=map(int,input().split())\na=[list(map(int,input().split())) for i in range(n)]\ny=0\nif n!=1:\n for i in range(m):\n x=0\n for j in range(n):\n if i+1 in a[j][1:a[j][0]+1]:\n x+=1\n else:\n x+=0\n if x==n:\n y+=1\n print(y)\nelse:\n for i in range(2,a[0][0]+1):\n if a[0][1]!=a[0][i]:\n y+=1\n print(y+1)']
['Wrong Answer', 'Accepted']
['s045640788', 's178118961']
[3316.0, 3064.0]
[22.0, 18.0]
[491, 404]
p03126
u069602573
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()) \nlist1 = [0] * n\n\nfor i in range(n):\n list1[i]=list(map(int, input().split())) \n list1[i].pop(0)\n\nans = 0\nprint(list1)\n\nfor i in range(m):\n check = 0\n for j in range(n):\n if not i+1 in list1[j]:\n check =1\n break\n \n if check == 0:\n ans += 1\n\n\nprint(ans)', 'n,m=map(int, input().split()) \nlist1 = [0] * n\n\nfor i in range(n):\n list1[i]=list(map(int, input().split())) \n list1[i].pop(0)\n\nans = 0\n\nfor i in range(m):\n check = 0\n for j in range(n):\n if not i+1 in list1[j]:\n check =1\n break\n \n if check == 0:\n ans += 1\n\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s835822521', 's022108785']
[3064.0, 3064.0]
[18.0, 18.0]
[385, 372]
p03126
u076764813
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=[]*n\na=[]*n\ns=set(range(1,M+1))\nfor i in range(n):\n tmp=list(map(int, input().split()))\n k[i]=tmp[0]\n a[i]=tmp[1:]\n s= s & set(a[i])\n\nprint(len(s))\n\n\n', 'n,m= map(int, input().split())\nk=[]*n\na=[]*n\ns=set(range(1,M+1))\nfor i in range(n):\n tmp=list(map(int, input().split()))\n k[i]=tmp[0]\n a[i]=tmp[0:]\n s= s & set(a[i])\n\nprint(len(s))\n\n\n', 'n,m= map(int, input().split())\nk=[]*n\na=[]*n\ns=set(range(1,M+1))\nfor i in range(n):\n tmp=list(map(int, input().split()))\n a=tmp[1:]\n s= s & set(a)\n\nprint(len(s))\n', 'n,m= map(int, input().split())\nk=[]*n\na=[]*n\ns=set(range(1,m+1))\nfor i in range(n):\n tmp=list(map(int, input().split()))\n a=tmp[1:]\n s= s & set(a)\n\nprint(len(s))\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s107916128', 's373199153', 's711606282', 's717005507']
[3064.0, 3060.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0, 17.0]
[195, 195, 171, 171]
p03126
u077291787
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.
['# ABC118B - Foods Loved by Everyone\nn, m = list(map(int, input().rstrip().split()))\nlst = [list(map(int, input().rstrip().split())) for _ in range(n)]\ndata = [0] * m\ncount = 0\nfor i in range(n):\n for j in range(m):\n if j in lst[i]:\n data[j] += 1\n\nfor k in range(m):\n if data[k] == n:\n count += 1\n \nprint(count)\n', '# ABC118B - Foods Loved by Everyone\nfrom collections import defaultdict\n\n\ndef main():\n N, M = map(int, input().split())\n cnt = defaultdict(int)\n for _ in range(N):\n _, *A = map(int, input().split())\n for a in A:\n cnt[a] += 1\n ans = sum(i == N for i in cnt.values())\n\n\nif __name__ == "__main__":\n main()', '# ABC118B - Foods Loved by Everyone\nfrom collections import defaultdict\n\n\ndef main():\n N, M = map(int, input().split())\n cnt = defaultdict(int)\n for _ in range(N):\n _, *A = map(int, input().split())\n for a in A:\n cnt[a] += 1\n ans = sum(i == M for i in cnt.values())\n print(ans)\n\n\nif __name__ == "__main__":\n main()', '# ABC118B - Foods Loved by Everyone\nfrom collections import defaultdict\n\n\ndef main():\n N, M = map(int, input().split())\n cnt = defaultdict(int)\n for _ in range(N):\n _, *A = map(int, input().split())\n for a in A:\n cnt[a] += 1\n ans = sum(i == N for i in cnt.values())\n print(ans)\n\n\nif __name__ == "__main__":\n main()']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s344323719', 's499988025', 's747344314', 's219567294']
[3064.0, 3316.0, 3316.0, 3316.0]
[18.0, 21.0, 21.0, 26.0]
[349, 342, 357, 357]
p03126
u094191970
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())\nall_dish = []\n\nfor n in range(N):\n K_n_list = list(map(int, input().split()))\n del K_n_list[0]\n all_dish = [K_n_list_num for K_n_list_num in K_n_list]\n\n# for K_n_list_num in K_n_list:\n\n\nprefer_dish = []\ndish_kind = list(set(all_dish))\n#prefer_dish = [dish_kind_num for dish_kind_num in dish_kind if all_dish.count(dish_kind_num) == N]\nfor dish_kind_num in dish_kind:\n if all_dish.count(dish_kind_num) == N:\n prefer_dish.append(dish_kind_num)\n\nprint(len(prefer_dish))', 'N, M = map(int, input().split())\nall_dish = []\n\nfor n in range(N):\n K_n_list = list(map(int, input().split()))\n del K_n_list[0]\n# all_dish = [K_n_list_num for K_n_list_num in K_n_list]\n\n for K_n_list_num in K_n_list:\n all_dish.append(K_n_list_num)\n\nprefer_dish = []\ndish_kind = list(set(all_dish))\nprefer_dish = [dish_kind_num for dish_kind_num in dish_kind if all_dish.count(dish_kind_num) == N]\n\n# if all_dish.count(dish_kind_num) == N:\n# prefer_dish.append(dish_kind_num)\n\nprint(len(prefer_dish))', 'N, M = map(int, input().split())\nall_dish = []\n\nfor n in range(N):\n K_n_list = list(map(int, input().split()))\n del K_n_list[0]\n all_dish = [K_n_list_num for K_n_list_num in K_n_list]\n\nprefer_dish = []\ndish_kind = list(set(all_dish))\nprefer_dish = [dish_kind_num for dish_kind_num in dish_kind if all_dish.count(dish_kind_num) == N]\n\nprint(len(prefer_dish))', 'N, M = map(int, input().split())\nall_dish = []\n\nfor n in range(N):\n K_n_list = list(map(int, input().split()))\n del K_n_list[0]\n all_dish = [K_n_list_num for K_n_list_num in K_n_list]\n\n# for K_n_list_num in K_n_list:\n\n\nprefer_dish = []\ndish_kind = list(set(all_dish))\nprefer_dish = [dish_kind_num for dish_kind_num in dish_kind if all_dish.count(dish_kind_num) == N]\n\nprint(len(prefer_dish))', 'ii=lambda:int(input())\nmiis=lambda:map(int,input().split())\nlmiis=lambda:list(map(int,input().split()))\n\nn,m=miis()\n\nk=lmiis()\nst=set(k[1:])\n\nfor i in range(n-1):\n ki=lmiis()\n st=st&set(ki[1:])\n\nprint(len(st))']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s022038510', 's652201300', 's672463599', 's981645773', 's665283887']
[3064.0, 3188.0, 3064.0, 3064.0, 3064.0]
[20.0, 19.0, 19.0, 18.0, 17.0]
[557, 558, 366, 441, 211]
p03126
u095756391
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.
['a = list(map(int, input().split()))\nlikefood = []\nresult = 0\n\nfor i in range(a[0]):\n b = list(map(int, input().split()))\n for k in range(b[0]):\n likefood.append(k)\n\nfor i in range(a[1]):\n if likefood.count(i) == a[0]:\n result += 1\n\nprint(result)', 'a = list(map(int, input().split()))\nlikefood = []\nresult = 0\n\nfor i in range(a[0]):\n b = list(map(int, input().split()))\n for k in range(b[0]):\n likefood.append(k+1)\n\nfor i in range(a[1]):\n if likefood.count(i+1) == a[0]:\n result += 1\n\nprint(result)', 'a = list(map(int, input().split()))\nlikefood = []\nresult = 0\n\nfor i in range(a[0]):\n b = list(map(int, input().split()))\n for k in range(b[0]):\n likefood.append(b[k+1])\n\nfor i in range(a[1]):\n if likefood.count(i+1) == a[0]:\n result += 1\n\nprint(result)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s481904282', 's504496075', 's369126525']
[3060.0, 3060.0, 3060.0]
[18.0, 19.0, 18.0]
[268, 272, 275]
p03126
u098026648
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())\nel = {}\nfor i in range(N):\n P = list(map(int, input().split())).pop(0)\n if i == 0: el = set(P)\n el = el & set(P)\nprint(len(el))', 'N,M = map(int, input().split())\nel = {}\nfor i in range(N):\n P = list(map(int, input().split()))\n K = P.pop(0)\n if i == 0: el = set(P)\n el = el & set(P)\nprint(len(el))']
['Runtime Error', 'Accepted']
['s603271092', 's296379144']
[3060.0, 3060.0]
[17.0, 17.0]
[168, 178]
p03126
u103902792
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())\nlikes = set([])\nfor i in range(n):\n like = list(input().split())\n like.pop(0)\n likes = likes & set(like)\nprint(len(likes))', 'n,m = map(int,input().split())\nlikes = set(list(input().split())[1:])\nfor i in range(n-1):\n like = list(input().split()[1:])\n likes = likes & set(like)\nprint(len(likes))']
['Wrong Answer', 'Accepted']
['s035769786', 's098125815']
[2940.0, 3060.0]
[18.0, 17.0]
[156, 171]
p03126
u107091170
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())\nm= [ 0 for in range(M)]\nfor i in range(N):\n A = list(map(int, input().split()))\n for j in range(A[0]):\n m[A[j+1]-1]+=1\nans=0\nfor i in range(M):\n if m[i] == N:\n ans += 1\nprint(ans)\n ', 'N,M=map(int,input().split())\nc= [ 0 for _ in range(M)]\nfor i in range(N):\n A = list(map(int, input().split()))\n for j in range(A[0]):\n c[A[j+1]-1]+=1\nans=0\nfor i in range(M):\n if c[i] == N:\n ans += 1\nprint(ans)\n ']
['Runtime Error', 'Accepted']
['s252508311', 's640986772']
[2940.0, 3060.0]
[17.0, 17.0]
[222, 224]