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
|
---|---|---|---|---|---|---|---|---|---|---|
p02574 | u597455618 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['from math import sqrt, gcd\nimport sys\n\n\ndef osk_a(M):\n p = [i for i in range(M+1)]\n for x in range(2, int(sqrt(M))+1):\n if p[x] == x:\n for y in range(2*x, M+1, x):\n if p[y] == y:\n p[y] = x\n return p\n\n\ndef g(a):\n g = 0\n for x in a:\n g = gcd(g, x)\n return g\n\n\ndef main():\n n = int(sys.stdin.buffer.readline())\n a = list(map(int, sys.stdin.buffer.readline().split()))\n if g(a) > 1:\n print("not coprime")\n exit()\n p = osk_a(10**6)\n chk = set()\n for x in a:\n tmp = set()\n while x > 1:\n x //= p[x]\n tmp.add(x)\n if chk.isdisjoint(tmp):\n chk |= tmp\n else:\n print("setwise coprime")\n exit()\n print("pairwise coprime")\n\n\nif __name__ == "__main__":\n main()\n', 'from math import sqrt, gcd\nimport sys\n\n\ndef osk_a(M):\n p = [i for i in range(M+1)]\n for x in range(2, int(sqrt(M))+1):\n if p[x] == x:\n for y in range(2*x, M+1, x):\n if p[y] == y:\n p[y] = x\n return p\n\n\ndef g(a):\n g = 0\n for x in a:\n g = gcd(g, x)\n return g\n\n\ndef main():\n n = int(sys.stdin.buffer.readline())\n a = list(map(int, sys.stdin.buffer.readline().split()))\n if g(a) > 1:\n print("not coprime")\n exit()\n p = osk_a(10**6)\n chk = set()\n for x in a:\n tmp = set()\n while x > 1:\n x //= p[x]\n tmp.add(x)\n print(chk.isdisjoint(tmp))\n if chk.isdisjoint(tmp):\n chk |= tmp\n else:\n print("setwise coprime")\n exit()\n print("pairwise coprime")\n\n\nif __name__ == "__main__":\n main()\n', 'from math import sqrt, gcd\nimport sys\n\n\ndef osk_a(M):\n p = [i for i in range(M+1)]\n for x in range(2, int(sqrt(M))+1):\n if p[x] == x:\n for y in range(2*x, M+1, x):\n if p[y] == y:\n p[y] = x\n return p\n\n\ndef g(a):\n g = 0\n for x in a:\n g = gcd(g, x)\n return g\n\n\ndef main():\n n = int(sys.stdin.buffer.readline())\n a = list(map(int, sys.stdin.buffer.readline().split()))\n if g(a) > 1:\n print("not coprime")\n exit()\n p = osk_a(10**6)\n chk = set()\n t = a[0]\n while t > 1:\n chk.add(p[t])\n t //= p[t]\n\n for x in a[1:]:\n tmp = set()\n while x > 1:\n tmp.add(p[x])\n x //= p[x]\n if chk.isdisjoint(tmp):\n print("setwise coprime")\n exit()\n else:\n chk |= tmp\n print("pairwise coprime")\n\n\nif __name__ == "__main__":\n main()\n', 'from math import sqrt, gcd\nimport sys\n\n\ndef osk_a(M):\n p = [i for i in range(M+1)]\n for x in range(2, int(sqrt(M))+1):\n if p[x] == x:\n for y in range(2*x, M+1, x):\n if p[y] == y:\n p[y] = x\n return p\n\n\ndef g(a):\n g = 0\n for x in a:\n g = gcd(g, x)\n return g\n\n\ndef main():\n n = int(sys.stdin.buffer.readline())\n a = list(map(int, sys.stdin.buffer.readline().split()))\n if g(a) > 1:\n print("not coprime")\n exit()\n p = osk_a(10**6)\n chk = set()\n for x in a:\n tmp = set()\n while x > 1:\n x //= p[x]\n tmp.add(x)\n if chk.isdisjoint(tmp):\n chk |= tmp\n else:\n print("setwise coprime")\n exit()\n print("pairwise coprime")\n\n\nif __name__ == "__main__":\n main()\n', 'from math import sqrt, gcd\nimport sys\n\n\ndef osk_a(M):\n p = [i for i in range(M+1)]\n for x in range(2, int(sqrt(M))+1):\n if p[x] == x:\n for y in range(2*x, M+1, x):\n if p[y] == y:\n p[y] = x\n return p\n\n\ndef main():\n n = int(sys.stdin.buffer.readline())\n a = list(map(int, sys.stdin.buffer.readline().split()))\n\n def g(a):\n g = 0\n for x in a:\n g = gcd(g, x)\n return g\n\n if g(a) > 1:\n print("not coprime")\n exit()\n p = osk_a(10**6)\n chk = set()\n while a[0] > 1:\n chk.add(p[a[0]])\n a[0] //= p[a[0]]\n for x in a[1:]:\n tmp = set()\n while x > 1:\n tmp.add(p[x])\n x //= p[x]\n if not chk.isdisjoint(tmp):\n print("setwise coprime")\n exit()\n chk |= tmp\n print("pairwise coprime")\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s254235316', 's483215612', 's867155305', 's971454845', 's680095308'] | [108360.0, 112980.0, 113196.0, 108184.0, 113116.0] | [523.0, 851.0, 478.0, 549.0, 550.0] | [844, 879, 923, 844, 927] |
p02574 | u628285938 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['\n@author: liang\n"""\n\n"""\nコーナーケース1:\n 重複があるとき\u3000not coprime(※これが誤り)\n ただし、1の重複は除く\n\nコーナーケース:\n 重複があるとき\u3000pairwise coprime ではない\n setwise coprimeの可能性はある\n ただし、1の重複は\n"""\nimport math\nC = 10**6\n#T = int(math.sqrt(C)*10**3)+1\nN = int(input())\njudge = [0]+[False]*C\nA =list()\nf = True\nfor a in input().split():\n if judge[int(a)] == True and int(a) != 1:\n f = False\n judge[int(a)]=True\n A.append(int(a))\nd = [False]+[True]*C\n\n#print(judge[:10])\ndef solve(f):\n flag = True\n \n for i in range(2,C+1):\n count = 0\n if d[i] == True:\n for j in range(i,C+1,i):\n if judge[j] == True:\n count += 1\n if count == 2:\n flag = False\n break\n d[j] = False\n if not flag:\n break\n \n if flag == True and f == True:\n return "pairwise coprime"\n ans = A[0]\n \n for i in range(N):\n ans = math.gcd(ans,A[i])\n #print("ans",a)\n if ans == 1:\n return "setwise coprime"\n return "not coprime"\n\nprint(solve(f))\n#print(len(A))', '# -*- coding: utf-8 -*-\n"""\nCreated on Fri Sep 18 00:26:07 2020\n\n@author: liang\n"""\n\n\nimport math\nC = 10**6\n#T = int(math.sqrt(C)*10**3)+1\nN = int(input())\njudge = [0]+[False]*C\nA =list()\nf = True\nfor a in input().split():\n if judge[int(a)] == True and int(a) != 1:\n f = False\n judge[int(a)]=True\n A.append(int(a))\nd = [False]+[True]*C\n\n#print(judge[:10])\ndef solve(f):\n flag = True\n \n for i in range(2,C+1):\n count = 0\n if d[i] == True:\n for j in range(i,C+1,i):\n if judge[j] == True:\n count += 1\n if count == 2:\n flag = False\n break\n d[j] = False\n if not flag:\n break\n \n if flag == True and f == True:\n return "pairwise coprime"\n ans = A[0]\n \n for i in range(N):\n ans = math.gcd(ans,A[i])\n #print("ans",a)\n if ans == 1:\n return "setwise coprime"\n return "not coprime"\n\nprint(solve(f))\n#print(len(A))'] | ['Runtime Error', 'Accepted'] | ['s764238595', 's085632328'] | [8860.0, 141912.0] | [28.0, 1388.0] | [1293, 1357] |
p02574 | u630554891 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["import itertools\nimport math\nn=int(input())\na=list(map(int, input().split()))\nans=0\nc=0\n\nfor v in itertools.combinations(a, 2):\n c+=1\n print(math.gcd(v[0],v[1]))\n if math.gcd(v[0],v[1]) == 1:\n ans += 1\n\nif c==ans:\n print('pairwise coprime')\n exit()\n\nm=min(a)\npf={}\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\nprint(pf)\n\ntmp = 0\nfor v in pf:\n for i in range(len(a)):\n tmp += a[i]%v\n if tmp==0:\n print('not coprime')\n exit()\n else:\n print('setwise coprime')\n exit()\n tmp=0", "import numpy as np\nn=int(input())\na=list(map(int, input().split()))\n\nif np.gcd.reduce(a) != 1:\n print('not coprime')\n exit()\n\nN=max(a)+1\nA=list(range(2,N))\np=list()\n\nwhile A[0]**2<=N:\n\ttmp=A[0]\n\tp.append(tmp)\n\tA=[e for e in A if e%tmp!=0]\nl=p+A\n\nprint(l)\nfor i in range(len(a)):\n count=0\n for j in range(len(l)):\n if a[i]%l[j]==0:\n count+=1\n if count > 1:\n print('setwise coprime')\n exit() \n #print(count) \n\nprint('pairwise coprime')", "import numpy as np\nn=int(input())\na=list(map(int, input().split()))\n\nif np.gcd.reduce(a) != 1:\n print('not coprime')\n exit()\n\nm=max(a)\ncnt=[0]*(m+1)\n\nfor i in range(len(a)):\n cnt[a[i]]+=1\n#print(cnt)\nfor i in range(2, m + 1):\n #print(cnt[i::i])\n if sum(cnt[i::i]) > 1:\n print('setwise coprime')\n exit()\n\nprint('pairwise coprime')\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s196087016', 's758417858', 's618501438'] | [126848.0, 150436.0, 145256.0] | [2348.0, 2208.0, 596.0] | [603, 507, 359] |
p02574 | u642085002 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["from math import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\n\nbuf = A[0]\nfor a in A[1:]:\n buf = gcd(buf, a)\nif buf == 1:\n print('setwise coprime')\n exit()\n\nnpcf = False\nfor i in range(N - 1):\n for j in range(i + 1, N):\n if gcd(A[i], A[j]) != 1:\n npcf = True\n break\n if npcf:\n break\n\nif not npcf:\n print('pairwise coprime')\nelse:\n print('not coprime')", "from math import gcd\n\nN = int(input())\nA = list(map(int, input().split()))\n\nprime = list(range(max(A) + 1))\n\nfor i in range(2, len(prime)):\n if prime[i] != i:\n continue\n for j in range(i, len(prime), i):\n if prime[j] != j:\n continue\n prime[j] = i\n\nused = set()\npc = True\nfor a in A:\n used_this = set()\n while a != 1:\n div = prime[a]\n if div in used:\n pc = False\n break\n used_this.add(div)\n a //= div\n used.update(used_this)\n\nif pc:\n print('pairwise coprime')\n exit()\n\nbuf = A[0]\nfor a in A[1:]:\n buf = gcd(buf, a)\nif buf == 1:\n print('setwise coprime')\nelse:\n print('not coprime')"] | ['Wrong Answer', 'Accepted'] | ['s034494095', 's286461116'] | [132712.0, 132808.0] | [366.0, 1386.0] | [421, 692] |
p02574 | u645487439 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = a_list[n - 1] + 100\nmemo = [0] * max\n\nfor a in a_list:\n print(a)\n print(memo)\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print("setwise coprime")\n exit()\n else:\n print("not coprime")\n exit()\n\nprint("pairwise coprime")\n', 'import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nprime_list = list(range(math.ceil(a_list[n - 1] ** 0.5) + 1))\n\nfor i in range(2, prime_list[-1] + 1):\n if prime_list[i] != -1:\n for j in range(i * 2, prime_list[-1] + 1, i)\n prime_list[index] = -1\nprime_list.sort()\ndel prime_list[0: prime_list.index(1) + 1]\ncheck_list = [0] * len(prime_list)\n\ndef is_pairwise(num):\n for i, prime in enumerate(prime_list):\n if num % prime == 0:\n if check_list[i] == 1:\n return False\n else:\n check_list[i] += 1\n return True\n\nfor a in a_list:\n if not is_pairwise(a):\n if reduce(math.gcd, a_list) == 1:\n print("setwise coprime")\n exit()\n else:\n print("not coprime")\n exit()\nprint("pairwise coprime")\n', 'import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = a_list[n - 1]\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print("setwise coprime")\n exit()\n else:\n print("not coprime")\n exit()\n\nprint("pairwise coprime")\n', 'import math\nfrom functools import reduce\n\nn = int(input())\na_list = list(map(int, input().split()))\nmax = 10 ** 6 + 1\nmemo = [0] * max\n\nfor a in a_list:\n memo[a] += 1\n\nfor i in range(2, max):\n if sum(memo[i::i]) > 1:\n if reduce(math.gcd, a_list) == 1:\n print("setwise coprime")\n exit()\n else:\n print("not coprime")\n exit()\n\nprint("pairwise coprime")\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s028770617', 's168548212', 's464665835', 's568048020'] | [182476.0, 9036.0, 127608.0, 127740.0] | [2357.0, 27.0, 242.0, 655.0] | [451, 877, 416, 414] |
p02574 | u667084803 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['N = int(input())\nA = list(map(int, input().split()))\n\n\n\nnumber_to_prime = [0] * (10**6 + 1)\n\n# preprocess\nfor i in range(2, 10**6+1):\n if not number_to_prime[i]:\n j = 1\n while j*i <= 10**6:\n number_to_prime[j*i] = i\n j += 1\n\ndef is_pair_copr(A):\n U = 1 << 20\n div_p = np.arange(U)\n for p in range(2, U):\n if div_p[p] != p:\n continue\n div_p[p::p] = p\n used = np.zeros(U, np.bool_)\n \n for x in A:\n while x > 1:\n p = div_p[x]\n while x % p == 0:\n x //= p\n if used[p]:\n return False\n used[p] = True\n return True\n\ndef is_pairwise():\n used_primes = set()\n pairwise_flag = 1\n for a in A:\n curr_primes = set()\n while a > 1:\n prime = number_to_prime[a]\n curr_primes.add(prime)\n a //= prime\n if used_primes & curr_primes:\n pairwise_flag = 0\n break\n else:\n used_primes = used_primes | curr_primes\n return pairwise_flag\n\ndef is_setwise(*A):\n import math\n from functools import reduce\n\n return reduce(math.gcd, A) == 1\n\nif is_pair_copr(A):\n print("pairwise coprime")\nelif is_setwise(*A):\n print("setwise coprime")\nelse:\n print("not coprime")', 'N = int(input())\nA = list(map(int, input().split()))\n\n\n\nnumber_to_prime = [0] * (10**6 + 1)\n\n# preprocess\nfor i in range(2, 10**6+1):\n if not number_to_prime[i]:\n j = 1\n while j*i <= 10**6:\n number_to_prime[j*i] = i\n j += 1\n\ndef is_pairwise():\n used_primes = [False] * (10**6 + 1)\n pairwise_flag = 1\n for a in A:\n curr_primes = set()\n while a > 1:\n prime = number_to_prime[a]\n while a % prime == 0:\n a //= prime\n if used_primes[prime]:\n return False\n used_primes[prime] = 1\n return True\n\ndef is_setwise(*A):\n import math\n from functools import reduce\n\n return reduce(math.gcd, A) == 1\n\nif is_pairwise():\n print("pairwise coprime")\nelif is_setwise(*A):\n print("setwise coprime")\nelse:\n print("not coprime")'] | ['Runtime Error', 'Accepted'] | ['s035479900', 's224727002'] | [127388.0, 134612.0] | [919.0, 940.0] | [1381, 929] |
p02574 | u699089116 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import functools\nfrom math import gcd\nN = int(input())\nA = list(map(int, input().split()))\nMAX = 10 * 6 + 10\n\nif functools.reduce(gcd, A) == 1:\n print("setwise coprime")\n exit()\n\nprime_list = [i for i in range(MAX + 1)]\np = 2\nwhile p * p <= MAX:\n if prime_list[p] == p:\n for q in range(2*p, MAX+1, p):\n if prime_list[q] == q:\n prime_list[q] = p\n p += 1\n\nprime = set()\nfor a in A:\n tmp = set()\n while a > 1:\n tmp.add(prime_list[a])\n a //= prime_list[a]\n for p in tmp:\n if p in prime:\n print("setwise coprime")\n exit()\n prime.add(p)\nelse:\n print("pairwise coprime")\n', 'import functools\nfrom math import gcd\nN = int(input())\nA = list(map(int, input().split()))\nMAX = 10 ** 6 + 10\n\nif functools.reduce(gcd, A) != 1:\n print("not coprime")\n exit()\n\nprime_list = [i for i in range(MAX + 1)]\np = 2\nwhile p * p <= MAX:\n if prime_list[p] == p:\n for q in range(2*p, MAX+1, p):\n if prime_list[q] == q:\n prime_list[q] = p\n p += 1\n\nprime = set()\nfor a in A:\n tmp = set()\n while a > 1:\n tmp.add(prime_list[a])\n a //= prime_list[a]\n for p in tmp:\n if p in prime:\n print("setwise coprime")\n exit()\n prime.add(p)\nelse:\n print("pairwise coprime")\n'] | ['Runtime Error', 'Accepted'] | ['s713294795', 's377895550'] | [127668.0, 127632.0] | [288.0, 668.0] | [671, 668] |
p02574 | u707808519 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["import math\n\ndef eratosthenes():\n erat = [0 for _ in range(max(a)+1)]\n lim = int(math.sqrt(max(set_a)))\n for i in range(2, lim+1):\n cnt = 0\n if not erat[i]:\n for res in range(i, max(set_a)+1, i):\n if res in set_a:\n cnt += 1\n erat[i] = i\n if cnt > 2:\n break\n else:\n continue\n break\n return cnt\n\n\nn = int(input())\na = [int(x) for x in input().split()]\nset_a = set(a)\n\nans = eratosthenes()\n\nif max(ans.values()) == 1 and len(set_a) == n:\n print('pairwise coprime')\nelse:\n res = a[0]\n for i in range(n):\n res = math.gcd(res, a[i])\n if res == 1:\n print('setwise coprime')\n else:\n print('not coprime')", "import math\n\ndef eratosthenes():\n erat = [0 for _ in range(max_a+1)]\n lim = int(math.sqrt(max_a))\n pair = True\n for i in range(2, lim+1):\n cnt = 0\n if not erat[i]:\n for res in range(i, max_a+1, i):\n if res in set_a:\n cnt += 1\n erat[res] = i\n if cnt > 1:\n pair = False\n break\n if not pair:\n break\n return pair\n\n\nn = int(input())\na = [int(x) for x in input().split()]\nmax_a = max(a)\nset_a = set(a)\n\nif eratosthenes() and len(set_a) == n - (a.count(1)-1):\n print('pairwise coprime')\nelse:\n res = a[0]\n for i in range(n):\n res = math.gcd(res, a[i])\n if res == 1:\n print('setwise coprime')\n else:\n print('not coprime')", "import math\n\ndef eratosthenes():\n erat = [0 for _ in range(max_a+1)]\n \n pair = True\n \n for i in range(2, max_a+1):\n cnt = 0\n if not erat[i]:\n for res in range(i, max_a+1, i):\n if res in set_a:\n cnt += 1\n erat[res] = i\n if cnt > 1:\n pair = False\n break\n if not pair:\n break\n return pair\n\n\nn = int(input())\na = [int(x) for x in input().split()]\nmax_a = max(a)\nset_a = set(a)\n\nif eratosthenes() and len(set_a) == n - max(0, a.count(1)-1):\n print('pairwise coprime')\nelse:\n res = a[0]\n for i in range(n):\n res = math.gcd(res, a[i])\n if res == 1:\n print('setwise coprime')\n else:\n print('not coprime')\n"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s208137815', 's279248112', 's968386803'] | [134556.0, 133216.0, 133268.0] | [642.0, 707.0, 869.0] | [776, 809, 850] |
p02574 | u726285999 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import sys\nimport math\n\n\nN_MAX = 200000 + 5\nINF = 10**9 + 7\nsys.setrecursionlimit(N_MAX)\nMOD = 10**9 + 7\n\n\ndef eatosthenes(N):\n prime = []\n D = [1] * (N + 1)\n\n for i in range(2, N + 1):\n if D[i] != 1:\n continue\n for j in range(N // i + 1):\n if D[i * j] == 1:\n D[i * j] = i\n prime.append(i)\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n A = [int(x) for x in sys.stdin.readline().rstrip().split()]\n\n maxA = max(A)\n primelist = eatosthenes(maxA)\n\n \n C = [0] * (maxA + 1)\n for a in A:\n C[a] += 1\n\n pc = True\n\n \n for p in primelist:\n cnt = 0\n for k in range(maxA // p + 1):\n cnt += C[k * p]\n\n \n if cnt > 1:\n pc = False\n\n if pc:\n print("pairwise coprime")\n return\n\n GCD = A[0]\n for i in range(1, N):\n GCD = math.gcd(GCD, A[i])\n\n if GCD == 1:\n print("setwise coprime")\n return\n\n print("not coprime")\n\n\nmain()\n', 'import sys\nimport math\n\n\nN_MAX = 200000 + 5\nINF = 10**9 + 7\nsys.setrecursionlimit(N_MAX)\nMOD = 10**9 + 7\n\n\ndef eatosthenes(N):\n prime = []\n D = [1] * (N + 1)\n\n for i in range(2, N + 1):\n if D[i] != 1:\n continue\n for j in range(N // i + 1):\n if D[i * j] == 1:\n D[i * j] = i\n prime.append(i)\n\n return prime\n\n\ndef main():\n N = int(sys.stdin.readline().rstrip())\n A = [int(x) for x in sys.stdin.readline().rstrip().split()]\n\n maxA = max(A)\n primelist = eatosthenes(maxA)\n\n \n C = [0] * (maxA + 1)\n for a in A:\n C[a] += 1\n\n pc = True\n\n \n for p in primelist:\n cnt = 0\n for k in range(maxA // p + 1):\n cnt += C[k * p]\n\n \n if cnt > 1:\n pc = False\n\n if pc:\n print("pairwise coprime")\n return\n\n GCD = A[0]\n for i in range(1, N):\n GCD = math.gcd(GCD, A[i])\n\n if GCD == 1:\n print("setwise coprime")\n return\n\n print("not coprime")\n\n\nmain()\n'] | ['Runtime Error', 'Accepted'] | ['s970371004', 's088263269'] | [133332.0, 133072.0] | [770.0, 1081.0] | [1200, 1219] |
p02574 | u729133443 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['n=int(input())\n1/(n>3)', 'n=int(input())\n1/(n>2)', "c=[m:=0]*6**8\nn,a=open(0)\nfor a in a.split():c[int(a)]+=1\nprint(('not','psaeitr'[any((m:=max(m,sum(c[i::i])))>1for i in range(2,6**8))::2]+'wise')[m<int(n)],'coprime')\n\nprint(('not','psaeitr'[any(c:=[max(0,sum(c[i::i])-1)for i in range(2,6**8)])::2]+'wise')[max(c)+1<int(n)],'coprime')\n\n1/(max(c)+1==m)", 'n=int(input())\n1/(n>1)', "c=[0]*6**8\nfor a in[*open(0)][1].split():c[int(a)]+=1\nm=max(sum(c[i::i])for i in range(2,6**8))\nprint(m<sum(c)and'psaeitr'[m>1::2]+'wise'or'not','coprime')"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s031154072', 's175465840', 's660384833', 's698926957', 's554670216'] | [9088.0, 9096.0, 101508.0, 9048.0, 101656.0] | [25.0, 28.0, 2135.0, 28.0, 1216.0] | [22, 22, 302, 22, 155] |
p02574 | u741579801 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['def gcd(x, y):\n if x < y:\n x, y = y, x\n while x % y != 0:\n x, y = y, x % y\n return y\n\n\ndef gcd3(ll):\n ans = ll[0]\n for i in range(1, len(ll)):\n ans = gcd(ans, ll[i])\n return ans\n\n\nD = {}\ndef prime_div(n, A):\n if len(D) == 0:\n for a in range(2, A + 1, 2):\n D[a] = 2\n for a in range(3, A + 1):\n if a in D:\n continue\n now = a\n while now <= A:\n if now not in D:\n D[now] = a\n now += a * 2\n result = []\n while n > 1:\n result.append(D[n])\n n = n // D[n]\n return result\n \n\ndef checkPairwise(ll):\n dic = {}\n for n in ll:\n primes = prime_div(n, 1000000)\n for p in primes:\n if p not in dic:\n dic[p] = 1\n else:\n return False\n return True\n\n\ndef main():\n N = int(input())\n A = [int(n) for n in input().split(" ")]\n a1 = checkPairwise(A)\n if a1:\n print("pairwise coprime")\n else:\n a2 = gcd3(A)\n if a2 == 1:\n print("setwise coprime")\n else:\n print("not coprime")\n\n\nif __name__ == "__main__":\n main()', 'def gcd(x, y):\n if x < y:\n x, y = y, x\n while x % y != 0:\n x, y = y, x % y\n return y\n\n\ndef gcd3(ll):\n ans = ll[0]\n for i in range(1, len(ll)):\n ans = gcd(ans, ll[i])\n return ans\n\n\nD = {}\ndef prime_div(n, A):\n if len(D) == 0:\n for a in range(2, A + 1, 2):\n D[a] = 2\n for a in range(3, A + 1):\n if a in D:\n continue\n now = a\n while now <= A:\n if now not in D:\n D[now] = a\n now += a * 2\n result = []\n while n > 1:\n result.append(D[n])\n n = n // D[n]\n return result\n \n\ndef checkPairwise(ll):\n dic = {}\n for n in ll:\n primes = list(set(prime_div(n, 1000000)))\n \n for p in primes:\n if p not in dic:\n dic[p] = 1\n else:\n return False\n return True\n\n\ndef main():\n N = int(input())\n A = [int(n) for n in input().split(" ")]\n a1 = checkPairwise(A)\n if a1:\n print("pairwise coprime")\n else:\n a2 = gcd3(A)\n if a2 == 1:\n print("setwise coprime")\n else:\n print("not coprime")\n\n\nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s555196497', 's336807762'] | [147568.0, 147804.0] | [836.0, 948.0] | [1216, 1254] |
p02574 | u758815106 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import math\nN = int(input())\nA = list(map(int, input().split()))\n\nmaxA = max(A) + 1\n\nC = [0] * maxA\n\ng = 0\n\nfor a in A:\n C[a] += 1\n g = math.gcd(g, a)\n\npairwise = True\n\nfor i in range(2, maxA):\n cnt = 0\n for j in range(i, maxA, i):\n cnt += C[j]\n\n if cnt > 1:\n pairwise = False\n\nif pairwise:\n print("pairwise comrime")\n exit()\n\nif g == 1:\n print("setwise coprime")\n\nelse:\n print("not coprime")', 'import math\nN = int(input())\nA = list(map(int, input().split()))\n\nmaxA = max(A) + 1\n\nC = [0] * maxA\n\ng = 0\n\nfor a in A:\n C[a] += 1\n g = math.gcd(g, a)\n\npairwise = True\n\nis_prime = [True] * maxA\n\nfor i in range(2, maxA):\n if is_prime[i]:\n cnt = 0\n for j in range(i, maxA, i):\n cnt += C[j]\n is_prime[j] = False\n\n if cnt > 1:\n pairwise = False\n\nif pairwise:\n print("pairwise coprime")\n exit()\n\nif g == 1:\n print("setwise coprime")\n\nelse:\n print("not coprime")'] | ['Wrong Answer', 'Accepted'] | ['s729142034', 's734280020'] | [132788.0, 132592.0] | [2207.0, 1054.0] | [433, 531] |
p02574 | u763550415 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["import numpy as np\nfrom math import gcd\nfrom functools import reduce\n\nPC = True\nSC = True\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse = True)\n\np = reduce(gcd, A)\nif p != 1:\n for i in range(N):\n for j in range(N-1, i, -1):\n if A[i] < np.sqrt(A[j]):\n break\n if gcd(A[i],A[j]) != 1:\n PC = False\n break\nelse:\n PC = False\n SC = False\n \nif PC == True:\n print('pairwise coprime')\nelse:\n if SC == True:\n print('setwise coprime')\n else:\n print('not coprime')", "from math import gcd\nfrom functools import reduce\nimport numpy as np\n\nPC = True\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse = True)\n\nMAX = A[0]+1\nmp = [0]*MAX\n\nfor i in A:\n mp[i] += 1\nprint(mp)\nfor i in range(2,int(np.sqrt(MAX))+1):\n if sum(mp[i::i])>1:\n PC = False\n break\n\nif PC:\n print('pairwise coprime')\nelse:\n if reduce(gcd, A) == 1:\n print('setwise coprime')\n else:\n print('not coprime')", "import numpy as np\n\ndef calc_gcd(a,b):\n r = a % b\n while r != 0:\n a, b = b, r\n r = a % b\n return b\n\nPC = True\nAC = True\nglst = []\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse = True)\n\nfor i in range(N):\n for j in range(N-1, i, -1):\n if A[i] < np.sqrt(A[j]):\n break\n gcd = calc_gcd(A[i],A[j])\n glst.append(gcd)\n if gcd != 1:\n PC = False\n if glst.count(gcd) != 1:\n AC = False\n break\n \nif PC == True:\n print('pairwaise coprime')\nelse:\n if AC == True:\n print('setwise coprime')\n else:\n print('not coprime')", "from math import gcd\nfrom functools import reduce\nimport numpy as np\n\nPC = True\n\nN = int(input())\nA = list(map(int, input().split()))\nA.sort(reverse = True)\n\nMAX = A[0]+1\nmp = [0]*MAX\n\nfor i in A:\n mp[i] += 1\n\nfor i in range(2,MAX):\n if sum(mp[i::i])>1:\n PC = False\n break\n\nif PC:\n print('pairwise coprime')\nelse:\n if reduce(gcd, A) == 1:\n print('setwise coprime')\n else:\n print('not coprime')"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s213454884', 's215451841', 's932078858', 's114748501'] | [150444.0, 150576.0, 150392.0, 150572.0] | [2208.0, 976.0, 2208.0, 929.0] | [525, 435, 591, 410] |
p02574 | u810356688 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import sys\ndef input(): return sys.stdin.readline().rstrip()\nclass Sieve: \n def __init__(self,n): \n self.primes=[]\n self.f=[0]*(n+1) \n self.f[0]=self.f[1]=-1\n self.f_lis = [0]*(n+1)\n self.max_f_lis = 0\n for i in range(2,n+1): \n if self.f[i]: continue\n self.primes.append(i)\n self.f[i]=i\n for j in range(i*i,n+1,i):\n if not self.f[j]:\n self.f[j]=i \n def prime_fact(self,A): \n for x in A:\n while x!=1:\n p=self.f[x]\n x//=p\n if x % p > 0:\n self.f_lis[p] += 1\n self.max_f_lis = max(self.max_f_lis, self.f_lis[p])\n\nimport math\nfrom functools import reduce\ndef gcd_all(*numbers):#gcd(*A)\n return reduce(math.gcd, numbers)\n\ndef main():\n n = int(input())\n A = list(map(int,input().split())) \n if gcd_all(A) == 1:\n print("pairwise coprime")\n else:\n Sieve_a = Sieve(max(A)+1)\n Sieve_a.prime_fact(A)\n lis = Sieve_a.f_lis\n max_lis = Sieve_a.max_f_lis\n if max_lis == n:\n print("not coprime")\n else:\n print("setwise coprime")\n\nif __name__==\'__main__\':\n main()', 'import sys\ndef input(): return sys.stdin.readline().rstrip()\nclass Sieve: \n def __init__(self,n): \n self.primes=[]\n self.f=[0]*(n+1) \n self.f[0]=self.f[1]=-1\n self.f_lis = [0]*(n+1)\n for i in range(2,n+1): \n if self.f[i]: continue\n self.primes.append(i)\n self.f[i]=i\n for j in range(i*i,n+1,i):\n if not self.f[j]:\n self.f[j]=i \n def prime_fact(self,A): \n for x in A:\n while x!=1:\n p=self.f[x]\n x//=p\n if x % p > 0:\n if self.f_lis[p] > 0: return False\n self.f_lis[p] += 1\n return True\n\nimport math\nfrom functools import reduce\ndef gcd_all(numbers):#gcd(A)\n return reduce(math.gcd, numbers)\n\ndef main():\n n = int(input())\n A = list(map(int,input().split())) \n Sieve_a = Sieve(max(A)+1)\n if Sieve_a.prime_fact(A):\n print("pairwise coprime")\n elif gcd_all(A) == 1:\n \n print("setwise coprime") \n else:\n print("not coprime")\n\nif __name__==\'__main__\':\n main()'] | ['Wrong Answer', 'Accepted'] | ['s732333992', 's793124656'] | [127312.0, 127188.0] | [2208.0, 552.0] | [1485, 1358] |
p02574 | u814271993 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["n=int(input()) \nc=list(map(int, input().split()))\nans = 1\n\nimport math\nfrom functools import reduce\nimport fractions\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nfor i in range(n-1):\n f=fractions.gcd(c[i],c[i+1])\n ans = max(ans,f)\n\nAns = gcd_list(c)\n\nif ans == 1 and Ans == 1:\n print('pairwise coprime')\nif ans != 1 and Ans == 1:\n print('setwise coprime')\nelse:\n print('not coprime')", "n=int(input()) \nc=list(map(int, input().split()))\nans = 1\n \nimport math\nfrom functools import reduce\nimport fractions\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n \nfor i in range(1,n-1):\n f=fractions.gcd(c[i],c[i+1])\n t = fractions.gcd(c[i-1],c[i+1])\n ans = max(ans,max(f,t))\n \nAns = gcd_list(c)\n \nif ans == 1:\n print('pairwise coprime')\nif ans > Ans and Ans == 1:\n print('setwise coprime')\nif Ans > 1:\n print('not coprime')", "n=int(input()) \nc=list(map(int, input().split()))\nans = 1\n \nimport math\nfrom functools import reduce\nimport fractions\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n \nfor i in range(n-1):\n f=fractions.gcd(c[i],c[i+1])\n ans = max(ans,f)\n \nAns = gcd_list(c)\n \nif ans == 1:\n print('pairwise coprime')\nif ans > Ans and Ans == 1:\n print('setwise coprime')\nif Ans > 1:\n print('not coprime')", "n=int(input()) \nc=list(map(int, input().split()))\nans = 1\n\nimport math\nfrom functools import reduce\nimport fractions\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nfor i in range(n-1):\n f=fractions.gcd(c[i],c[i+1])\n ans = max(ans,f)\n\nAns = gcd_list(c)\n\nif ans == 1:\n print('pairwise coprime')\nif ans > 1 and Ans == 1:\n print('setwise coprime')\nif ans > 1 and Ans > 1:\n print('not coprime')", "from math import gcd\nfrom functools import reduce\n \n \ndef facs(n):\n yield 2\n for x in range(3, n, 2):\n yield x\n \n \ndef main():\n input() # N\n array = [int(x) for x in input().split()]\n MAX_A = 10 ** 6 + 1\n histogram = [0] * MAX_A\n for x in array:\n histogram[int(x)] += 1\n \n for divider in facs(MAX_A):\n count = sum(histogram[divider::divider])\n if count > 1:\n break\n else:\n return 'pairwise coprime'\n \n gcd_total = reduce(gcd, array)\n if gcd_total == 1:\n return 'setwise coprime'\n else:\n return 'not coprime'\n \n \nif __name__ == '__main__':\n print(main())"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s399036644', 's551724200', 's651880498', 's677534960', 's319045652'] | [127456.0, 127476.0, 127416.0, 127260.0, 133172.0] | [1585.0, 2207.0, 1625.0, 1599.0, 479.0] | [414, 458, 412, 418, 653] |
p02574 | u814986259 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['def main():\n import sys\n input = sys.stdin.buffer.readline\n from math import gcd\n N = int(input())\n A = list(map(int, input().split()))\n g = A[0]\n\n S = 1\n for x in A:\n S *= x\n\n def factorization(n):\n ret = set()\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n ret.add(i)\n\n if temp != 1:\n ret.add(temp)\n\n if len(ret) == 0 and n != 1:\n ret.add(n)\n\n return ret\n\n flag = False\n for i, x in enumerate(A[::-1]):\n g = gcd(g, x)\n S //= x\n if flag and gcd(x, S) > 1:\n flag = False\n\n if flag:\n print("pairwise coprime")\n elif g == 1:\n print("setwise coprime")\n\n else:\n print("not coprime")\n\n\nmain()\n', 'def main():\n import sys\n input = sys.stdin.buffer.readline\n from math import gcd\n N = int(input())\n A = list(map(int, input().split()))\n g = A[0]\n M = max(A)\n X = [i for i in range(M+1)]\n S = [True for i in range(M+1)]\n S[0] = False\n S[1] = False\n\n for i in range(1, M+1):\n if S[i]:\n for j in range(i, M+1, i):\n if S[j]:\n S[j] = False\n X[j] = i\n flag = True\n s = set()\n ls = 0\n for x in A:\n tmp = set()\n while(X[x] != 1):\n tmp.add(X[x])\n x //= X[x]\n l = len(tmp)\n s |= tmp\n if len(s) == ls + l:\n ls += l\n continue\n else:\n flag = False\n break\n\n if flag:\n print("pairwise coprime")\n else:\n for x in A[1:]:\n g = gcd(g, x)\n if g == 1:\n print("setwise coprime")\n\n else:\n print("not coprime")\n\n\nmain()\n'] | ['Wrong Answer', 'Accepted'] | ['s138837380', 's407722812'] | [113008.0, 110824.0] | [2208.0, 703.0] | [926, 990] |
p02574 | u817693991 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['from math import gcd\nimport numpy as np\n\ndef setwise_coprime_check_fun(A_list, N):\n gcd_all = A_list[0]\n for i in range(N - 1):\n gcd_all = gcd(gcd_all, A_list[i + 1])\n if gcd_all == 1:\n break\n return gcd_all\n\ndef preprocess_fun(A_max):\n p_flg = [True] * (A_max + 1)\n D = [0] * (A_max + 1)\n p_flg[0] = False\n p_flg[1] = False\n for i in range(2, A_max + 1, 1):\n if p_flg[i]:\n for j in range(i, A_max + 1, i):\n p_flg[j] = False\n D[j] = i\n return D\n\ndef pairwise_coprime_check(A_list, D):\n p_count = [0] * (max(A_list) + 1)\n for A in A_list:\n temp = A\n d = 0\n while temp != 1:\n if p_count[D[temp]] == 1 and d != D[temp]:\n return 0\n p_count[D[temp]] = 1\n d = D[temp]\n temp = temp // D[temp]\n return 1\n\n\nA_max = max(A_list)\n\n\nif(setwise_coprime_check_fun(A_list, N) != 1):\n print("not coprime")\nelse:\n D = preprocess_fun(A_max)\n if pairwise_coprime_check(A_list, D) == 1:\n print("pairwise coprime")\n else:\n print("setwise coprime")', 'from math import gcd\nimport numpy as np\n\ndef setwise_coprime_check_fun(A_list, N):\n gcd_all = A_list[0]\n for i in range(N - 1):\n gcd_all = gcd(gcd_all, A_list[i + 1])\n if gcd_all == 1:\n break\n return gcd_all\n\ndef preprocess_fun(A_max):\n p_flg = [True] * (A_max + 1)\n D = [0] * (A_max + 1)\n p_flg[0] = False\n p_flg[1] = False\n for i in range(2, A_max + 1, 1):\n if p_flg[i]:\n for j in range(i, A_max + 1, i):\n p_flg[j] = False\n D[j] = i\n return D\n\ndef pairwise_coprime_check(A_list, D):\n p_count = [0] * (max(A_list) + 1)\n for A in A_list:\n temp = A\n d = 0\n while temp != 1:\n if p_count[D[temp]] == 1 and d != D[temp]:\n return 0\n elif d != D[temp]:\n p_count[D[temp]] = 1\n d = D[temp]\n temp = temp // D[temp]\n return 1\n\n\n\nA_max = max(A_list)\n\n\nif(setwise_coprime_check_fun(A_list, N) != 1):\n print("not coprime")\nelse:\n D = preprocess_fun(A_max)\n if pairwise_coprime_check(A_list, D) == 1:\n print("pairwise coprime")\n else:\n print("setwise coprime")', 'from math import gcd\n\ndef setwise_coprime_check_fun(A_list, N):\n gcd_all = A_list[0]\n for i in range(N - 1):\n gcd_all = gcd(gcd_all, A_list[i + 1])\n if gcd_all == 1:\n break\n return gcd_all\n\ndef preprocess_fun(A_max):\n p_flg = [True] * (A_max + 1)\n D = [0] * (A_max + 1)\n p_flg[0] = False\n p_flg[1] = False\n for i in range(2, A_max + 1, 1):\n if p_flg[i]:\n for j in range(i, A_max + 1, i):\n p_flg[j] = False\n D[j] = i\n return D\n\ndef pairwise_coprime_check(A_list, D, A_max):\n p_count = [0] * (A_max + 1)\n for A in A_list:\n temp = A\n d = 0\n while temp != 1:\n if p_count[D[temp]] == 1 and d != D[temp]:\n return 0\n p_count[D[temp]] = 1\n d = D[temp]\n temp = temp // D[temp]\n return 1\n\n\nN = int(input())\nA_list = list(map(int, input().split(" ")))\n\n\nA_max = max(A_list)\n\n\nif(setwise_coprime_check_fun(A_list, N) != 1):\n print("not coprime")\nelse:\n D = preprocess_fun(A_max)\n if pairwise_coprime_check(A_list, D, A_max) == 1:\n print("pairwise coprime")\n else:\n print("setwise coprime")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s018801018', 's463806792', 's146877944'] | [27188.0, 27016.0, 134708.0] | [114.0, 110.0, 527.0] | [1177, 1217, 1244] |
p02574 | u820685137 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['"""E."""\n\nimport math\nimport sys\nfrom typing import List\n\n\ndef input() -> str: \n """Input."""\n return sys.stdin.readline()[:-1]\n\n\nRESULT_A = \'pairwise coprime\'\nRESULT_B = \'setwise coprime\'\nRESULT_C = \'not coprime\'\n\nn = int(input())\n\na_list = list(map(int, input().split(\' \')))\n\n\ndef get_all_gcd(l: List[int]) -> List[int]:\n result = []\n for i, v1 in enumerate(l[:-1]):\n for v2 in l[i + 1:]:\n result.append(math.gcd(v1, v2))\n return result\n\n\ngcds = get_all_gcd(a_list)\n\nprint(gcds)\n\nif [1] * len(gcds) == gcds:\n print(RESULT_A)\n exit(0)\n\nif [1] * len(gcds) == get_all_gcd(gcds):\n print(RESULT_B)\n exit(0)\n\nprint(RESULT_C)\n', '"""E."""\n\nimport sys\n\n\ndef input() -> str: \n """Input."""\n return sys.stdin.readline()[:-1]\n\n\nRESULT_TEXT = {\n 1: \'pairwise coprime\',\n 2: \'setwise coprime\',\n 3: \'not coprime\',\n}\n\nn = int(input())\n\na_list = list(map(int, input().split(\' \')))\n\nans = 0\n\nMAX = 1000000 + 1\ncounts = [0] * MAX\nfor a in a_list:\n counts[a] += 1\n\nmax_count = 0\n\nfor i in range(2, MAX):\n max_count = max(max_count, sum(counts[i::i]))\n\nif max_count == n:\n ans = 3\nelif max_count >= 2:\n ans = 2\nelse:\n ans = 1\n\nprint(RESULT_TEXT[ans])\n'] | ['Wrong Answer', 'Accepted'] | ['s890504776', 's632094925'] | [664768.0, 126884.0] | [2224.0, 951.0] | [679, 550] |
p02574 | u825541307 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["N = int(input())\nA = list(map(int,input().split()))\n\ndef divisors(n):\n\tdiv = [1, n]\n\t\n\tfor i in range(2, int(n**0.5)+1):\n\t\tif n % i == 0:\n\t\t\tdiv.append(i)\n\t\t\tif i != n//i:\n\t\t\t\tdiv.append(n//i)\n\t\n\treturn div\n\nflag = False\ninter = set(divisors(A[0]))\nunion = set(divisors(A[0]))\ns = len(set(divisors(A[0])))\nfor i in range(1,N):\n div = set(divisors(A[i]))\n s += len(div)\n inter &= div\n union |= div\n print(s,inter,union)\nif len(union) == s - N + 1:\n print('pairwise coprime')\nelif inter == {1}:\n print('setwise coprime')\nelse:\n print('not coprime')", "import numpy as np\nN = int(input())\nA = list(map(int,input().split()))\ncnt = [0] * (10**6 + 1)\nfor i in range(N):\n cnt[A[i]] += 1\n\nmaxcount = 0\nfor i in range(2,10**6+1):\n maxcount = max(maxcount,sum(cnt[i::i]))\n\nif np.gcd.reduce(A) != 1:\n print('not coprime')\nelif maxcount <= 1:\n print('pairwise coprime')\nelse:\n print('setwise coprime')"] | ['Runtime Error', 'Accepted'] | ['s514646877', 's000794112'] | [194400.0, 150428.0] | [3883.0, 1122.0] | [571, 354] |
p02574 | u891516200 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["from math import gcd\n\nN = int(input())\nA = list([int(x) for x in input().split()])\n\nmax_a = 10**6 + 1\n\nbefore = 0\nresult = [0 for _ in range(max_a + 1)]\n\nfor i in A:\n before = gcd(before, i)\n result[i] += 1\n\nis_pairwise = True\nfor i in range(2, max_a + 1):\n cnt = 0\n for j in range(i, max_a + 1, i):\n cnt += result[j]\n\n if cnt > 1:\n is_pairwise = False\n break\n\nif is_pairwise:\n print('pairwise coprime')\n exit()\n\nif before == 1:\n print('setwise coprime')\nelse:\n print('not coprime')\n", "from math import gcd\n\nN = int(input())\nA = list([int(x) for x in input().split()])\n\nmax_a = max(A)\n\nbefore = 0\nresult = [0 for _ in range(max_a + 1)]\n\nfor i in A:\n before = gcd(before, i)\n result[i] += 1\n\nis_pairwise = True\n\nfor i in range(2, max_a + 1):\n cnt = 0\n for j in range(i, max_a + 1, i):\n cnt += result[j]\n if cnt > 1:\n is_pairwise = False\n break\n\nif is_pairwise:\n print('pairwise coprime')\n exit()\nif before == 1:\n print('setwise coprime')\nelse:\n print('not coprime')\n"] | ['Time Limit Exceeded', 'Accepted'] | ['s926344719', 's980735638'] | [133244.0, 133320.0] | [2206.0, 1880.0] | [531, 527] |
p02574 | u893063840 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['from math import gcd\nimport numpy as np\n\nn = int(input())\na = list(map(int, input().split()))\nMAX = 10 ** 6\n\ng = a[0]\nfor e in a:\n g = gcd(g, e)\n\nif g != 1:\n print("not coprime")\n exit()\n\nnums = np.zeros(MAX + 1, np.int64)\nfor e in a:\n nums[e] += 1\nfor i in range(2, MAX + 1):\n if nums[i::i].sum() > 1:\n print("setwise coprime")\n exit()\n\nprint("pairwise coprime")\n\n', 'import numpy as np\nfrom numba import njit\n\nn = int(input())\na = list(map(int, input().split()))\nMAX = 10 ** 6\n\nnums = np.zeros(MAX + 1, np.int64)\nfor e in a:\n nums[e] += 1\n\n\n@njit\ndef solve(nums):\n mx = 0\n for i in range(2, MAX + 1):\n cnt = nums[i::i].sum()\n mx = max(mx, cnt)\n\n return mx\n\n\nmx = solve(nums)\n\nif nums[1] == n:\n ans = "pairwise"\nelif mx == n:\n ans = "not"\nelif mx == 1:\n ans = "pairwise"\nelse:\n ans = "setwise"\n\nans += " coprime"\n\nprint(ans)\n'] | ['Time Limit Exceeded', 'Accepted'] | ['s049689912', 's007703646'] | [150440.0, 209044.0] | [2207.0, 1384.0] | [394, 495] |
p02574 | u903396129 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import math\n\nMAX=10**6+3\ntable = list(range(MAX))\ni=2\nn=MAX\nwhile i<=n:\n table[i] = 2\n i+=2\n\np=3\nwhile p*p<=n:\n if table[p]<p:\n continue\n x=p\n while x<=n:\n table[x]=p\n x+=p\n p+=2\n\ndef primeFactorSet(n):\n result = set()\n while table[n]!=1:\n result.add(table[n])\n n //= table[n]\n return result\n \n\nn = int(input())\nA = list(map(int,input().split()))\npairwise = True\nflags = [False for _ in range(MAX)]\n\nfor i in range(n):\n a=A[i]\n if pairwise:\n t = primeFactorSet(a)\n for p in t:\n if flags[p]:\n pairwise = False\n break\n flags[p]=True\n if i==0:\n g=a\n else:\n g=math.gcd(g,a)\n \nif g>1:\n print("not coprime")\nelif pairwise:\n print("pairwise coprime")\nelse:\n print("setwise coprime")\n', 'import math\n\nMAX=10**6+3\ntable = list(range(MAX))\ni=2\nn=MAX\nwhile i<=n:\n table[i] = 2\n i+=2\n\np=3\nwhile p*p<=n:\n if table[p]<p:\n continue\n x=p\n while x<=n:\n table[x]=p\n x+=p\n\ndef primeFactorSet(n):\n result = set()\n while table[n]!=1:\n result.add(table[n])\n n //= table[n]\n return result\n \n\nn = int(input())\nA = list(map(int,input().split()))\npairwise = True\nflags = [False for _ in range(MAX)]\n\nfor i in range(n):\n a=A[i]\n if pairwise:\n t = primeFactorSet(a)\n for p in t:\n if flags[p]:\n pairwise = False\n break\n flags[p]=True\n if i==0:\n g=a\n else:\n g=math.gcd(g,a)\n \nif g>1:\n print("not coprime")\nelif pairwise:\n print("pairwise coprime")\nelse:\n print("setwise coprime")\n', 'import math\n\nMAX=10**6+3\ntable = list(range(MAX))\ni=2\nn=MAX\nwhile i<n:\n table[i] = 2\n i+=2\np=3\nwhile p*p<=n:\n if table[p]<p:\n p+=2\n continue\n x=p\n while x<=n:\n table[x]=p\n x+=p\n p+=2\n\n\ndef primeFactorSet(n):\n result = set()\n while table[n]!=1:\n result.add(table[n])\n n //= table[n]\n return result\n \n\nn = int(input())\nA = list(map(int,input().split()))\npairwise = True\nflags = [False for _ in range(MAX)]\n\nfor i in range(n):\n a=A[i]\n if pairwise:\n t = primeFactorSet(a)\n for p in t:\n if flags[p]:\n pairwise = False\n break\n flags[p]=True\n if i==0:\n g=a\n else:\n g=math.gcd(g,a)\n \nif g>1:\n print("not coprime")\nelif pairwise:\n print("pairwise coprime")\nelse:\n print("setwise coprime")'] | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s016415162', 's912018189', 's987149004'] | [48424.0, 48500.0, 145020.0] | [2207.0, 2207.0, 993.0] | [845, 836, 856] |
p02574 | u910632349 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['from math import gcd\ndef g(a):\n al=len(a)\n if al==2:\n return gcd(a[0],a[1])\n elif al==1:\n return a[0]\n return gcd(g(a[al//2:]),g(a[:al//2+1]))\nn=int(input())\na=list(map(int,input().split()))\nif g(a)!=1:\n print("not coprime")', 'import numpy as np\nn=int(input())\na=list(map(int,input().split()))\ng=np.gcd.reduce(a)\nif g>1:\n print("not coprime")\n exit()\nc=[0]*(10**6+1)\nfor i in a:\n c[i]+=1\nif np.all([sum(c[i::i])<=1 for i in range(2,10**6+1)]):\n print("pairwise coprime")\nelse:\n print("setwise coprime")'] | ['Wrong Answer', 'Accepted'] | ['s002549341', 's637823341'] | [132752.0, 150448.0] | [942.0, 926.0] | [253, 290] |
p02574 | u914802579 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import math as mt\nn=int(input())\nl=list(map(int,input().split()))\ngd=l[0]\nsv=[0]*(10**6+1)\nfor i in range(2,len(sv)+1):\n if not sv[i]:\n sv[i]=i\n for j in range(2*i,len(sv),i):\n sv[j]=i\nan="not coprime"\nfor i in range(n):\n gd=mt.gcd(gd,l[i])\nif gd!=1:\n\tprint(an)\nelse:\n an="setwise coprime"\n pos=1\n vis=[0]*(10**6+2)\n for i in range(n):\n cr=l[i]\n while cr>1:\n dv=sv[cr]\n if vis[dv]:\n pos=0;break\n while cr%dv==0:\n cr//=dv\n vis[dv]=1\n if pos:\n an="pairwise coprime"\n print(an)\n', 'import math as mt\nn=int(input())\nl=list(map(int,input().split()))\ngd=l[0]\nsv=[0]*(10**6+1)\nfor i in range(2,len(sv)):\n if not sv[i]:\n sv[i]=i\n for j in range(2*i,len(sv),i):\n sv[j]=i\nan="not coprime"\nfor i in range(n):\n gd=mt.gcd(gd,l[i])\nif gd!=1:\n\tprint(an)\nelse:\n an="setwise coprime"\n pos=1\n vis=[0]*(10**6+2)\n for i in range(n):\n cr=l[i]\n while cr>1:\n dv=sv[cr]\n if vis[dv]:\n pos=0;break\n while cr%dv==0:\n cr//=dv\n vis[dv]=1\n if pos:\n an="pairwise coprime"\n print(an)\n'] | ['Runtime Error', 'Accepted'] | ['s700019894', 's327911375'] | [132800.0, 132784.0] | [606.0, 1284.0] | [583, 581] |
p02574 | u922449550 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nexist = np.zeros(10**6+1, dtype=int)\nfor a in A:\n exist[a] += 1\n\nif np.gcd.reduce(A) != 1:\n print('not coprime')\nelif np.all([exist[i::i].sum() <= 1 for i in range(2, 10**6+1)]):\n print('pairwise coprime')\nelse:\n print('setwise coprime')", "import numpy as np\n\nN = int(input())\nA = np.array(list(map(int, input().split())))\nexist = np.zeros(10**6+1, dtype=int)\nexist[A] = 1\n\nif np.gcd.reduce(A) != 1:\n print('not coprime')\nelif np.all([exist[i::i].sum() <= 1 for i in range(2, 10**6+1)]):\n print('pairwise coprime')\nelse:\n print('setwise coprime')", "import numpy as np\n\nN = int(input())\nA = list(map(int, input().split()))\nexist = [0] * (10**6 + 1)\nfor a in A:\n exist[a] += 1\n\nif np.gcd.reduce(A) != 1:\n print('not coprime')\nelif np.all([sum(exist[i::i]) <= 1 for i in range(2, 10**6+1)]):\n print('pairwise coprime')\nelse:\n print('setwise coprime')"] | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s515982090', 's944440944', 's663167267'] | [150436.0, 150424.0, 150048.0] | [2208.0, 2207.0, 891.0] | [322, 315, 310] |
p02574 | u932868243 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["n=int(input())\nimport copy\na=list(map(int,input().split()))\nq=copy.copy(a)\nm=10**6\ntab=[0]*(m+1)\nfor aa in a:\n tab[aa]=1\nfor i in range(2,m+1):\n cnt=0\n for j in tab[i::i]:\n cnt+=j\n if cnt>1:\n break\nelse:\n print('pairwise coprime')\n exit()\nfrom math import gcd\ng=gcd(q[0],q[1])\nif n==2:\n print('setwise coprime' if g==1 else 'not coprime')\n exit()\nfor i in range(2,n):\n g=gcd(g,q[i])\nif g==1:\n print('setwise coprime')\nelse:\n print('not coprime')\n", "n=int(input())\nimport copy\na= [int(x) for x in input().split()]\nMAX_A = 10 ** 6 + 1\nhistogram = [0] * MAX_A\nfor x in a:\n histogram[int(x)] = 1\nfor divider in range(2, MAX_A):\n count = 0\n for counted in histogram[divider::divider]:\n count += counted\n if count > 1:\n break\nelse:\n print('pairwise coprime')\n exit()\nfrom math import gcd\ng=gcd(a[0],a[1])\nif n==2:\n print('setwise coprime' if g==1 else 'not coprime')\n exit()\nfor i in range(2,n):\n g=gcd(g,a[i])\nif g==1:\n print('setwise coprime')\nelse:\n print('not coprime')\n", "n=int(input())\nimport copy\na=list(map(int,input().split()))\nq=copy.copy(a)\nl=[]\nprime=[True]*(max(a)+1)\nprime[0]=False\nprime[1]=False\nfor i in range(2,int(max(a)**0.5)+1):\n if prime[i]:\n for j in range(i*2,max(a)+1,i):\n prime[j]=False\nprimetab=[i for i in range(max(a)+1) if prime[i]]\nfor i in range(n):\n b=i**0.5\n ll=[]\n for j in primetab:\n if a[i]%j==0:\n ll.append(j)\n a[i]//=j\n if a[i]>b:\n l.append(a[i])\n l+=ll\nx=len(l)\ny=len(set(l))\nif x==y:\n print('pairwise coprime')\n exit()\nfrom math import gcd\ng=gcd(q[0],q[1])\nif n==2:\n print('setwise coprime' if g==1 else 'not coprime')\n exit()\nfor i in range(2,n):\n g=gcd(g,q[i])\nif g==1:\n print('setwise coprime')\nelse:\n print('not coprime')\n", "n=int(input())\nimport copy\na=list(map(int,input().split()))\nq=copy.copy(a)\nl=[]\nprime=[True]*(max(a)+1)\nprime[0]=False\nprime[1]=False\nfor i in range(2,int(max(a)**0.5)+1):\n if not prime[i]:\n continue\n for j in range(i*2,max(a)+1,i):\n prime[j]=False\nprimetab=[i for i in range(max(a)+1) if prime[i]]\nfor i in range(n):\n b=i**0.5\n ll=[]\n for j in primetab:\n if a[i]%j==0:\n ll.append(j)\n a[i]//=j\n if a[i]>b:\n l.append(a[i])\n l+=ll\nx=len(l)\ny=len(set(l))\nif x==y:\n print('pairwise coprime')\n exit()\nfrom math import gcd\ng=gcd(q[0],q[1])\nif n==2:\n print('setwise coprime' if g==1 else 'not coprime')\n exit()\nfor i in range(2,n):\n g=gcd(g,q[i])\nif g==1:\n print('setwise coprime')\nelse:\n print('not coprime')", "n=int(input())\nl=list(map(int,input().split()))\nm=max(l)\n\nfrom math import gcd\ng=gcd(l[0],l[1])\nfor i in range(2,n):\n g=gcd(g,l[i])\nif g!=1:\n print('not coprime')\n exit()\n\nprime=[True]*(m+1)\nprime[0]=False\nprime[1]=False\nd=[0]*(m+1)\nfor i in range(2,int(m**0.5)+1):\n if prime[i]:\n for j in range(i*2,m+1,i):\n prime[j]=False\n d[j]=i\ns=[i for i in range(m+1) if prime[i]]\nfor ss in s:\n d[ss]=ss\n\nsl=set()\nfor i in range(n):\n div=set()\n ll=l[i]\n while ll>1:\n div.add(d[ll])\n ll//=d[ll]\n div=list(div)\n for dd in div:\n if dd not in sl:\n sl.add(dd)\n else:\n print('setwise coprime')\n exit()\n\nprint('pairwise coprime')"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s118403377', 's226333772', 's275403249', 's832162908', 's965031897'] | [134052.0, 132932.0, 134068.0, 133132.0, 126396.0] | [1428.0, 1484.0, 2208.0, 2208.0, 766.0] | [463, 536, 726, 738, 661] |
p02574 | u957843607 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ['import math\nfrom math import gcd\nfrom functools import reduce\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\nd_lis = [i for i in range(max(num_lis)+2)]\np = 2\nwhile p**2 <= max(num_lis):\n if d_lis[p] == p:\n for q in range(2*p, max(num_lis)+1, p):\n if d_lis[q] == q:\n d_lis[q] = p\n p += 1\n\ntmp = []\nfor i in num_lis:\n num = i\n new_tmp = []\n while num > 1:\n d = d_lis[num]\n new_tmp.append(d)\n num //= d\n #print(new_tmp)\n for j in new_tmp:\n if j in tmp:\n c1 = False\n break\n else:\n tmp.append(j)\n if not c1:\n break\n\ng = 0\nfor i in num_lis:\n g = gcd(g, i)\nif g > 1:\n c2 = False\n\nif c1:\n print("pairwise coprime")\nelif not c1 and c2:\n print("setwise coprime")\nelse:\n print("not coprime")', 'from math import gcd\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\ndef osa_k(max_num):\n lis = [i for i in range(max_num+1)]\n p = 2\n while p**2 <= max_num:\n if lis[p] == p:\n for q in range(2*p, max_num+1, p):\n if lis[q] == q:\n lis[q] = p\n p += 1\n return lis\n\nhoge = 0\nfor i in num_lis:\n hoge = gcd(hoge, i)\nif i > 1:\n print("not coprime")\n exit()\n\nd_lis = osa_k(max(num_lis))\ntmp = set()\nfor i in num_lis:\n num = i\n new_tmp = set()\n while num > 1:\n d = d_lis[num]\n new_tmp.add(d)\n num //= d\n if len(tmp | new_tmp) != len(tmp)+len(new_tmp):\n print("setwise coprime")\n exit()\n else:\n tmp |= new_tmp\nprint("pairwise coprime")', 'import math\nfrom math import gcd\nfrom functools import reduce\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\nd_lis = [i for i in range(max(num_lis)+2)]\np = 2\nwhile p**2 <= max(num_lis):\n if d_lis[p] == p:\n for q in range(2*p, max(num_lis)+1, p):\n if d_lis[q] == q:\n d_lis[q] = p\n p += 1\n\ntmp = []\nfor i in num_lis:\n num = i\n new_tmp = []\n while num > 1:\n d = d_lis[num]\n new_tmp.append(d)\n num //= d\n #print(new_tmp)\n for j in new_tmp:\n if j in tmp:\n c1 = False\n break\n else:\n tmp.append(j)\n if not c1:\n break\nif c1:\n print("pairwise coprime")\n exit()\n\ng = 0\nfor i in num_lis:\n g = gcd(g, i)\nif g > 1:\n c2 = False\nif c2:\n print("setwise coprime")\n exit()\nprint("not coprime")', 'from math import gcd\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\nd_lis = [i for i in range(max(num_lis)+2)]\np = 2\nwhile p**2 <= max(num_lis):\n if d_lis[p] == p:\n for q in range(2*p, max(num_lis)+1, p):\n if d_lis[q] == q:\n d_lis[q] = p\n p += 1\n\ntmp = []\nfor i in num_lis:\n num = i\n new_tmp = []\n while num > 1:\n d = d_lis[num]\n new_tmp.append(d)\n num //= d\n #print(new_tmp)\n for j in new_tmp:\n if j in tmp:\n c1 = False\n break\n else:\n tmp.append(j)\n if not c1:\n break\nif c1:\n print("pairwise coprime")\n exit()\n\ng = 0\nfor i in num_lis:\n g = gcd(g, i)\nif g > 1:\n c2 = False\nif c2:\n print("setwise coprime")\n exit()\nprint("not coprime")', 'import math\nfrom math import gcd\nfrom functools import reduce\n\ndef osa_k(max_num):\n lis = [i for i in range(max_num+2)]\n p = 2\n while p**2 <= max_num:\n if lis[p] == p:\n for q in range(2*p, max_num+1, p):\n if lis[q] == q:\n lis[q] = p\n p += 1\n return lis\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\nd_lis = osa_k(max(num_lis))\ntmp = []\nfor i in num_lis:\n num = i\n new_tmp = []\n while num > 1:\n d = d_lis[num]\n new_tmp.append(d)\n num //= d\n #print(new_tmp)\n for j in new_tmp:\n if j in tmp:\n c1 = False\n break\n else:\n tmp.append(j)\n if not c1:\n break\n\ng = 0\nfor i in num_lis:\n g = gcd(g, i)\n if g != 1:\n c2 = False\n break\n\nif c1:\n print("pairwise coprime")\nelif not c1 and c2:\n print("setwise coprime")\nelse:\n print("not coprime")', 'from math import gcd\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True\nc2 = True\n\ndef osa_k(max_num):\n lis = [i for i in range(max_num+1)]\n p = 2\n while p**2 <= max_num:\n if lis[p] == p:\n for q in range(2*p, max_num+1, p):\n if lis[q] == q:\n lis[q] = p\n p += 1\n return lis\n\nhoge = 0\nfor i in num_lis:\n hoge = gcd(hoge, i)\nif hoge > 1:\n c1 = False\n\nif c1:\n d_lis = osa_k(max(num_lis))\n tmp = set()\n for i in num_lis:\n num = i\n new_tmp = set()\n while num > 1:\n d = d_lis[num]\n new_tmp.add(d)\n num //= d\n print(new_tmp)\n for j in new_tmp:\n if j in tmp:\n c2 = False\n break\n else:\n tmp.add(j)\n else:\n continue\n break\nelse:\n c2 = False\n\nif c2:\n print("pairwise coprime")\nelif c1:\n print("setwise coprime")\nelse:\n print("not coprime")', 'from math import gcd\n\nN = int(input())\nnum_lis = list(map(int, input().split()))\nc1 = True #setwise\nc2 = True #pairwise\n\ndef osa_k(max_num):\n lis = [i for i in range(max_num+1)]\n p = 2\n while p**2 <= max_num:\n if lis[p] == p:\n for q in range(2*p, max_num+1, p):\n if lis[q] == q:\n lis[q] = p\n p += 1\n return lis\n\nhoge = 0\nfor i in num_lis:\n hoge = gcd(hoge, i)\nif hoge > 1:\n c1 = False\n\nif c1:\n d_lis = osa_k(max(num_lis))\n tmp = set()\n for i in num_lis:\n num = i\n new_tmp = set()\n while num > 1:\n d = d_lis[num]\n new_tmp.add(d)\n num //= d\n for j in new_tmp:\n if j in tmp:\n c2 = False\n break\n else:\n tmp.add(j)\n else:\n continue\n break\nelse:\n c2 = False\n\nif c2:\n print("pairwise coprime")\nelif c1:\n print("setwise coprime")\nelse:\n print("not coprime")'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s002680616', 's209112960', 's291904882', 's465554516', 's873237247', 's942915326', 's282804253'] | [127680.0, 127756.0, 135220.0, 126932.0, 127788.0, 133428.0, 126940.0] | [2208.0, 733.0, 2208.0, 2209.0, 2207.0, 826.0, 597.0] | [775, 713, 771, 730, 844, 858, 858] |
p02574 | u966584145 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["n = int(input())\nA = list(map(int, input().split()))\n\nmaxV = (10 ** 6 + 1)\n\nsieve = [i for i in range(maxV)]\np = 2\n\nwhile p*p < maxV:\n if sieve[p] == p:\n for q in range(p*2, maxV, p):\n if sieve[q] == q:\n sieve[q] = p\n p += 1\n\nfrom math import gcd\n\ng = 0\nprimes = set()\nfor a in A:\n g = gcd(g, A)\n\n v = a\n while a > 1:\n prime = sieve[a]\n if prime in primes:\n print('')\n primes.add(prime)\n a = a // prime\n\n\nif g > 1:\n print('not coprime')\n\nfor a in A:\n while a > 1:\n prime = sieve[a]\n if prime in primes:\n print('pairwise coprime')\n exit()\n primes.add(prime)\n a = a // prime\n\nprint('setwise coprime')", "n = int(input())\nA = list(map(int, input().split()))\n\nmaxV = (10 ** 6 + 1)\n\nsieve = [i for i in range(maxV)]\np = 2\n\nwhile p*p < maxV:\n if sieve[p] == p:\n for q in range(p*2, maxV, p):\n if sieve[q] == q:\n sieve[q] = p\n p += 1\n\nfrom math import gcd\n\ng = 0\nprimes = set()\nfor a in A:\n g = gcd(g, a)\n\n v = a\n\n\nif g > 1:\n print('not coprime')\n exit()\n\nfor a in A:\n while a > 1:\n prime = sieve[a]\n if prime in primes:\n print('setwise coprime')\n exit()\n primes.add(prime)\n a = a // prime\n\nprint('pairwise coprime')", "n = int(input())\nA = list(map(int, input().split()))\n\nmaxV = (10 ** 6 + 1)\n\nsieve = [i for i in range(maxV)]\np = 2\n\nwhile p*p < maxV:\n if sieve[p] == p:\n for q in range(p*2, maxV, p):\n if sieve[q] == q:\n sieve[q] = p\n p += 1\n\nfrom math import gcd\n\ng = 0\nprimes = set()\nfor a in A:\n g = gcd(g, a)\n\n v = a\n\n\nif g > 1:\n print('not coprime')\n exit()\n\nfor a in A:\n temp_prime = set()\n while a > 1:\n prime = sieve[a]\n temp_prime.add(prime)\n a = a // prime\n\n for t in temp_prime:\n if t in primes:\n print('setwise coprime')\n exit()\n primes.add(t)\n\nprint('pairwise coprime')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s005383074', 's354440577', 's344490201'] | [126412.0, 126220.0, 126348.0] | [597.0, 724.0, 772.0] | [741, 611, 682] |
p02574 | u973972117 | 2,000 | 1,048,576 | We have N integers. The i-th number is A_i. \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N. \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1. Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither. Here, GCD(\ldots) denotes greatest common divisor. | ["import math\nfrom collections import deque\nAnswer = 'not coprime'\nN = int(input())\nAlist = list(map(int,input().split()))\nsign = math.gcd(Alist[0],Alist[1])\nfor i in range(1,N):\n sign = math.gcd(sign,Alist[i])\nif sign == 1:\n Answer = 'setwise coprime'\nAset = set()\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nAlist = deque(Alist)\nsig =1\nif Answer == 'setwise coprime':\n for _ in range(len(Alist)):\n if sig ==0:\n break\n A = Alist.popleft()\n An = factorization(A)\n for i in range(len(An)):\n if An[i][0] not in Aset:\n Aset.add(An[i][0])\n else:\n sig = 0\n if len(Alist) == 0 and sig == 1:\n Answer = 'pairwise corprime'\nprint(Answer)\n", "import math\nN = int(input())\nAlist = list(map(int,input().split()))\nbox = [0]*(10**6+1)\nsign = math.gcd(Alist[0],Alist[1])\nAmax = max(Alist[0],Alist[1])\nfor i in range(0,len(Alist)):\n A = Alist[i]\n sign = math.gcd(sign, A)\n Amax = max(Amax, A)\n box[A] += 1\nsetwise = (sign == 1)\npairwise = (sign == 1)\nAmax = math.sqrt(Amax)+1\nfor i in range(2,10**6+1):\n if sum(box[i::i]) >1:\n pairwise = False\n break\nif setwise:\n if pairwise:\n print('pairwise coprime')\n else:\n print('setwise coprime')\nelse:\n print('not coprime')"] | ['Wrong Answer', 'Accepted'] | ['s743979534', 's180666513'] | [127696.0, 134620.0] | [2206.0, 1016.0] | [1046, 567] |
p02576 | u000037600 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['a,b,c=map(int,input().split())\nd=a//c\nprint(d*c+c)', 'a,b,c=map(int,input().split())\nif a%b==0:\n d=a//b\nelse:\n d=a//b+1\nprint(d*c)'] | ['Wrong Answer', 'Accepted'] | ['s502810141', 's932145032'] | [9148.0, 9152.0] | [32.0, 33.0] | [50, 78] |
p02576 | u004233621 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nprint((n+x-1)/x*t)', 'n, x, t = map(int, input().split())\nprint((n+x-1)//x*t)'] | ['Wrong Answer', 'Accepted'] | ['s985487639', 's841930422'] | [9096.0, 9096.0] | [28.0, 31.0] | [54, 55] |
p02576 | u004823354 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t = map(int,input().split())\nif n % x == 0:\n print(n / x * t)\nelse:\n print(n / x * t + t)', 'n,x,t = map(int,input().split())\nif n % x == 0:\n print(n / x * t)\nelse:\n print(n / x * t + 1)\n', 'n,x,t = map(int,input().split())\nif n % x == 0:\n print(n // x * t)\nelse:\n print(n // x * t + t)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s416866052', 's422624213', 's818478198'] | [9164.0, 9140.0, 9148.0] | [27.0, 24.0, 26.0] | [95, 96, 97] |
p02576 | u007346335 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nif n%x==0:\n print(n*t/x)\nelse:\n print(((math.floot(n/x))+1)*t)', 'n, x, t = map(int, input().plist())\nprint(((math.floot(n/x))+1)*t)', 'n, x, t = map(int, input().split())\nif n%x==0:\n print(n*t/x)\nelse:\n print(((int(n/x)+1)*t)', 'n, x, t = map(int, input().plist())\nif n%x==0:\n print(((math.floot(n/x))+1)*t)\nelse print(n*t/x)', 'n, x, t = map(int, input().plist())\nif n%x==0:\n print(n*t/x)\nelse:\n print(((math.floot(n/x))+1)*t)', 'n, x, t = map(int(i) for in input().split())\nif n%x==0:\n print(n/x*t)\nelse:\n print( (int(n/x)+1)*t )', 'n, x, t = map(int, input().split())\nif n%x==0:\n print(n/x*t)\nelse:\n print(((int(n/x)+1)*t)\n', 'n, x, t = map(int, input().split())\nif n%x == 0:\n print(n*t/x)\nelse:\n print(((int(n/x)+1)*t)', 'n, x, t = map(int, input().split())\nif n%x==0:\n print((n//x)*t)\nelse:\n print( ((n//x)+1)*t )'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s021794027', 's058334430', 's098624666', 's442334068', 's484579133', 's762697872', 's782300904', 's932469508', 's175470507'] | [9124.0, 8960.0, 8868.0, 8872.0, 9068.0, 8896.0, 8880.0, 8668.0, 9060.0] | [29.0, 22.0, 28.0, 29.0, 20.0, 28.0, 28.0, 20.0, 27.0] | [100, 66, 92, 97, 100, 102, 93, 94, 94] |
p02576 | u013617325 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ["#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, X: int, T: int):\n i = 0\n A = 0\n while:\n if A < 0:\n break\n A = N - X*i\n i+=1\n\n return print(i*T)\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n X = int(next(tokens)) # type: int\n T = int(next(tokens)) # type: int\n solve(N, X, T)\n\nif __name__ == '__main__':\n main()\n~ ", "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, X: int, T: int):\n i = 1\n A = 0\n while(True):\n A = N - X*i\n\n if A <= 0:\n break\n\n i+=1\n\n return print(i*T)\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n X = int(next(tokens)) # type: int\n T = int(next(tokens)) # type: int\n solve(N, X, T)\n\nif __name__ == '__main__':\n main()"] | ['Runtime Error', 'Accepted'] | ['s103879213', 's989936653'] | [8944.0, 9204.0] | [21.0, 25.0] | [721, 711] |
p02576 | u021849254 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['a,b,c=map(int,input().split())\nprint((a//b)*c)', 'a,b,c=map(int,input().split())\nd=0\nif a%b!=0:\n d=1\nprint((d+a//b)*c)\n'] | ['Wrong Answer', 'Accepted'] | ['s000744904', 's779770199'] | [9052.0, 9020.0] | [26.0, 28.0] | [46, 70] |
p02576 | u023229441 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t=map(int,input().split())\np= n//x+1 if n%x!=0 else n//x\nprint(x*p)', '\nn,x,t=map(int,input().split())\np= n//x+1 if n%x!=0 else n//x\nprint(t*p)\n'] | ['Wrong Answer', 'Accepted'] | ['s953621970', 's142422055'] | [9096.0, 9056.0] | [25.0, 29.0] | [71, 73] |
p02576 | u029399657 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,k,t = map(int,input().split())\ncount = 0\nwhile n<0:\n n-=k\n count+=1\nprint(count*t)', '# n = int(input())\n# ans = (n*(n-1))//2\n# print(ans)\n\nn,k,t = map(int,input().split())\ncount = 0\nwhile n>0:\n n-=k\n count+=1\nprint(count*t)'] | ['Wrong Answer', 'Accepted'] | ['s513606097', 's760910421'] | [9152.0, 9164.0] | [35.0, 32.0] | [86, 144] |
p02576 | u033620559 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = list(map(int, input().split()))\n\ndef tako(n, x, t):\n time = 0\n while n > 0:\n n -= x\n time += t\n return time', 'n, x, t = list(map(int, input().split()))\n\ndef tako(n, x, t):\n time = 0\n while n > 0:\n n -= x\n time += t\n return time\n\nprint(tako(n, x, t))'] | ['Wrong Answer', 'Accepted'] | ['s239103740', 's013676326'] | [9148.0, 9168.0] | [27.0, 27.0] | [140, 162] |
p02576 | u039304781 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\nN, X, T = map(float, input().split())\n\nans = N / X\n\nans = math.ceil(ans)\n\ntime = ans * T\n\nprint(time)', 'N =int(input())\nlst = []\n\nN = str(N)\n\nlist_num = list(N)\n\nN = [int(s) for s in list_num]\nans = sum(N)\n\nif ans % 9 == 0:\n print("Yes")\nelse:\n print("No")', 'import math\nN, X, T = map(float, input().split())\n\nans = N / X\n\nans = math.ceil(ans)\n\ntime = ans * T\n\nprint(int(time))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s128329619', 's386690137', 's610341250'] | [9028.0, 9096.0, 8888.0] | [33.0, 23.0, 28.0] | [113, 154, 118] |
p02576 | u043170743 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T= map(int, input().split())\nif N%X==0:\n print((N/X)*T)\nelse:\n print(N/X +1)*T)', 'N,X,T= map(int, input().split())\nif N%X==0:\n print((N/X)*T)\nelse:\n print(((N/X)+1)*T)', 'N,X,T=int(input())\nif N%X==0:\n print((N/X)*T)\nelse:\n print((N/X +1)*T)', 'N,X,T= map(int, input().split())\nif N%X==0:\n print((N/X)*T)\nelse:\n print((N/X +1)*T)', 'N,X,T= map(int, input().split())\nif N%X==0:\n print((N//X)*T)\nelse:\n print(((N//X)+1)*T)\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s330896051', 's349975057', 's803311109', 's869115524', 's998922647'] | [8880.0, 9160.0, 9108.0, 9016.0, 9152.0] | [25.0, 29.0, 21.0, 27.0, 24.0] | [85, 87, 73, 86, 90] |
p02576 | u047197186 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input())\n\nif n % x == 0:\n print(t * (n // x))\nelse:\n print(t * ((n // x) + 1))\n ', 'n, x, t = map(int, input().split())\n\nif n % x == 0:\n print(t * (n // x))\nelse:\n print(t * ((n // x) + 1))\n '] | ['Runtime Error', 'Accepted'] | ['s968096700', 's102122256'] | [9092.0, 9044.0] | [26.0, 29.0] | [102, 110] |
p02576 | u050462802 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['H,W,M=map(int,input().split())\nMX=[0]*H\nMY=[0]*W\nMA=[0]*M\n\nfor i in range(M):\n x,y=map(int,input().split())\n x-=1\n y-=1\n MX[x]+=1\n MY[y]+=1\n MA[i]=(x,y)\nxmax=max(MX)\nymax=max(MY)\nix=[x[0] for x in enumerate(MX) if x[1]==xmax]\niy=[x[0] for x in enumerate(MY) if x[1]==ymax]\n\ni=0\nj=0\nfor x,y in MA:\n if x in ix or y in iy:\n pass\n else:\n i+=1\n \n j+=1\n \n if len(ix)*len(iy)-j>M-i:\n print(xmax+ymax)\nelse:\n print(xmax+ymax-1)\n', 'import numpy as np\n\nH,W,M=input().split()\nH=int(H)\nW=int(W)\nM=int(M)\nMA=np.zeros((H,W),dtype=int64)\nMX=[0]*H\nMY=[0]*W\nfor i in range(M):\n x,y=input().split()\n MA[int(x)-1,int(y)-1]=1\n\nMX=np.sum(MA,axis=1)\nMY=np.sum(MA,axis=0)\n\nxmax=max(MX)\nymax=max(MY)\nix=[x[0] for x in enumerate(MX) if x[1]==xmax]\niy=[x[0] for x in enumerate(MY) if x[1]==ymax]\n\nii=min([MA[x,y] for x in ix for y in iy])\n\nprint(xmax+ymax-ii)\n', 'N,X,T=input().split()\n\nprint(((int(N)-1)//int(X)+1)*int(T))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s499026489', 's940496465', 's473389816'] | [9172.0, 27052.0, 9152.0] | [25.0, 128.0, 33.0] | [443, 413, 60] |
p02576 | u055641210 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\n\nN/x=math.ceil(a)\na*T=aa\n\nprint(aa)', 'n,x,t = input().split()\n\nb = -(-int(n)//int(x))\na = b*int(t)\n\nprint(a)'] | ['Runtime Error', 'Accepted'] | ['s203814015', 's968536874'] | [9088.0, 9068.0] | [33.0, 27.0] | [47, 70] |
p02576 | u060633673 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int, raw_input().split())\n\nfor i in range(1001):\n if i * X >= N:\n print (i * T)\n break\n', 'N, X, T = map(int, input().split())\n\nfor i in range(1001):\n if i * X >= N:\n print (i * T)\n break\n'] | ['Runtime Error', 'Accepted'] | ['s611033341', 's025739975'] | [8944.0, 9144.0] | [30.0, 29.0] | [118, 114] |
p02576 | u061835391 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['a,b,c=map(int,input().split())\ns=k\nm=c\nwhile s<a:\n s=s+b\n m=m+c\nprint(m)', 'a,b,c=map(int,input().split())\ns=b\nm=c\nwhile s<a:\n s=s+b\n m=m+c\nprint(m)\n'] | ['Runtime Error', 'Accepted'] | ['s303919910', 's659392445'] | [9152.0, 9148.0] | [28.0, 33.0] | [74, 75] |
p02576 | u065578867 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nprint((n // x + 1) * T)', 'import math\n\nn, x, t = map(int, input().split())\nprint(math.ceil(n / x) * t)'] | ['Runtime Error', 'Accepted'] | ['s424927141', 's285533385'] | [9068.0, 9164.0] | [28.0, 28.0] | [59, 76] |
p02576 | u068322747 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t=map(int, input().split())\na=(n/x)\nprint(a)\nif a==type(int):\n a=str(a)\n b=int(a[:a.index(".")])\n print(b*t)\nelse:\n a=str(a)\n a2=a[a.index("."):]\n if a2==\'.0\':\n b=int(a[:a.index(".")])\n print(b*t)\n else:\n b=int(a[:a.index(".")])+1\n print(b*t)', 'n,x,t=map(int, input().split())\na=(n/x)\nprint(a)\nif a==type(int):\n a=str(a)\n b=int(a[:a.index(".")])\nelse:\n a=str(a)\n a2=a[a.index("."):]\n print(a2)\n if a2==\'.0\':\n b=int(a[:a.index(".")])\n print(b*t)\n else:\n b=int(a[:a.index(".")])+1\n print(b*t)', 'n,x,t=map(int, input().split())\na=(n/x)\nif a==type(int):\n a=str(a)\n b=int(a[:a.index(".")])\nelse:\n a=str(a)\n a2=a[a.index("."):]\n if a2==\'.0\':\n b=int(a[:a.index(".")])\n print(b*t)\n else:\n b=int(a[:a.index(".")])+1\n print(b*t)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s466356851', 's790715762', 's347791052'] | [9208.0, 9152.0, 9200.0] | [28.0, 34.0, 34.0] | [295, 294, 271] |
p02576 | u071916806 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T=input().split()\nn=int(N)\nx=int(X)\nt=int(T)\ns=t*(((n-(n%x))/x)+1)\nprint(s)', 'N,X,T=input().split()\nn=int(N)\nx=int(X)\nt=int(T)\nif n%x==0:\n s=int(t*(n/x))\n print(s)\nelse:\n s=int(t*(((n-(n%x))/x)+1))\n print(s)'] | ['Wrong Answer', 'Accepted'] | ['s705763563', 's259426509'] | [9104.0, 9144.0] | [29.0, 35.0] | [79, 133] |
p02576 | u082861480 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t = map(int, input().split())\nprint(t * (n // x + 1) if n % x == 0 else t * (n // x))', 'n,x,t = map(int, input().split())\nprint(t * (n // x + 1) if n % x != 0 else t * (n // x))'] | ['Wrong Answer', 'Accepted'] | ['s668612907', 's148093291'] | [9004.0, 9012.0] | [30.0, 33.0] | [89, 89] |
p02576 | u085186789 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int, input().split())\nprint(ceil(N / X) * T)', 'N = int(input())\nX = int(input())\nT = int(input())\nprint(ceil(N / X) * T)\n', 'N = int(input())\nX = int(input())\nT = int(input())\nif N % X == 0:\n print(N / X * T)\nelse:\n print(N / X * T + T)', 'N = int(input())\nX = int(input())\nT = int(input())\nprint(ceil(N / X) * T)', 'N, X, T = map(int, input().split())\nif N % X == 0:\n print(N / X * T)\nelse:\n print((N / X + 1) * T', 'N, X, T = map(int, input().split())\nif N % X == 0:\n print(N / X * T)\nelse:\n print((N / X + 1) * T)', 'N, X, T = map(int, input().split())\nif N % X == 0:\n print(int(N / X) * T)\nelse:\n print(int(N / X + 1) * T)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s101337319', 's199963986', 's217120647', 's380856936', 's893801660', 's948604058', 's422026832'] | [9012.0, 9136.0, 9148.0, 9184.0, 8956.0, 9092.0, 9104.0] | [27.0, 28.0, 20.0, 28.0, 23.0, 28.0, 28.0] | [58, 74, 113, 73, 99, 100, 108] |
p02576 | u092104621 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['h,w,m = map(int, input().split())\nmp = [[0 for i in range(h)] for j in range(w)]\nfor i in range(m):\n l =list(map(int, input().split()))\n mp[l[1]-1][l[0]-1] = 1\nmx = 0\nfor y in range(w):\n for x in range(h):\n cn = 0\n \n for xx in range(h):\n cn += mp[y][xx]\n \n for yy in range(w):\n if yy != y:\n cn += mp[yy][x]\n if cn > mx:\n mx = cn\nprint(mx)', 'n,x,t = map(int, input().split())\nq,m = divmod(n,x)\nif m > 0:\n q += 1\nprint(q * t)'] | ['Runtime Error', 'Accepted'] | ['s669621820', 's456419988'] | [15412.0, 9168.0] | [58.0, 28.0] | [416, 85] |
p02576 | u094109650 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int, input().split())\n\nmin_time = (N / X + 1) * T\n\nprint(min_time)', 'N, X, T = map(int, input().split())\n\na = N / X\n\nimport math\n\nmin_time = math.ceil(a) * T\n\nprint(min_time)\n'] | ['Wrong Answer', 'Accepted'] | ['s765009638', 's688306537'] | [8948.0, 9032.0] | [33.0, 30.0] | [80, 106] |
p02576 | u097852911 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['num = input()\nle = len(num)\nsum=0\nfor i in range(le):\n sum += int(num[i])\nif sum%==0:\n print("Yes")\nelse:\n print("No")', 'num = input()\nle = len(num)\nsum=0\nfor i in range(le):\n sum += int(num[i])\nif sum%9==0:\n print("Yes")\nelse:\n print("No")\n', 'x = input()\nle = len(x)\nsum = 0\nfor i in range(le):\n sum+=int(x[i])\nprint(sum)\n', 'import math\nn,x,t = map(int,input().split())\nc = t*math.ceil(n/t)\nprint(c)\n', 'n,x,t = map(int,input().split())\nprint(t*(n//t + 1))', 'import math\nn,x,t = map(int,input().split())\nc = t*math.ceil(n/x)\nprint(c)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s017965493', 's335571529', 's343895876', 's476340370', 's743045809', 's264852434'] | [8960.0, 9156.0, 9152.0, 8856.0, 9140.0, 9056.0] | [22.0, 23.0, 27.0, 29.0, 28.0, 31.0] | [121, 123, 80, 75, 52, 75] |
p02576 | u113255362 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T=map(int,input().split())\na= N/X\nb = int(a)\nif a-b > 0:\n a = b+1\nres = b*T\nprint(res)', 'N,X,T=map(int,input().split())\na= N/X\nb = int(a)\nif a-b > 0:\n b = b+1\nres = b*T\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s343092858', 's779379308'] | [9160.0, 9108.0] | [30.0, 26.0] | [91, 91] |
p02576 | u116763463 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['s = input()\nans = 0\nfor x in s:\n ans += int(x)\nif ans%9 == 0:\n print("Yes")\nelse:\n print("No")', 'n, x, t = map(int, input().split())\na = n//x\nif n%x != 0:\n a += 1\nprint(t*a)'] | ['Runtime Error', 'Accepted'] | ['s423207391', 's146900718'] | [9120.0, 9120.0] | [24.0, 27.0] | [97, 77] |
p02576 | u122743999 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['oc, cap, time = map(int, input().split())\ncnt = 0\nwhile oc>0:\n oc -= cap\n cnt += time\n\nprint(time)\n', 'oc, cap, time = map(int, input().split())\ncnt = 0\nwhile oc>0:\n oc -= cap\n cnt += time\n\nprint(cnt)\n'] | ['Wrong Answer', 'Accepted'] | ['s285118298', 's338564772'] | [9064.0, 9148.0] | [27.0, 27.0] | [105, 104] |
p02576 | u127157764 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\nn,x,t = map(int,input().split())\nprint(math.ceil(n//x)*t)\n', 'import math\nn,x,t = map(int,input().split())\nprint(math.ceil(n/x)*t)\n'] | ['Wrong Answer', 'Accepted'] | ['s781155120', 's745852537'] | [9152.0, 9144.0] | [35.0, 33.0] | [70, 69] |
p02576 | u132147074 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['line = input();\nN, X, T = line.split(" ")\n\nreturn (N + X - 1) // X * T', 'line = input()\nN, X, T = line.split(" ")\n\nprint((N + X - 1) // X * T)', 'line = input()\n\nN, X, T = (int(x) for x in line.split(" "))\n\nprint((N + X - 1) // X * T)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s209490131', 's625275499', 's350688630'] | [8800.0, 9100.0, 8988.0] | [23.0, 22.0, 28.0] | [70, 69, 88] |
p02576 | u133690429 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n = int(input())\nx = int(input())\nt = int(input())\n \nif(n%x==0):\n count = n // x\nelse:\n count = n // x + 1\n \nprint(count*t)', 'n = int(input())\nx = int(input())\nt = int(input())\n \nif(n%x==0):\n count,mod = divmod(n,x)\nelse:\n count,mod = divmod(n,x)\n count = count + 1\n \nprint(count*t)', 'n = int(input())\nx = int(input())\nt = int(input())\n\nif(n%x==0):\n count = n/x\nelse:\n count = n/x + 1\n\nprint(count*t)', 'n = int(input())\nx = int(input())\nt = int(input())\n \nif(n%x==0):\n count = n//x\nelse:\n count = n//x + 1\n \nprint(count*t)', 'n = []\nn = input().split()\nn_1 = int(n[0])\nx = int(n[1])\nt = int(n[2])\n \nif(n_1%x==0):\n count,mod = divmod(n_1,x)\nelse:\n count,mod = divmod(n_1,x)\n count = count + 1\n \nprint(count*t)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s126946372', 's269754792', 's335123445', 's917099122', 's870886534'] | [9108.0, 9164.0, 9160.0, 9168.0, 9116.0] | [29.0, 25.0, 27.0, 26.0, 29.0] | [125, 159, 117, 121, 185] |
p02576 | u134185377 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import numpy as np\nH,W,M=map(int,input().split())\n\nB=np.zeros((H,W))\nfor i in range(M):\n inp=list(map(int,input().split()))\n B[inp[0]-1][inp[1]-1]=1\nBT=B.T\nmaxmax=0\nfor i in range(H):\n for j in range(W):\n sumsum=0\n sumsum=np.sum(B[i])+np.sum(BT[j])-B[i][j]\n #print((np.sum(B[i]),np.sum(BT[j]),B[i][j]))\n if maxmax<sumsum:\n maxmax=sumsum\nprint(int(maxmax))', 'N,X,T=map(int,input().split())\n\nif N%X==0:\n print(str(((N//X))*T))\nelse:\n print(str(((N//X)+1)*T))'] | ['Runtime Error', 'Accepted'] | ['s049183749', 's195355259'] | [27040.0, 9160.0] | [117.0, 32.0] | [403, 104] |
p02576 | u141419468 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int, input().split())\n\ncnt = N // X\n\nif cnt == 0:\n print(T)\nelse:\n print(cnt*T)', 'N, X, T = map(int, input().split())\n\ncnt = N // X\nbl = N % X\nif bl == 0:\n print(cnt*T)\nelse:\n print((cnt+1)*T)'] | ['Wrong Answer', 'Accepted'] | ['s595202626', 's476742208'] | [9156.0, 9036.0] | [31.0, 35.0] | [99, 117] |
p02576 | u144147599 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\na = (n + x - 1) // x * t\nprint a', 'n, x, t = map(int, input().split())\na = (n + x - 1) // x * t\nprint(a)'] | ['Runtime Error', 'Accepted'] | ['s332983378', 's725544722'] | [9000.0, 9088.0] | [23.0, 29.0] | [68, 69] |
p02576 | u144540235 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ["\ndef RemoveDoublons(pile, elem):\n i = 0\n l = len(pile)\n while (i < l):\n val = pile[i]\n if (val[0] == elem[0] and val[1] == elem[1]):\n pile.pop(i)\n l -= 1\n i += 1\n return pile\n\ndef findCloser(pile, distance):\n pos = 0\n elem = pile[0]\n bestDist = distance[elem[0]][elem[1]]\n if (bestDist == 0):\n return 0\n for i in range(len(pile)):\n val = pile[i]\n if (distance[val[0]][val[1]] < bestDist):\n elem = val\n bestDist = distance[elem[0]][elem[1]]\n pos = i\n if (bestDist == 0):\n return pos\n return pos\n\ndef isValidCase(i, j, size, mappy):\n if (i < 0 or j < 0 or i >= size[0] or j >= size[1] or not mappy[i][j]):\n return False\n return True\n\ndef Calculdist(i, j, elem):\n if ((i == elem[0] and abs(j - elem[1]) == 1) or (j == elem[1] and abs(i - elem[0]) == 1)):\n return 0\n return 1\n\ndef printMappy(distance):\n for i in range(len(distance)):\n print(distance[i])\n\ndef parcour(mappy, distance, start, end, size):\n pile = [start]\n distance[start[0]][start[1]] = 0\n\n while(len(pile) > 0):\n pos = findCloser(pile, distance)\n elem = pile.pop(pos)\n pile = RemoveDoublons(pile, elem)\n myDist = distance[elem[0]][elem[1]]\n if (elem[0] == end[0] and elem[1] == end[1]):\n return myDist\n for i in range(elem[0] - 2, elem[0] + 3):\n for j in range(elem[1] - 2, elem[1] + 3 ):\n if (isValidCase(i, j, size, mappy) and not (i == elem[0] and j == elem[1])):\n dist = Calculdist(i, j, elem)\n if (myDist + dist < distance[i][j]):\n distance[i][j] = myDist + dist\n pile.append([i,j])\n return -1\n\n\ndata = input().split()\nsize = [int(data[0]) , int(data[1])]\ndata = input().split()\nstart = [int(data[0]) - 1, int(data[1]) - 1]\ndata = input().split()\nend = [int(data[0]) - 1, int(data[1]) - 1]\n\nLIM = 999\nmappy = []\ndistance = []\nfor i in range(size[0]):\n tmp = [False] * size[1]\n tmp2 = [LIM] * size[1]\n s = input()\n for j in range(size[1]):\n if (s[j] == '.'):\n tmp[j] = True\n mappy.append(tmp)\n distance.append(tmp2)\nres = parcour(mappy, distance, start, end, size)\nprint(res)\n\n", "\ndef RemoveDoublons(pile, elem):\n i = 0\n l = len(pile)\n while (i < l):\n val = pile[i]\n if (val[0] == elem[0] and val[1] == elem[1]):\n pile.pop(i)\n l -= 1\n i += 1\n return pile\n\ndef findCloser(pile, distance):\n pos = 0\n elem = pile[0]\n bestDist = distance[elem[0]][elem[1]]\n if (bestDist == 0):\n return 0\n for i in range(len(pile)):\n val = pile[i]\n if (distance[val[0]][val[1]] < bestDist):\n elem = val\n bestDist = distance[elem[0]][elem[1]]\n pos = i\n if (bestDist == 0):\n return pos\n return pos\n\ndef isValidCase(i, j, size, mappy):\n if (i < 0 or j < 0 or i >= size[0] or j >= size[1] or not mappy[i][j]):\n return False\n return True\n\ndef Calculdist(i, j, elem):\n if ((i == elem[0] and abs(j - elem[1]) == 1) or (j == elem[1] and abs(i - elem[0]) == 1)):\n return 0\n return 1\n\ndef printMappy(distance):\n for i in range(len(distance)):\n print(distance[i])\n\ndef parcour(mappy, distance, start, end, size):\n pile = [start]\n distance[start[0]][start[1]] = 0\n\n while(len(pile) > 0):\n pos = findCloser(pile, distance)\n elem = pile.pop(pos)\n pile = RemoveDoublons(pile, elem)\n myDist = distance[elem[0]][elem[1]]\n if (elem[0] == end[0] and elem[1] == end[1]):\n return myDist\n for i in range(elem[0] - 2, elem[0] + 3):\n for j in range(elem[1] - 2, elem[1] + 3 ):\n if (isValidCase(i, j, size, mappy) and not (i == elem[0] and j == elem[1])):\n #print()\n dist = Calculdist(i, j, elem)\n if (myDist + dist < distance[i][j]):\n distance[i][j] = myDist + dist\n pile.append([i,j])\n return -1\n\n\ndata = input().split()\nsize = [int(data[0]) , int(data[1])]\ndata = input().split()\nstart = [int(data[0]) - 1, int(data[1]) - 1]\ndata = input().split()\nend = [int(data[0]) - 1, int(data[1]) - 1]\n\nLIM = 999\nmappy = []\ndistance = []\nfor i in range(size[0]):\n tmp = [False] * size[1]\n tmp2 = [LIM] * size[1]\n s = input()\n for j in range(size[1]):\n if (s[j] == '.'):\n tmp[j] = True\n mappy.append(tmp)\n distance.append(tmp2)\nres = parcour(mappy, distance, start, end, size)\nprint(res)\n\n", '\n\ndata = input().split()\n\nn,x,t = int(data[0]), int(data[1]), int(data[2])\n\nres = (n // x) * t\nif (n%x != 0):\n res += t\nprint(res)\n\n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s803392026', 's834499517', 's629292913'] | [9216.0, 9284.0, 9092.0] | [30.0, 31.0, 25.0] | [2366, 2395, 136] |
p02576 | u150906260 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int, input().split())\n\nanswer = 0\n\nif N%X == 0:\n S = N/X\n answer = S*T\nelse:\n S = N / X\n answer = (S+1) * T\n\nprint(int(answer))', 'N,X,T = map(int, input().split())\n\nanswer = 0\n\nif N%X == 0:\n S = int(N/X)\n answer = S*T\nelse:\n S = int(N / X)\n answer = (S+1) * T\n\nprint(int(answer))'] | ['Wrong Answer', 'Accepted'] | ['s994961871', 's791919637'] | [9164.0, 9104.0] | [35.0, 33.0] | [151, 161] |
p02576 | u153047519 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nprint((n // x + 0 if n % x == 0 else 1) * t)', 'n, x, t = map(int, input())\nprint((n // x + 1) * t)', 'n, x, t = map(int, input().split())\nprint((n // x + (n % x == 0) ? 0 : 1) * t)', 'n, x, t = map(int, input().split())\nprint((n // x + (0 if n % x == 0 else 1)) * t)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s408829858', 's530035404', 's895823596', 's574169405'] | [9160.0, 9044.0, 8896.0, 9092.0] | [27.0, 28.0, 23.0, 29.0] | [80, 51, 78, 82] |
p02576 | u153823221 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\n\nif n%x > 0:\n print(t * (n//x) + 1)\nelse:\n print(t * (n//x))\n\n ', 'n, x, t = map(int, input().split())\n \nif n%x > 0:\n print(t * (n//x + 1))\nelse:\n print(t * (n//x))'] | ['Wrong Answer', 'Accepted'] | ['s934428391', 's764560569'] | [9148.0, 9104.0] | [27.0, 31.0] | [102, 99] |
p02576 | u153955689 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int,input().split())\nans = (N + X -1) / X * T\nprint(ans)', 'N,X,T = map(int,input().split())\nans = (N + (X -1) / X) * T\nprint(ans)', 'n, x, t = map(int,input().split())\nk = (n + x -1) // x\nans = k * t\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s213304373', 's849855368', 's133485327'] | [9156.0, 9052.0, 8992.0] | [29.0, 29.0, 27.0] | [68, 70, 77] |
p02576 | u155672847 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t = [int(x) for x in input().split()]\nprint((n*t)//x)', 'from math import ceil\nn,x,t = [int(x) for x in input().split()]\nprint(ceil(n/x)*t)'] | ['Wrong Answer', 'Accepted'] | ['s062681909', 's926816948'] | [9148.0, 9144.0] | [35.0, 32.0] | [57, 82] |
p02576 | u158415841 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N=20; X=12; T=6\nimport math\nT_total = ( math.ceil( N / X )*T + T )\n\nprint (T_total)', 'import math\nT_total = ( math.ceil( N / X )*T )\n\nprint (T_total)', "NXT = [int(i) for i in input().split(' ')]\nimport math\nT_total = ( math.ceil( NXT[0]/ NXT[1] )*NXT[2] )\n\nprint (T_total)"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s654378922', 's913585302', 's308534352'] | [9048.0, 8960.0, 9160.0] | [28.0, 24.0, 30.0] | [83, 63, 120] |
p02576 | u161876643 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int,input().split())\nprint(T*(N/X+1))', 'import math\nN,X,T = map(int,input().split())\nprint(T*math.ceil(N/X))'] | ['Wrong Answer', 'Accepted'] | ['s990126405', 's023144274'] | [9088.0, 9140.0] | [29.0, 27.0] | [49, 68] |
p02576 | u167681994 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\nn, x, t = [int(x) for x in input().split()]\nprint(math.ceil(n/x*t))', 'n, x, t = [int(x) for x in input().split()]\nprint(ceil(n/x*t))', 'import math\nn, x, t = [int(x) for x in input().split()]\nprint(math.ceil(n/x)*t)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s181611959', 's736802447', 's344267568'] | [9088.0, 9016.0, 8876.0] | [28.0, 27.0, 27.0] | [79, 62, 79] |
p02576 | u167993508 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int,input().split())\n\nif n%x==0:\n print((n//x)*t)\nelse:\n n = n//2 +1\n print(n*t)', 'n, x, t = map(int,input().split())\n\nif n%x==0:\n print((n//x)*t)\nelse:\n n = n//x +1\n print(n*t)\n'] | ['Wrong Answer', 'Accepted'] | ['s144304626', 's207942241'] | [9160.0, 9160.0] | [26.0, 25.0] | [97, 98] |
p02576 | u183158695 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t = map(int,input().split())\n\nif n % x == 0:\n print((n // x) * t + t)\nelse:\n print((n // x) * t)', 'n,x,t = map(int,input().split())\n\nif n % x != 0:\n print((n // x + 1) * t)\nelse:\n print((n // x) * t)\n'] | ['Wrong Answer', 'Accepted'] | ['s923582518', 's674359908'] | [9180.0, 9088.0] | [31.0, 25.0] | [102, 103] |
p02576 | u185948224 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\nn, x, t = map(int, input().split())\n\nprint(t * math(n/x))', 'import math\nn, x, t = map(int, input().split())\n \nprint(t * math.ceil(n/x))'] | ['Runtime Error', 'Accepted'] | ['s514217399', 's173460626'] | [9128.0, 8980.0] | [23.0, 25.0] | [69, 75] |
p02576 | u188828568 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int, input().split())\na = N/X\nif N%X != 0:\n a += 1\nreturn a * T\n', 'N,X,T = map(int, input().split())\na = int(N/X)\nif N%X != 0:\n a += 1\nprint(int(a * T))'] | ['Runtime Error', 'Accepted'] | ['s078242065', 's707560820'] | [9084.0, 8964.0] | [24.0, 26.0] | [77, 86] |
p02576 | u189479417 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int,input().split())\nprint(-(-N // x) * t)', 'N, X, T = map(int,input().split())\nprint(-(-N // X) * T)'] | ['Runtime Error', 'Accepted'] | ['s394925370', 's087147287'] | [9036.0, 8936.0] | [29.0, 31.0] | [56, 56] |
p02576 | u192165179 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,K,T = map(int,input().split())\n\nprint((N//K)*T)', 'N,K,T = map(int,input().split())\n\nif N%K == 0:\n print((N//K)*T)\nelse:\n print(((N//K)+1)*T)'] | ['Wrong Answer', 'Accepted'] | ['s493929179', 's006365704'] | [9172.0, 9096.0] | [29.0, 31.0] | [49, 92] |
p02576 | u192359936 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t=map(int,input().split())\n\nif n%x=0:\n a=n//x\nif n%x!=0:\n a=n//x+1\n\nb=int(a*t)\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x=o:\n a=n//x\nelse:\n a=n//x+1\n\nb=a*t\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x=0:\n a=int(n//x)\nelse:\n a=int(n//x+1)\n\nb=int(a*t)\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x=0:\n a=int(n//x)\nif n%x!=0:\n a=int(n//x+1)\n\nb=int(a*t)\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x=0:\n a=n//x\nelse:\n a=n//x+1\n\nb=a*t\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x=0:\n a=n//x\nelse:\n a=n//x+1\n\nb=int(a*t)\n\nprint(b)\n', 'n,x,t=map(int,input().split())\n\nif n%x==0:\n a=int(n//x)\nelse:\n a=int(n//x+1)\n\nb=int(a*t)\n\nprint(b)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s101157651', 's129637419', 's142374093', 's234309813', 's872390772', 's975480610', 's220072958'] | [8900.0, 8932.0, 8900.0, 8788.0, 8748.0, 8848.0, 9084.0] | [29.0, 30.0, 24.0, 29.0, 27.0, 30.0, 30.0] | [97, 87, 102, 107, 87, 92, 103] |
p02576 | u196455939 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['#A - Takoyaki\nN,X,T = map(int,input().split())\nTime = int(X / N + 1) * T\n\nprint(Time)\n', '#A - Takoyaki\nN,X,T = map(int,input().split())\nTime = (int(N / X ) ) * T\namari = N % X\nif amari != 0 :\n Time += T\n\nprint(Time)\n'] | ['Wrong Answer', 'Accepted'] | ['s866209119', 's934799924'] | [9120.0, 9052.0] | [28.0, 28.0] | [94, 138] |
p02576 | u197909530 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['#ABC176\n#D - Wizard in Maze\n\nh,w=map(int,input().split())\nch,cw=map(int,input().split())\ndh,dw=map(int,input().split())\nb=[ch-1,cw-1]\na,c,d,f=[],[],[],[]\nc.append(b)\nd.append(b)\ny=0\n\nfor i in range(h):\n a.append(list(input()))\n\nwarp=0\n\ndef def1():\n global c,d\n if 0<=ch1<h and 0<=cw1<w:\n e=[ch1,cw1]\n if a[ch1][cw1]=="." and d not in e:\n c.append(e)\n d.append(e)\ndef def2():\n global f\n if 0<=ch2<h and 0<=cw2<w:\n e=[ch2,cw2]\n if a[ch2][cw2]=="." and f not in e:\n f.append(e)\n\nwhile len(c)>0 or len(f)>0 or y==0:\n while len(c)>0 or y==0:\n ch,cw=c[0]\n if ch==dh-1 and cw==dw-1:\n y=1\n if a[ch][cw]==".":\n a[ch][cw]=str(warp)\n c.pop(0)\n ch1,cw1=ch-1,cw\n def1()\n ch1,cw1=ch+1,cw\n def1()\n ch1,cw1=ch,cw-1\n def1()\n ch1,cw1=ch,cw+1\n def1()\n\n for i in range(5):\n ch2=ch-2+i\n for j in range(5):\n cw2=cw-2+j\n def2()\n for i in f:\n if i not in d:\n c.append(i)\n f=[]\n warp=warp+1\nz=a[dh-1][dw-1]\nif z==".":\n print(1)\nelse:\n print(z)', 'n,x,t=map(int,input().split())\na=n//x\n\nif x*a!=n:\n a=a+1\n\nprint(a*t)'] | ['Runtime Error', 'Accepted'] | ['s386244040', 's358798934'] | [9280.0, 9088.0] | [24.0, 26.0] | [1039, 69] |
p02576 | u198065632 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['\nn, x, t = map(int, input().split())\nanswer = (n//x)*t\nprint(answer)\n', 'n, x, t = map(int, input().split())\nanswer = -((-n)//x)*t\nprint(answer)\n'] | ['Wrong Answer', 'Accepted'] | ['s949556416', 's048588416'] | [9016.0, 9040.0] | [28.0, 28.0] | [69, 72] |
p02576 | u200916944 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ["import heapq\nl=lambda:[int(x) for x in input().split()]\nH,W=l()\nCH,CW=l()\nDH,DW=l()\ndh=DH-1\ndw=DW-1\nS=[[x=='#' for x in list(input())] for _ in range(H)]\nq=[(0,0,CH-1,CW-1)]\nheapq.heapify(q)\nchecked=set()\ndef check(h,w,c):\n if h<0 or h>=H or w<0 or w>=W:\n return\n if S[h][w]:\n return\n p=(abs(dh-h),abs(dw-w))\n heapq.heappush(q,(c,p,h,w))\n\ndef main():\n while q:\n c,_,h,w=heapq.heappop(q)\n if h==dh and w==dw:\n return c\n key=(h,w)\n if key in checked:\n continue\n checked.add(key)\n # walk\n check(h-1,w-0,c)\n check(h-0,w-1,c)\n check(h+1,w+0,c)\n check(h+0,w+1,c)\n # warp\n check(h-1,w-1,c+1)\n check(h-1,w+1,c+1)\n check(h+1,w-1,c+1)\n check(h+1,w+1,c+1)\n for i in [-2,+2]:\n for j in range(-2,3):\n check(h+i,w+j,c+1)\n check(h+j,w+i,c+1)\n return -1\nprint(main())\n", 'import math\nN,X,T = map(int, input().split())\nprint(math.ceil(N/X)*T)'] | ['Runtime Error', 'Accepted'] | ['s985333328', 's414486681'] | [9284.0, 9100.0] | [25.0, 32.0] | [959, 69] |
p02576 | u207582576 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = [int(i) for i in input().split()]\nprint(int(N%X*T))', 'import math\n\nN,X,T = [int(i) for i in input().split()]\nprint(math.ceil(N / X) * T)'] | ['Wrong Answer', 'Accepted'] | ['s441234910', 's839157343'] | [9088.0, 9080.0] | [26.0, 29.0] | [59, 82] |
p02576 | u208060831 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n=input().split()\na=int(n[0])/int(n[1])\nif int(n[0])%int(n[1])!=0:\n a+1\nprint(a*int(n[2])', 'import math\nn=input().split()\na=int(n[0])/int(n[1])\nb=math.floor(a)\nprint(b)\nif int(n[0])%int(n[1])!=0:\n b=b+1\nprint(b*int(n[2])) ', '# coding: utf-8\n# Your code here!\nimport math\nn=input().split()\na=int(n[0])/int(n[1])\nb=math.floor(a)\nif int(n[0])%int(n[1])!=0:\n b=b+1\nprint(b*int(n[2])) '] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s404341537', 's868053218', 's898021197'] | [8844.0, 9164.0, 9152.0] | [24.0, 31.0, 34.0] | [90, 132, 157] |
p02576 | u208309047 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N = int(input())\nA = list(map(int, input().split()))\ncount = 0\nmax = A[0]\nfor i in range (0,N):\n while(max>A[i]):\n count = count + 1\n \n # print(A)\n if(max<=A[i]):\n max = A[i]\n # print(A)\nprint(count)', 'N,X,T = map(int, input().split())\n\nif N%X == 0:\n print(N//X*T)\nelse:\n print((N//X+1)*T)'] | ['Runtime Error', 'Accepted'] | ['s042457761', 's192055364'] | [9176.0, 9144.0] | [24.0, 29.0] | [302, 93] |
p02576 | u208394180 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = [int(x) for x in input().split()]\n\nc = n / x + 1\nprint(c * t)', 'n, x, t = [int(x) for x in input().split()]\n\na, b = divmod(n, x)\n\nif b:\n print((a+1) * t)\nelse:\n print(a * t)'] | ['Wrong Answer', 'Accepted'] | ['s588491025', 's629306730'] | [9028.0, 9084.0] | [30.0, 25.0] | [71, 111] |
p02576 | u208633734 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int,input().split())\nprint(-(-N//X*T)', 'N,X,T = map(int,input().split())\nprint(N//X*T)', 'N,X,T = map(int,input().split())\nprint(-(-N//X)*T)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s765736624', 's991860644', 's453335094'] | [8828.0, 9152.0, 9132.0] | [28.0, 29.0, 27.0] | [49, 46, 50] |
p02576 | u209275335 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['h,w,m = map(int,input().split())\nhli = [0]*h\nwli = [0]*w\nli = []\nfor i in range(m):\n a,b = map(int,input().split())\n li.append([a,b])\n hli[a-1] += 1\n wli[b-1] += 1\na = max(hli)\nb = max(wli)\nhli2 = []\nwli2 = []\nfor i in range(h):\n if hli[i] == a:\n hli2.append(i+1)\nfor i in range(w):\n if wli[i] == b:\n wli2.append(i+1)\nfor i in hli2:\n for j in wli2:\n if [i,j] not in li:\n print(a + b)\n exit()\nprint(a + b - 1)', 'n,x,t = map(int,input().split())\nif n % x == 0:\n print(n//x*t)\nelse:\n print((n//x+1)*t)'] | ['Runtime Error', 'Accepted'] | ['s746538433', 's035508826'] | [9012.0, 9152.0] | [28.0, 29.0] | [472, 93] |
p02576 | u213314609 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N = int(input())\nX = int(input())\nT = int(input())\ntemp = 0\nwhile (N > 0):\n N = N - X\n temp += 1\nprint(T*temp)', 'N, X, T = map(int, input().split())\ntemp = 0\nwhile (N > 0):\n N = N - X\n temp += 1\nprint(T*temp)'] | ['Runtime Error', 'Accepted'] | ['s973651637', 's896134318'] | [9092.0, 9120.0] | [24.0, 28.0] | [116, 101] |
p02576 | u215315599 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N, X, T = map(int,input().split())\nans = (N//X + N%X)*T\nprint(ans)', 'N, X, T = map(int,input))\nans = (N//X + N%X)*T\nprint(ans)', 'N, X, T = map(int,input().split())\nif N%X == 0:\n print( N//X *T )\nelse:\n print( ( N//X + 1)*T )'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s240040516', 's639565687', 's491294091'] | [9096.0, 8912.0, 9108.0] | [26.0, 26.0, 30.0] | [67, 58, 98] |
p02576 | u217571418 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nif n % x == 0:\n print((n//x)*t)\nelse:\n print((n//x)*(t+1))\n \n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nif n % x == 0:\n print((n//x)*t)\nelse:\n print((n//x)*t)\n \n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nprint(int(n*t/x))\n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nprint(int(n*t/x))\n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nif n % x == 0:\n print((n/x)*t)\nelse:\n print((n//x)*t)\n \n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nif n % x == 0:\n print((n//x)*t)\nelse:\n print(int((n//x)*t))\n \n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\n\nif n % x == 0:\n print((n//x)*t)\nelse:\n print((n//x)*t+1)\n \n', 'n, x, t = input().split()\nn = int(n)\nx = int(x)\nt = int(t)\nif n % x == 0:\n print((n//x)*t)\nelse:\n print((n//x+1)*t)\n \n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s140412969', 's332310016', 's423273429', 's661207706', 's782851198', 's915159793', 's977982851', 's644673401'] | [9104.0, 8988.0, 9156.0, 9096.0, 9160.0, 9168.0, 9108.0, 9148.0] | [27.0, 29.0, 29.0, 30.0, 29.0, 26.0, 26.0, 29.0] | [124, 120, 78, 78, 119, 125, 122, 121] |
p02576 | u218757284 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nprint(((n // t) + 1) * x)', 'n, x, t = map(int, input().split())\nif n % x != 0:\n\tprint(((n // x) + 1) * t)\nelse:\n \tprint((n // x) * t)\n'] | ['Wrong Answer', 'Accepted'] | ['s386933179', 's393769797'] | [9100.0, 9024.0] | [27.0, 29.0] | [61, 107] |
p02576 | u222643068 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n,x,t = input().split()\n\nn = n//x\nprint(n*t)', 'n, x, t = list(map(int, input().split()))\n\nn = n//x\nprint(n*t)', 'n, x, t = list(map(int, input().split()))\n\nn = math.ceil(n/x)\nprint(n*t)', 'import math\nn, x, t = list(map(int, input().split()))\n\nn = math.ceil(n/x)\nprint(n*t)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s016918619', 's084688055', 's517471239', 's459342200'] | [8936.0, 8888.0, 9100.0, 9084.0] | [25.0, 26.0, 21.0, 26.0] | [44, 62, 72, 84] |
p02576 | u224989615 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = int(input())\nprint((n//x+1)*t)', 'n = input()\ntotal = 0\nfor i in range(len(n)):\n total += int(n[i])\nif total % 9 == 0:\n print("Yes")\nelse:\n print("No")', 'n, x, t = int(input()).split(" ")\nprint((n//x+1)*t)', 'n = int(input())\nx = int(input())\nt = int(input())\nprint((n//x+1)*t)', 'n, x, t = map(int, input())\nprint((n//x+1)*t)', 'n, x, t = map(int, input().split())\nif n % x == 0:\n print(int(n/x*t))\nelse:\n print(int((n//x+1)*t))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s361353257', 's429983987', 's549108028', 's745336709', 's921000248', 's184451932'] | [9132.0, 9160.0, 9132.0, 9096.0, 9148.0, 9156.0] | [25.0, 22.0, 23.0, 22.0, 26.0, 29.0] | [40, 120, 51, 68, 45, 101] |
p02576 | u227424432 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['s = int(input().split())\nN,X,T =s[0],s[1],s[2]\nn = N//X\nif N % X != 0:\n n += 1\nout = n * T\nprint(out)\n', 'import numpy as np \n\ns_ = np.array(input().split())\ns = [int(i) for i in s_]\nN,X,T =s[0],s[1],s[2]\nn = N//X\nif N % X != 0:\n n += 1\nout = n * T\nprint(out)\n'] | ['Runtime Error', 'Accepted'] | ['s464557562', 's448216419'] | [9088.0, 27052.0] | [28.0, 115.0] | [103, 155] |
p02576 | u227688394 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['N,X,T = map(int, input().split())\nif N % X == 0:\n print((N/X)*T)\nelse:\n print(((N-N%X)/X+1)*T)', 'N,X,T = map(int, input().split())\nA = int((N/X)*T)\nB = int(((N-N%X)/X+1)*T)\nif N % X == 0:\n print(A)\nelse:\n print(B)'] | ['Wrong Answer', 'Accepted'] | ['s774871383', 's941556573'] | [9156.0, 9096.0] | [28.0, 30.0] | [100, 122] |
p02576 | u235079440 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['import math\nn, x, t = (int(i) for i in input().split())\nprint(math.floor(n/x) * t)', 'import math\nn, x, t = (int(i) for i in input().split())\nprint(math.ceil(n/x) * t)'] | ['Wrong Answer', 'Accepted'] | ['s558961379', 's466475212'] | [9152.0, 9156.0] | [33.0, 30.0] | [82, 81] |
p02576 | u235391838 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int,input().split())\ncount = 0\nwhile x<n:\n x = x*t\n count+=1\n \nprint(count*t)', 'n, x, t = map(int,input().split())\ncount = 1\nif x == n:\n print(t)\n \nelse:\n temp = x\n ans = t\n while x<n:\n x += temp\n ans+=t\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s453536281', 's824407540'] | [9116.0, 9172.0] | [31.0, 29.0] | [94, 167] |
p02576 | u235508145 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n = int(input())\na = list(map(int,input().split()))\n\ncount = 0\ntemp = a[0]\n\nfor i in range(n):\n if a[i] >= temp:\n temp = a[i]\n else:\n count += temp - a[i]\nprint(count)', 'N,T,X = map(int,input().split())\nif N % X == 0:\n print(T*N/X)\nelse:\n print(T*(N//X+1))', 'N,T,X = map(int,input().split())\nif N % X == 0:\n print(T*N//X)\nelse:\n print(T*(N//X+1))', 'N,T,X = map(int,input().split())\nif N % X == 0:\n print(T*N/X)\nelse:\n print(T*(N/X+1))\n', 'N,T,X = map(int,input().split())\nprint(T*(N/X + 1))', 'N,X,T = map(int,input().split())\nif N % X == 0:\n print(int(T*N/X))\nelse:\n print(T*(N//X+1))'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s196104913', 's335835556', 's739639013', 's953599503', 's982131763', 's107721340'] | [9040.0, 9076.0, 9092.0, 9140.0, 9004.0, 9032.0] | [27.0, 25.0, 26.0, 28.0, 26.0, 27.0] | [175, 88, 89, 88, 51, 93] |
p02576 | u237634011 | 2,000 | 1,048,576 | Takahashi loves takoyaki - a ball-shaped snack. With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make. How long does it take to make N takoyaki? | ['n, x, t = map(int, input().split())\nprint(t)', 'print(int((N+X-1)/X) * T)', 'N, X, T = map(int, input().split())\nprint((N / X) * T)', 'n, x, t = map(int, input().split())\nprint((n / x) * t)', 'n, x, t = map(int, input().split())\nprint(int((n+x-1)/x) * t)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s394214709', 's445215839', 's449375991', 's887315975', 's324890707'] | [9136.0, 9044.0, 9124.0, 9032.0, 9108.0] | [26.0, 28.0, 23.0, 28.0, 28.0] | [44, 25, 54, 54, 61] |
Subsets and Splits