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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02660 | u806779442 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import math\nfrom sys import exit\n\nn=int(input())\nprimes = {}\ni = 2\nans = 0\nsquare = math.floor(math.sqrt(n))\n\nif n == 1:\n print(0)\n exit()\n\nwhile True:\n if n % i == 0:\n if i not in primes.keys():\n primes[i] = 1\n else:\n primes[i] += 1\n n = n // i\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s003207864', 's097487206', 's356011630', 's861147365', 's561105578'] | [9240.0, 9240.0, 9524.0, 9240.0, 9516.0] | [25.0, 119.0, 104.0, 149.0, 107.0] | [650, 1040, 1062, 670, 679] |
p02660 | u810356688 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["import sys\ndef input(): return sys.stdin.readline().rstrip()\nclass UnionFind():\n def __init__(self, n):\n self.n=n\n self.parents=[-1]*n \n def find(self,x):\n \n if self.parents[x]<0:return x\n else:\n self.parents[x]=self.find(self.parents[x])\n retu... | ['Runtime Error', 'Accepted'] | ['s202330154', 's297433901'] | [9176.0, 20216.0] | [28.0, 318.0] | [1125, 1253] |
p02660 | u811000506 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["import math\n\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n... | ['Wrong Answer', 'Accepted'] | ['s106059345', 's979453051'] | [13380.0, 9484.0] | [969.0, 108.0] | [1805, 533] |
p02660 | u811817592 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['# -*- coding: utf-8 -*-\nimport collections\n# factrize\ndef factorize(target_number):\n factor_list = []\n while target_number % 2 == 0:\n factor_list.append(2)\n n //= 2\n factor = 3\n while factor * factor <= target_number:\n while target_number % factor == 0:\n target_n... | ['Runtime Error', 'Accepted'] | ['s235800863', 's733256144'] | [9448.0, 9472.0] | [97.0, 95.0] | [771, 783] |
p02660 | u814271993 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from collections import deque\ndef main():\n N,M,*AB=map(int,open(0).read().split())\n g=[[] for _ in range(N+1)]\n for a,b in zip(*[iter(AB)]*2):\n g[a].append(b)\n g[b].append(a)\n q=deque([1])\n s=[0]*(N+1)\n s[1]=1\n while q:\n u=q.popleft()\n for v in g[u]:\n ... | ['Runtime Error', 'Accepted'] | ['s930753013', 's364477001'] | [9472.0, 9176.0] | [29.0, 77.0] | [470, 424] |
p02660 | u815763296 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import math\nimport sys\nfrom collections import Counter\n\nN = int(input())\nNs = N\nNso = []\ni = 0\n\nif N == 1:\n print(0)\n sys.exit()\n\nNruto = math.sqrt(N)\nNruto = math.floor(Nruto)\n\n\n\nfor i in range(2,Nruto+1):\n while N%i==0:\n N=N//i\n Nso.append(i)\n Nso.append(N)\n i... | ['Wrong Answer', 'Accepted'] | ['s297837689', 's872920015'] | [9552.0, 9444.0] | [2206.0, 400.0] | [881, 539] |
p02660 | u821969418 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n = int(input())\n\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... | ['Wrong Answer', 'Accepted'] | ['s074174210', 's485702939'] | [9496.0, 9496.0] | [113.0, 113.0] | [659, 629] |
p02660 | u821989875 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import math\nn = int(input())\nl = int(math.sqrt(n))\nans = 0\n \ninsu = []\nsisu = []\ni = 2\nwhile i <= l:\n if n % i == 0:\n if i in insu:\n sisu[insu.index(i)] += 1\n else:\n insu.append(i)\n sisu.append(1)\n n //= i\n else:\n i += 1\nif n != 1:\n insu.append(n)\n sisu.append(1)\n ... | ['Wrong Answer', 'Accepted'] | ['s459934327', 's601208751'] | [9176.0, 9064.0] | [205.0, 198.0] | [489, 497] |
p02660 | u823290900 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import collections\nimport sys\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return... | ['Wrong Answer', 'Accepted'] | ['s443621343', 's023902518'] | [9480.0, 9472.0] | [89.0, 90.0] | [683, 685] |
p02660 | u823885866 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import sys\nimport math\nimport itertools\nimport collections\nimport heapq\nimport re\nimport numpy as np\n\nrr = lambda: sys.stdin.buffer.readline().rstrip()\nrs = lambda: sys.stdin.buffer.readline().split()\nri = lambda: int(sys.stdin.buffer.readline())\nrm = lambda: map(int, sys.stdin.buffer.readline().split())\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s022641738', 's320975239', 's573129636', 's962040665'] | [27100.0, 27176.0, 27112.0, 27112.0] | [372.0, 586.0, 585.0, 495.0] | [599, 610, 609, 639] |
p02660 | u829249049 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import sys\nN=int(input())\nans=0\nfor i in range(2,int(N**(1/2))+1):\n if N%i==0:\n break\n if i==int(N**(1/2)):\n print(1)\n sys.exit()\ni=1\nk=1\nwhile N % (2**i) == 0:\n ans+=1\n N=N//(2**i)\n i+=1\nwhile N % 2 == 0:\n N=N//2\nf=3\nwhile f*f <= N:\n if N % (f**k) == 0:\n ans+=1\n N=N//(f**k)... | ['Wrong Answer', 'Accepted'] | ['s742900323', 's110076049'] | [9488.0, 9188.0] | [598.0, 468.0] | [379, 186] |
p02660 | u830036378 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def main(n):\n\n prime = []\n if n < 2:\n prime.append((1,0))\n for p in range(2,int(n**0.5)):\n cnt = 0\n if p*p > n:\n break\n while n%p == 0:\n n //= p\n cnt += 1\n prime.append((p,cnt))\n if n > 1:\n prime.append((n,1))\n re... | ['Wrong Answer', 'Accepted'] | ['s823360964', 's725786306'] | [112360.0, 112232.0] | [341.0, 435.0] | [515, 491] |
p02660 | u832871520 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['# coding: utf-8\n\nimport sys\nimport math\nfrom collections import Counter\nimport itertools\nimport fractions\nfrom decimal import *\n#import numpy as np\n#from functools import reduce\n\n\ndef II(): return int(sys.stdin.readline())\ndef MI(): return map(int, sys.stdin.readline().split())\n\ndef LI(): return list(m... | ['Wrong Answer', 'Accepted'] | ['s197379319', 's517772366'] | [10704.0, 10712.0] | [120.0, 120.0] | [1790, 1671] |
p02660 | u833492079 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['#-------------------------------------------------------------------\nimport sys\ndef p(*_a):\n _s=" ".join(map(str,_a))\n #print(_s)\n sys.stderr.write(_s+"\\n")\n#-------------------------------------------------------------------\nimport math\n\ndef factorize(n):\n ret, a = [], n\n for i in range(2, int(n**0.... | ['Wrong Answer', 'Accepted'] | ['s412846315', 's486994981'] | [52540.0, 9472.0] | [2207.0, 110.0] | [917, 642] |
p02660 | u835283937 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import math\nfrom collections import defaultdict\n\ndef main():\n N = int(input())\n fac = defaultdict(int)\n\n for i in range(2, int(math.sqrt(N))+1):\n while N % i == 0:\n is_p = False\n fac[i] += 1\n N = N // i\n\n if i == int(math.sqrt(N)) and N != 1:\n ... | ['Wrong Answer', 'Accepted'] | ['s886659272', 's135570999'] | [9488.0, 9500.0] | [297.0, 127.0] | [627, 627] |
p02660 | u838644735 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["def append_factor(f, p):\n if p not in f:\n f[p] = 0\n f[p] += 1\n\ndef factors(n):\n l = int(math.sqrt(n)) + 1\n ret = {}\n while n % 2 == 0:\n append_factor(ret, 2)\n n //= 2\n while n % 3 == 0:\n append_factor(ret, 3)\n n //= 3\n i = 6\n while i*i <= n:\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s571740039', 's861067850', 's612809246'] | [9184.0, 9188.0, 9140.0] | [25.0, 82.0, 112.0] | [968, 983, 881] |
p02660 | u844789719 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['N = int(input())\nans = 0\nfor i in range(2, int(N**0.5 + 1)):\n f = 1\n while True:\n if N % i**f:\n f -= 1\n break\n f += 1\n N //= i**f\n ans += f\nprint(ans)\n', 'import collections\nN = int(input())\n\n\ndef prime_factorize(n):\n a = collections.defaultdict(... | ['Wrong Answer', 'Accepted'] | ['s029246345', 's796228166'] | [9348.0, 9364.0] | [2206.0, 98.0] | [203, 488] |
p02660 | u844895214 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from sys import stdin\nimport math\ndef I(): return int(stdin.readline().rstrip())\n\nn = I()\nm = n\nl = []\nfor i in range(2,int(math.sqrt(n))+1):\n if n==1 or n<i:\n break\n if n%i==0:\n c = 0\n while n%i==0:\n n//=i\n c += 1\n for j in range(1,c+1):\n ... | ['Wrong Answer', 'Accepted'] | ['s709915296', 's482316642'] | [9228.0, 9272.0] | [238.0, 248.0] | [510, 501] |
p02660 | u845152373 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from collections import Counter\nN = int(input())\nfactors = []\ni = 2\nwhile N > 1:\n if N < i * i:\n factors.append(N)\n break\n while N % i == 0:\n factors.append(i)\n i += 1\n\nans = 0\nfor count in Counter(factors).values():\n i = 1\n while count >= i:\n count -= i\n i += 1\n ans += 1\npri... | ['Time Limit Exceeded', 'Accepted'] | ['s172668661', 's608410029'] | [187028.0, 9428.0] | [2210.0, 266.0] | [307, 319] |
p02660 | u845573105 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from math import floor, sqrt\n\n\ndef func(x):\n return floor((sqrt(1 + 8 * x) - 1) / 2)\n\n\nN = int(input())\nlimit = floor(sqrt(N))\n\nprimes = [2]\n\ncount = 0\nflag = True\np = 2\nwhile 1:\n print(p,N)\n isprime = True\n if N == 1:\n break\n if p > sqrt(N):\n count += 1\n brea... | ['Wrong Answer', 'Accepted'] | ['s295919937', 's482690919'] | [12728.0, 9208.0] | [550.0, 342.0] | [700, 490] |
p02660 | u847923740 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['N=int(input())\nNk=N\nrootN=int(N**0.5)\np=[1]*(rootN+1)\np[0]=0\np[1]=0\nfor i in range(2,rootN+1):\n for j in range(i*2,rootN,i):\n p[j]=0\nps=[i for i in range(1,rootN) if p[i]==1]\npq=[]\nfor i in ps:\n c=0\n for j in range(1,41):\n if (N/(i**j)).is_integer():\n c+=1\n ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s354992942', 's844444999', 's860377367'] | [20348.0, 9088.0, 9472.0] | [1387.0, 21.0, 112.0] | [567, 24, 475] |
p02660 | u849756457 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['\ndef q4():\n N = int(input())\n arr = prime_factorize(N)\n if not arr:\n print(0)\n return\n\n ans_count = 0\n count = 1\n\n min_val = min(arr)\n while arr:\n if arr.count(min_val) < count:\n arr = list(filter(lambda a: a != min_val, arr))\n count = 1\n... | ['Runtime Error', 'Accepted'] | ['s361925699', 's513585483'] | [9200.0, 9236.0] | [24.0, 91.0] | [496, 771] |
p02660 | u852210959 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['# -*- coding: utf-8 -*-\n\n\ndef input_int():\n return int(input())\n\n\n\ndef int1(x):\n return int(x) - 1\n\n\n\ndef input_to_int_map():\n return map(int, input().split())\n\n\n\ndef input_to_int_tuple():\n return tuple(map(int, input().split()))\n\n\n\ndef input_to_int_tuple_minus1():\n return tuple... | ['Wrong Answer', 'Accepted'] | ['s803975939', 's156952844'] | [9376.0, 9532.0] | [2206.0, 110.0] | [1535, 1216] |
p02660 | u867200256 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["import math\nimport decimal\n\n\ndef main():\n\n N = int(input())\n ans = 0\n pn = [2]\n A = int(math.ceil(N**0.5)+1)\n\n if N >= 3:\n for L in range(3, A):\n if L % 2 == 0:\n continue\n chk = True\n for L2 in pn:\n if L % L2 == 0:\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s093246139', 's276076038', 's463427434', 's847348338', 's214831519'] | [10164.0, 128932.0, 38664.0, 10188.0, 128888.0] | [177.0, 929.0, 2206.0, 169.0, 849.0] | [823, 986, 691, 805, 994] |
p02660 | u871934301 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import itertools\nN=int(input())\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s081866469', 's666590381', 's336146255'] | [9268.0, 9264.0, 9472.0] | [152.0, 161.0, 171.0] | [831, 809, 854] |
p02660 | u875763012 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n = int(input())\n\n\ndef solve(n):\n res = 0\n for d in range(2, n):\n if d * d > n:\n break\n\n degree = 0\n while n % d == 0:\n n /= d\n degree += 1\n\n i = 1\n while degree >= i:\n degree -= i\n i += 1\n res... | ['Wrong Answer', 'Accepted'] | ['s873217995', 's432677373'] | [9276.0, 9256.0] | [172.0, 172.0] | [357, 371] |
p02660 | u880400515 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n\n if temp != 1:\n arr.append([temp, 1])\... | ['Wrong Answer', 'Accepted'] | ['s931054829', 's501598447'] | [9504.0, 9508.0] | [111.0, 111.0] | [745, 735] |
p02660 | u893063840 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def sieve(x):\n """\n Sieve of Eratosthenes\n :param x: max value\n :return: list of bool\n """\n\n is_prime = [True] * (x + 1)\n is_prime[0] = is_prime[1] = False\n\n for i in range(2, x + 1):\n if is_prime[i]:\n for j in range(i * 2, x + 1, i):\n is_prime[j] ... | ['Time Limit Exceeded', 'Accepted'] | ['s559646412', 's022816040'] | [87280.0, 31248.0] | [2208.0, 215.0] | [819, 714] |
p02660 | u901466816 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr=... | ['Wrong Answer', 'Accepted'] | ['s153035936', 's732996938'] | [9504.0, 9504.0] | [111.0, 111.0] | [592, 644] |
p02660 | u910632349 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import bisect\nn=int(input())\ndef factorize(n):\n a=[]\n while n%2==0:\n a.append(2)\n n//=2\n f=3\n while f*f<=n:\n if n%f==0:\n a.append(f)\n n//=f\n else:\n f+=2\n if n!=1:\n a.append(n)\n return a\ndef ra(a):\n ll,l=[],1\n ... | ['Wrong Answer', 'Accepted'] | ['s713040772', 's611474087'] | [9400.0, 10088.0] | [98.0, 101.0] | [588, 656] |
p02660 | u916242112 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['N = int(input())\na = []\ncount =0\ncount2 = 0\ncount3 = 0\nprint(N)\nX=int(N**0.5)\nfor i in range(X+1):\n\tif i ==0 or i == 1:\n\t\tpass\n\telif N % i == 0:\n\n\t\twhile N % i==0:\n\t\t\tN /= i\n\t\t\tcount2 += 1\n\t\tj =1\n\t\tcount3 = 0\n\t\twhile count2 - j >=0:\n\t\t\tcount2 -= j\n\t\t\tj = j+1\n\t\t\tcount3 +=... | ['Wrong Answer', 'Accepted'] | ['s435287624', 's062802600'] | [9300.0, 9460.0] | [195.0, 190.0] | [366, 346] |
p02660 | u919235786 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def soinsu(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nn=int(input())\na=soinsu(n)\nprint(a)... | ['Wrong Answer', 'Accepted'] | ['s156447808', 's712381844'] | [246052.0, 9144.0] | [2275.0, 229.0] | [500, 283] |
p02660 | u923662841 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import collections\nN = int(input())\nc = collections.Counter(prime_factorize(N))\n\nans = 0\nfor j in c:\n for i in range(1,c[j]+1):\n if c[j] == 1:\n ans += 1\n elif i*(i+1)<= 2*c[j] < (i+1)*(i+2):\n ans += i\n\nprint(ans)', 'import collections\nN = int(input())\n\nc = collect... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s501288649', 's744493600', 's219168968'] | [9472.0, 9456.0, 9472.0] | [28.0, 22.0, 96.0] | [251, 252, 528] |
p02660 | u928254435 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["#!/usr/bin/env python3\nimport sys\nfrom random import randint\nfrom math import gcd\n\n\ndef solve(N: int):\n \n \n \n \n n = N\n ds = make_divisors(n)\n print(ds)\n used = []\n while(True):\n count = len(used)\n for d in ds:\n if d in used:\n contin... | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s260328620', 's698963415', 's862949173'] | [9388.0, 9480.0, 9500.0] | [2206.0, 2205.0, 104.0] | [2089, 1987, 1139] |
p02660 | u932868243 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import collections\nn=int(input())\nif n==1:\n print(0)\n exit()\nb=int(n**0.5)\ni=2\nl=[]\nwhile i<=b+1:\n if n==1:\n break\n if n%i==0:\n l.append(i)\n n=n//i\n else:\n i+=1\nl.append(n)\nc=collections.Counter(l)\nv=list(c.values())\n\nans=0\nfor vv in v:\n wa=1\n s=1\n while True:\n if vv<wa... | ['Wrong Answer', 'Accepted'] | ['s956291863', 's428722250'] | [9728.0, 9608.0] | [237.0, 194.0] | [349, 336] |
p02660 | u939026953 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int((n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append(i ** cnt)\n\n if temp != 1:\n arr.append(temp)\n\n... | ['Wrong Answer', 'Accepted'] | ['s391997869', 's063982660'] | [9332.0, 9448.0] | [108.0, 110.0] | [536, 538] |
p02660 | u941438707 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def p(n):\n a=[]\n while n%2==0:\n a.append(2)\n n//=2\n f=3\n while f*f<=n:\n if n%f==0:\n a.append(f)\n n//=f\n else:\n f+=2\n if n!=1:\n a.append(n)\n return a\nn=int(input())\na=p(n)\nd={}\nfor i in a:\n d[i]=d.get(i,0)+1\nb=li... | ['Wrong Answer', 'Accepted'] | ['s310281981', 's565692577'] | [9232.0, 9128.0] | [93.0, 292.0] | [444, 181] |
p02660 | u946648678 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import math\n\n\ndef prime_factors(n):\n count = {2: 0}\n\n while n % 2 == 0:\n n = n / 2\n count[2] += 1\n\n for i in range(3, int(math.sqrt(n))+1, 2):\n count[i] = 0\n while n % i == 0:\n n = n / i\n count[i] += 1\n\n if n > 2:\n if int(n) in coun... | ['Wrong Answer', 'Accepted'] | ['s739233588', 's810000570'] | [55900.0, 50900.0] | [208.0, 144.0] | [615, 625] |
p02660 | u951480280 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n=int(input())\n\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, ... | ['Wrong Answer', 'Accepted'] | ['s712683920', 's032443952'] | [9512.0, 9536.0] | [109.0, 111.0] | [634, 635] |
p02660 | u958506960 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import sympy\nsympy.divisors(10**9)\n\nnum = int(input())\n\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n ... | ['Runtime Error', 'Accepted'] | ['s838399041', 's995602392'] | [9144.0, 9396.0] | [23.0, 180.0] | [488, 409] |
p02660 | u958820283 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n=int(input())\na={}\ntemp=n\nfor i in range(2,int(n**0.5)+1):\n if temp % i ==0:\n count=0\n while temp % (i**(count+1)) ==0:\n count+=1\n temp= temp/(i**count)\n a[i]=count\n\nprint(a)\nsum=0\nfor i in a:\n jisu= a[i]\n temp= int((2*jisu)**0.5)-1\n if temp*(temp+1)... | ['Wrong Answer', 'Accepted'] | ['s470240606', 's956910164'] | [9504.0, 9468.0] | [149.0, 145.0] | [469, 351] |
p02660 | u961683878 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['#! /usr/bin/env python3\n\nimport sys\nfrom collections import deque, Counter\nint1 = lambda x: int(x) - 1\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(500000)\n\nN = int(readline())\n\ndef prime_factorize(n):\n a = []\n while... | ['Time Limit Exceeded', 'Accepted'] | ['s715957298', 's041786906'] | [9464.0, 9536.0] | [2206.0, 93.0] | [1098, 788] |
p02660 | u962330718 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['N=int(input())\n\ndef factorization(n):\n arr=[]\n temp=n\n for i in range(2,int(n**(1/2))+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\... | ['Wrong Answer', 'Accepted'] | ['s074356688', 's758236623'] | [9488.0, 9488.0] | [105.0, 231.0] | [520, 813] |
p02660 | u962718741 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ["def resolve():\n li = input().split()\n A = int(li[0])\n B = int(li[1].replace('.',''))\n ans = int(A*B/100)\n print(ans)\nresolve()", 'def resolve():\n N = int(input())\n def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if t... | ['Runtime Error', 'Accepted'] | ['s108687315', 's554766955'] | [9172.0, 9508.0] | [24.0, 109.0] | [141, 906] |
p02660 | u968404618 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['def main():\n ## IMPORT MODULE\n #import sys\n from collections import Counter\n\n \n #input=lambda :sys.stdin.readline().rstrip()\n\n #f_inf=float("inf")\n #MOD=10**9+7\n \n if \'get_ipython\' in globals(): \n ## SAMPLE INPUT\n n = 64\n\n else:\n ##INPUT \n n = input()\n #a, b = map(int, inp... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s706838856', 's891749710', 's082610859'] | [9308.0, 9348.0, 9568.0] | [26.0, 25.0, 117.0] | [734, 734, 414] |
p02660 | u970308980 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['import sys\nfrom collections import defaultdict\n\nsys.setrecursionlimit(10 ** 7)\n# ----------\n\nINF = float("inf")\nMOD = 10 ** 9 + 7\n# ----------\n\ndef get_count(x):\n if x == 2:\n return 1\n s = set()\n i = 1\n while x:\n if x - i in s:\n break\uf8ff\n s.add(i)\n ... | ['Runtime Error', 'Accepted'] | ['s926008924', 's516144479'] | [8976.0, 9656.0] | [25.0, 145.0] | [619, 411] |
p02660 | u971124021 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from itertools import groupby\nn =int(input())\n\ndef prime_decomposition(n):\n i = 2\n table = []\n while i * i <= n:\n while n%i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n return table\n\nfrom itertools import groupby\nans = 0\np = prime_decomposition(n)\nfo... | ['Runtime Error', 'Accepted'] | ['s766033556', 's638589412'] | [9168.0, 9188.0] | [2206.0, 164.0] | [442, 444] |
p02660 | u975116284 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n = int(input())\nm = n\n\nexp = []\ndiv = []\nfor i in range(2, int(n**(1/2))+2):\n cnt = 0\n if n%i == 0:\n div.append(n//i)\n while n%i == 0:\n cnt += 1\n n //= i\n exp.append(cnt)\n\nfor i in div:\n cnt = 0\n while n%i == 0:\n cnt += 1\n n //= i... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s406189953', 's801218556', 's971097938'] | [9508.0, 9516.0, 12948.0] | [2205.0, 2205.0, 294.0] | [454, 525, 336] |
p02660 | u981309686 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['ans=0\nn=int(input())\nfor i in range(2,int(pow(n,0.5))+1):\n if n%i==0:\n ans+=1\n while n%i==0:\n n=n//i\nif n!=1:\n ans+=1\nprint (ans)', 'def this (k):\n a=int(pow(1+8*k,0.5))\n return (a-1)//2\nfrom collections import Counter\nc=Counter([])\nn=int(input())\nfor i in range(2,int(pow(n,0.5))+1):\n ... | ['Wrong Answer', 'Accepted'] | ['s113492723', 's731235696'] | [9424.0, 9568.0] | [145.0, 155.0] | [142, 314] |
p02660 | u982591663 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['N = int(input())\n\nans = 0\n\n# if N % 2 == 0:\n\n# while N % 2**i == 0:\n# N //= 2**i\n# ans += 1\n\n\n# if N % 3 == 0:\n\n# while N % 3**i == 0:\n# N //= 3**i\n# ans += 1\n\n\n# if N % 5 == 0:\n\n# while N % 5**i == 0:\n# N //= 5**i\n# ans += 1\n\n\n# if ... | ['Wrong Answer', 'Accepted'] | ['s842135706', 's559061350'] | [9212.0, 9064.0] | [88.0, 92.0] | [1290, 922] |
p02660 | u987549444 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['from sys import stdin\nimport math\n\na=int(stdin.readline())\nPP=0\nK=0\n\nif a==1:\n print(0)\n K=1\nL=list()\n\nfor b in range(2,int(math.floor(math.sqrt(a)))):\n count=0\n if a%b==0:\n while a%b==0:\n count+=1\n a=a/b\n if count>0:\n L.append(count)\n\nif len(L)==... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s283664460', 's814241754', 's001587509'] | [9312.0, 9312.0, 9312.0] | [200.0, 184.0, 183.0] | [466, 468, 490] |
p02660 | u995163736 | 2,000 | 1,048,576 | Given is a positive integer N. Consider repeatedly applying the operation below on N: * First, choose a positive integer z satisfying all of the conditions below: * z can be represented as z=p^e, where p is a prime number and e is a positive integer; * z divides N; * z is different from all integers chos... | ['n = int(input())\n\nfact={}\ni = 2\nwhile n != 1:\n if n % i == 0:\n n = n/i\n if i in fact:\n fact[i] += 1\n else:\n fact[i] = 1\n else:\n i += 1\n if i > (n**(1/2)+1):\n fact[n] =1\n break\n\nprint(fact)\nif fact == {}:\n print(0)\nelse:\n ... | ['Wrong Answer', 'Accepted'] | ['s932370178', 's266409140'] | [9408.0, 9432.0] | [371.0, 378.0] | [474, 528] |
p02661 | u000085263 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nX=[]\nX1=[]\nfor i in range(n):\n a,b = map(int, input().split())\n X.append(a)\n X1.append(b)\nX.sort()\nX1.sort(reverse=True)\nif n % 2: \n print(X1[n//2] - X[n//2] + 1)\nelse: \n print((X1[n//2]+X1[n//2-1]) - (X[n//2]+X1[n//2-1]) + 1)', 'inp=int(input())\nmylist=[]\nfor i in range(... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s072364340', 's125932410', 's680995070', 's746300610', 's354519713'] | [25228.0, 26336.0, 25548.0, 25480.0, 28764.0] | [452.0, 469.0, 461.0, 453.0, 485.0] | [258, 448, 247, 335, 268] |
p02661 | u019685451 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from statistics import median\n\nN = int(input())\nA, B = [], []\nfor _ in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\n\nmn = median(A)\nmx = median(B)\n\nif N % 2 == 1:\n print(int(mx - mn + 1)) # mn, mn + 1, mn + 2, ..., mx\nelse:\n print(int(mx - mn * 2 + 1)) ... | ['Wrong Answer', 'Accepted'] | ['s850575701', 's969238249'] | [28884.0, 28976.0] | [470.0, 478.0] | [334, 336] |
p02661 | u023229441 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n=int(input())\nimport bisect as bi\nA=[] ; B=[]\nfor i in range(n):\n a,b=map(int,input().split())\n A.append(a)\n B.append(b)\n\nA.sort() ; B.sort()\nif n%2==1:\n a=A[(n-1)//2] ; b=B[(n-1)//2]\n print(a,b)\n print(b-a+1)\nelse:\n a=(A[n//2-1]+A[n//2])/2 ; b=(B[n//2-1]+B[n//2])/2\n print(a,b)... | ['Wrong Answer', 'Accepted'] | ['s657222748', 's092793215'] | [25372.0, 25424.0] | [463.0, 449.0] | [331, 308] |
p02661 | u047197186 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\n\nmins = [0] * n\nmaxs = [0] * n\nfor i in range(n):\n a, b = map(int, input().split())\n mins[i] = a\n maxs[i] = b\n\nmins = sorted(mins)\nmaxs = sorted(maxs)\n\nif n % 2 != 0:\n print(maxs[((n+1)//2) - 1] - mins[((n+1)//2) - 1] + 1)\nelse:\n print(((maxs[n//2] - mins[(n//2) - 1] + 1... | ['Runtime Error', 'Accepted'] | ['s854286334', 's869287550'] | [9072.0, 26936.0] | [23.0, 464.0] | [309, 362] |
p02661 | u054514819 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\nleft = []\nright = []\nfor _ in range(N):\n l, r = map(int, input().split())\n left.append(l)\n right.append(r)\nleft.sort()\nright.sort()\nif N%2==0:\n for i, (l, r) in enumerate(zip(left, right)):\n if i==N//2:\n L = (l+r)\n if i==N//2+1:\n R = (l+r)... | ['Wrong Answer', 'Accepted'] | ['s935730871', 's274225305'] | [25488.0, 25412.0] | [549.0, 543.0] | [437, 469] |
p02661 | u060793972 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['a,b=input().split()\nprint(int(a)*int(float(b)*100)//100)', 'n=int(input())\nal=list()\nbl=list()\nfor i in range(n):\n a,b=map(int,input().split())\n al.append(a)\n bl.append(b)\nal.sort()\nbl.sort()\nl=n//2\nif n%2==0:\n print(bl[l-1]+bl[l]-al[l-1]-al[l]+1)\nelse:\n print(bl[l]-al[l]+1)'] | ['Runtime Error', 'Accepted'] | ['s530089803', 's899247304'] | [9104.0, 25372.0] | [24.0, 469.0] | [56, 230] |
p02661 | u067986021 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ["import statistics\nimport math\n\nN = int(input())\nA_B = [[int(i) for i in input().split(' ')] for n in range(N)]\n\nt = list(zip(*A_B))\n\nA_sta = statistics.median(t[0])\nB_sta = statistics.median(t[1])\n\nif N % 2 == 0:\n count = 2 * (B_sta - A_sta + 1)\nelse:\n count = B_sta - A_sta + 1\n\nprint(count)", "... | ['Wrong Answer', 'Accepted'] | ['s926801426', 's417391869'] | [59848.0, 59816.0] | [574.0, 624.0] | [298, 303] |
p02661 | u093861603 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N=int(input())\nA=[]\nB=[]\nfor i in range(N):\n a,b=map(int,input().split())\n A.append(a)\n B.append(b)\n \nA.sort()\nB.sort()\n\n\nmini=A[(N-1)//2]\nmaxi=B[(N-1)//2]\nif N//2==0:\n print((maxi-mini)*2+1)\nelse:\n print(maxi-mini+1)', 'N=int(input())\nA=[]\nB=[]\nfor i in range(N):\n a,b=map(int,input().spli... | ['Wrong Answer', 'Accepted'] | ['s292085939', 's803570028'] | [25532.0, 25556.0] | [466.0, 462.0] | [223, 301] |
p02661 | u113971909 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\nA = [None]*N\nB = [None]*N\n\nfor i in range(N):\n a,b = map(int, input().split())\n A[i]=a\n B[i]=b\n A.sort()\n B.sort()\n\n if N%2==0:\n x=A[N//2-1]\n y=B[N//2]\n else:\n x=A[N//2]\n y=B[N//2]\n print(y-x+1)\n', "#!/usr/bin python3\n# -*- coding: utf-8 -*-\n\ndef mai... | ['Runtime Error', 'Accepted'] | ['s462904619', 's741393752'] | [9016.0, 25384.0] | [23.0, 432.0] | [242, 429] |
p02661 | u114920558 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\nA = list()\nB = list()\nfor i in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\n \nA.sort()\nB.sort()\n\nif(N%2==1):\n x = A[(N-1)//2]\n y = B[(N-1)//2]\n print(y-x+1)\nelse:\n x = A[(N//2)+1] + A[N//2]\n y = B[(N//2)+1] + B[N//2]\n print(y-x+1)', 'N = int(input(... | ['Runtime Error', 'Accepted'] | ['s214069589', 's393199764'] | [25288.0, 25320.0] | [453.0, 467.0] | [282, 282] |
p02661 | u151785909 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nN = 10**9\nx = [0]*(N+1)\nx1= [0]*N\nx2= [0]*N\nfor i in range(n):\n a , b = map(int, input().split())\n x[a-1]+=1\n x[b]-=1\n\nfor i in range(1,N):\n x[i]=x[i]+x[i-1]\n\nfor i in range(1,N):\n x1[i]=x1[i]+x1[i-1]\n\nx.reverse()\nfor i in range(1,N):\n s2[i]=x2[i]+x2[i-1]\n\nans =0... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s067020550', 's570728232', 's929653117'] | [9252.0, 9260.0, 25436.0] | [24.0, 24.0, 476.0] | [498, 498, 311] |
p02661 | u169696482 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nmin = []\nmax = []\nfor i in range(n):\n a, b = map(int, input().split())\n min.append(a)\n max.append(b)\nmin.sort()\nmax.sort()\nif n%2 == 0:\n print((max[n//2] + max[n//2 - 1]) -(min[n//2] + min[n//2 - 1])+ 1)\nelse:\n print(max[n//2]-min[n//2]+1)\nprint(min)', 'n = int(input())\nmin = []\nm... | ['Wrong Answer', 'Accepted'] | ['s024087193', 's355447654'] | [29772.0, 25388.0] | [507.0, 489.0] | [272, 261] |
p02661 | u170839742 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import math\n\n\ndef median(array):\n if N % 2:\n return array[N // 2]\n else:\n return sum(array[N // 2 - 1: N // 2 + 1]) / 2\n\n\nN = int(input())\nA, B = [], []\nfor _ in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nx = median(A)\ny = median(B)\nif N % 2:\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s154494382', 's241579252', 's561133809', 's634324579'] | [24832.0, 9068.0, 24972.0, 25424.0] | [382.0, 25.0, 380.0, 472.0] | [389, 391, 386, 305] |
p02661 | u193927973 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['\nN=int(input())\n\nA=[]\nB=[]\nfor i in range(N):\n a, b=map(int, input().split())\n A.append(a)\n B.append(b)\n\nA.sort()\nB.sort()\n\nif N%2==0:\n sca=scb=N//2-1\n lca=lcb=N//2\n x=A[lca]+A[sca]\n y=B[lcb]+B[lcb]\n print(x-y+1)\n \n \nelse:\n ca=cb=N//2\n ans=B[cb]-A[ca]+1\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s562671706', 's615996320', 's679676269'] | [25524.0, 25412.0, 25544.0] | [464.0, 478.0, 476.0] | [309, 309, 309] |
p02661 | u194297606 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['# E\nN = int(input())\nAandB = [list(map(int, input().split())) for _ in range(N)]\nA = [AandB[i][0] for i in range(N)]\nB = [AandB[i][1] for i in range(N)]\n\nA_sorted = sorted(A)\nB_sorted = sorted(B)\n\nif N % 2 != 0:\n n = N // 2\n a = A_sorted[n]\n b = B_sorted[-(n+1)]\n print(b-a+1)\nelse:\n n = ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s282078252', 's475926206', 's955681923'] | [52492.0, 52496.0, 52288.0] | [546.0, 527.0, 539.0] | [352, 471, 471] |
p02661 | u202634017 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nla = []\nlb = []\n\nfor i in range(n):\n a, b = map(int, input().split())\n la.append(a)\n lb.append(b)\n\nla.sort()\nlb.sort()\n\nif n % 2 == 1:\n lr = (n + 1) // 2\n ma = la[lr-1]\n mb = lb[lr-1]\n print(mb-ma+1)\nelse:\n l = n // 2\n r = n // 2 + 1\n ma = (la[l-1] + ... | ['Wrong Answer', 'Accepted'] | ['s948332752', 's062495265'] | [25372.0, 25476.0] | [471.0, 464.0] | [371, 376] |
p02661 | u210987097 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\na,b = [], []\nfor _ in range(n):\n i = input().split()\n a.append(int(i[0]))\n b.append(int(i[1]))\na.sort()\nb.sort()\nif n%2:\n l = a[n//2]\n h = b[n//2]\n print(l-h+1)\nelse :\n l = (a[n//2-1]+a[n//2]) / 2\n h = (b[n//2-1]+b[n//2]) / 2\n print(int((l-h)*2) +1)\n ', 'n = int(inp... | ['Wrong Answer', 'Accepted'] | ['s327619201', 's461396915'] | [25412.0, 25476.0] | [446.0, 444.0] | [287, 287] |
p02661 | u212786022 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\na = [0]*N\nb = [0]*N\nfor i in range(N):\n a[i],b[i] = map(int, input().split())\nimport statistics\nX = statistics.median(a)\nY = statistics.median(b)\nprint(Y-X+1)', 'N = int(input())\na = [0]*N\nb = [0]*N\nfor i in range(N):\n a[i],b[i] = map(int, input().split())\nimport statistics\nX = st... | ['Wrong Answer', 'Accepted'] | ['s026479291', 's390071058'] | [28824.0, 28872.0] | [464.0, 460.0] | [178, 227] |
p02661 | u215115622 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nlister = []\nfor i in range(n):\n lister.append([int(i) for i in input().split()])\n \nif n % 2 == 1:\n lister.sort(key=lambda x:x[0])\n miner = lister[n//2][0]\n lister.sort(key=lambda x:x[1])\n maxer = lister[n//2][1]\n print(maxer- miner + 1)\nelse:\n lister.sort(key=lambda x... | ['Wrong Answer', 'Accepted'] | ['s029294762', 's836534207'] | [45460.0, 45464.0] | [657.0, 733.0] | [442, 500] |
p02661 | u222668979 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from statistics import median\n\nn = int(input())\nab = [list(map(int, input().split())) for _ in range(n)]\n\na = [ab[i][0] for i in range(n)]\nb = [ab[i][1] for i in range(n)]\n\nif n % 2 == 0:\n ma, mb = median(a), median(b)\n print(ma,mb)\n print(int(mb - ma) * 2 + 1)\nif n % 2 == 1:\n ma, mb = median... | ['Wrong Answer', 'Accepted'] | ['s924107351', 's884741213'] | [52552.0, 52552.0] | [531.0, 561.0] | [350, 297] |
p02661 | u239528020 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['#!/usr/bin/env python3\nimport statistics.median()\n\nn = int(input())\n\na = []\nb = []\nfor _ in range(n):\n a, b = list(map(int, input().split()))\n a.append(a)\n b.append(b)\n\na_median = statistics.median(a)\nb_median = statistics.median(b)\n\nif n % 2 == 0:\n print(b_median-a_median+1)\nelse:\n p... | ['Runtime Error', 'Accepted'] | ['s053516493', 's964567301'] | [9008.0, 28932.0] | [22.0, 504.0] | [331, 397] |
p02661 | u265506056 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N=int(input())\nA=[]\nB=[]\nfor i in range(N):\n a,b=map(int,input().split())\n A.append(a)\n B.append(b)\nA.sort()\nB.sort()\nif N%2!=0:\n n=(N+1)//2\n ans=B[n-1]-A[n-1]+1\nelse:\n n=N//2\n ans1=(A[n-1]+A[n])/2\n ans2=(B[n-1]+B[n])/2\n ans=(ans2-ans1)*2+1\nprint(ans)', 'N=int(input())\nA=[... | ['Wrong Answer', 'Accepted'] | ['s030029964', 's160673689'] | [25412.0, 25560.0] | [474.0, 473.0] | [278, 283] |
p02661 | u266014018 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ["def main():\n import sys\n n = int(input())\n A,B = [],[]\n for i in range(n):\n a,b= map(int, input().split())\n A.append(a)\n B.append(b)\n A = sorted(A)\n B = sorted(B)\n if n%2 == 0:\n ma = (A[n//2]+A[n//2-1])/2\n mb = (B[n//2]+B[n//2-1])/2\n ans = 2*... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s359683781', 's629180006', 's962069652'] | [27136.0, 27056.0, 27132.0] | [435.0, 442.0, 447.0] | [492, 492, 493] |
p02661 | u278057806 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from sys import stdin\ninput = stdin.readline\n\nN = int(input())\nab = [list(map(int, input().split())) for _ in range(N)]\n\nab.sort()\n\nran = []\n\nfor a, b in ab:\n ran.append(b - a + 1)\n\nran.sort()\n\nif N % 2 == 0:\n a1, b1 = ab[N // 2 - 1]\n a2, b2 = ab[N // 2]\n xa = (a2 + a1) / 2\n xb = (b2... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s022125182', 's085485700', 's124622845', 's590549883', 's784662502', 's629221929'] | [54016.0, 53972.0, 49176.0, 54016.0, 53940.0, 49268.0] | [757.0, 730.0, 351.0, 797.0, 734.0, 353.0] | [415, 392, 468, 410, 392, 449] |
p02661 | u279493135 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ["import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd\nfrom itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement\nfrom operator import itemgetter, mul\nfrom copy import deepcopy... | ['Runtime Error', 'Accepted'] | ['s648084770', 's355913116'] | [114544.0, 114536.0] | [701.0, 764.0] | [924, 934] |
p02661 | u290886932 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\nL = list()\nAs, Bs= list(),list()\nfor i in range(N):\n A,B = map(int,input().split())\n L.append([A,B])\n As.append(A)\n Bs.append(B)\n\nAs.sort()\nBs.sort()\nif N % 2 == 0:\n mins = (As[N//2] + As[N//2-1]) / 2.0\n maxs = (Bs[N//2] + Bs[N//2-1]) / 2.0\nelse:\n mins,maxs = As[N/... | ['Wrong Answer', 'Accepted'] | ['s841791932', 's800404326'] | [43060.0, 42688.0] | [566.0, 553.0] | [342, 379] |
p02661 | u311379832 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\nab = [list(map(int, input().split())) for _ in range(N)]\n\n\nif N % 2 == 0:\n print(1)\nelse:\n print(ab[N // 2][1] - ab[N // 2][0] + 1)', 'N = int(input())\nab = [list(map(int, input().split())) for _ in range(N)]\n\nl = sorted(ab, key=lambda x: x[0])\nr = sorted(ab, key=lambda x: x[1])\n\ni... | ['Wrong Answer', 'Accepted'] | ['s147441711', 's499844916'] | [45300.0, 51784.0] | [417.0, 631.0] | [154, 381] |
p02661 | u343021464 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import numpy as np\nN = int(input())\nA = np.zeros(N)\nB = np.zeros(N)\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\nam = np.median(A)\nbm = np.median(B)\n\nif n % 2 == 0:\n print(int((bm - am) * 2 + 1))\nelse:\n print(int((bm - am) + 1))', 'n = int(input())\nA = []\nB = []\nfor _ in range(... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s045019613', 's257278807', 's363931601', 's701240452', 's848037399'] | [31364.0, 9212.0, 9228.0, 27172.0, 31388.0] | [459.0, 22.0, 20.0, 107.0, 477.0] | [252, 296, 296, 256, 252] |
p02661 | u344888046 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from statistics import median\n\nN = int(input())\nA = [0] * N\nB = [0] * N\nfor c in range(N):\n A[c], B[c] = map(int, input().split())\n\nA_med = median(A)\nB_med = median(B)\n\nif N % 2 == 0:\n print(2 * (B_med - A_med) + 1)\nelse:\n print(B_med - A_med + 1)\n', 'from statistics import median\n\nN = int(i... | ['Wrong Answer', 'Accepted'] | ['s968983125', 's906174019'] | [28820.0, 28708.0] | [461.0, 445.0] | [257, 264] |
p02661 | u364693468 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import collections\nN = int(input())\nA = [0] * N\nB = [0] * N\nfor i in range(N):\n a, b = map(int, input().split())\n A[i] = a\n B[i] = b\nA.sort()\nB.sort()\nN_q, N_mod = divmod(N, 2)\nif N_mod == 1:\n ans = B[N_q] - A[N_q] + 1\nelse:\n ans_list = []\n for x in range(A[N_q - 1], B[N_q - 1] + 1, 1... | ['Wrong Answer', 'Accepted'] | ['s893119109', 's011564965'] | [616140.0, 25800.0] | [2222.0, 454.0] | [525, 303] |
p02661 | u364774090 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['N = int(input())\n\nA = [0] * N\nB = [0] * N\n\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\nA.sort()\nB.sort()\n\nprint(A, B)\nif N % 2 == 0:\n n1 = N // 2 - 1\n n2 = N // 2\n ans = B[n1] - A[n1] + B[n2] - A[n2] + 1\n print(ans)\n\nelse:\n n = N // 2\n ans = B[n] - A[n] + 1\n ... | ['Wrong Answer', 'Accepted'] | ['s451438852', 's696962104'] | [29628.0, 25332.0] | [497.0, 454.0] | [309, 297] |
p02661 | u371409687 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['def median_cal(data):\n num = len(data)\n data.sort()\n if num % 2 == 0:\n median1 = int(num / 2)\n median2 = int(num / 2 - 1)\n median = (data[median1] + data[median2]) / 2.0\n return median\n else:\n median = int((num + 1) / 2 - 1)\n median = data[median]\n ... | ['Wrong Answer', 'Accepted'] | ['s001903932', 's203763323'] | [25440.0, 25612.0] | [470.0, 488.0] | [544, 549] |
p02661 | u374802266 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import math\nn=int(input())\na=sorted([list(map(int,input().split())) for i in range(n)])\nb=sorted(a,key=lambda x:x[1])\nif n%2==1:\n print(b[n//2][1]-a[n//2][0]+1)\nelse:\n print((b[n//2-1][1]+b[n//2][1])-(a[n//2-1][0]-a[n//2][0]))//2)', 'n=int(input())\na=sorted([list(map(int,input().split())) for i in range... | ['Runtime Error', 'Accepted'] | ['s827047758', 's875931994'] | [9008.0, 49844.0] | [23.0, 1215.0] | [236, 222] |
p02661 | u380854465 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['# -*- coding: utf-8 -*-\n\nimport math\nimport numpy as np\n\nif __name__ == "__main__":\n N = int(input())\n A = []\n B = []\n for i in range(N):\n t = list(map(int, input().split()))\n A.append(t[0])\n B.append(t[1])\n A.sort()\n B.sort()\n\n a = 0\n if N % 2 == 0:\n ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s323268546', 's635336008', 's880945898', 's116494824'] | [43464.0, 63312.0, 43304.0, 43340.0] | [588.0, 541.0, 581.0, 595.0] | [532, 499, 508, 391] |
p02661 | u391589398 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\nA = []\nB = []\nfor _ in range(n):\n a, b = tuple(map(int, input().split()))\n A.append(a)\n B.append(b)\n\nA = sorted(A)\nB = sorted(B)\n\nif n%2==1:\n sa = AB_A[n//2]\n lb = AB_B[n//2]\n print(lb - sa + 1)\nelse:\n sal = AB_A[n//2-1]\n sar = AB_A[n//2]\n\n lbl = AB_B[n//... | ['Runtime Error', 'Accepted'] | ['s830042920', 's190744560'] | [27268.0, 27140.0] | [489.0, 488.0] | [365, 347] |
p02661 | u405256066 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from sys import stdin\nfrom decimal import Decimal\nN = int(stdin.readline().rstrip())\nA = []\nB = []\nfor i in range(N):\n a,b = [int(x) for x in stdin.readline().rstrip().split()]\n A.append(a)\n B.append(b)\n \nA.sort()\nB.sort()\nif N % 2 == 0:\n ans = Decimal(sum(B))/Decimal(2) - Decimal(sum(A))/... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s000024775', 's310956609', 's861733434', 's895423822', 's966503332', 's788556250'] | [26204.0, 9076.0, 25408.0, 26336.0, 26220.0, 26084.0] | [313.0, 26.0, 303.0, 333.0, 336.0, 322.0] | [412, 394, 341, 412, 355, 391] |
p02661 | u405660020 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n=int(input())\nab=[list(map(int, input().split())) for _ in range(n)]\na=[]\nb=[]\nfor a_i, b_i in ab:\n a.append(a_i)\n b.append(b_i)\na.sort()\nb.sort()\n\nimport statistics\na_med=statistics.median(a)\nb_med=statistics.median(b)\n\nif n%2==0:\n ans=2*b_med-2*a_med+1\nelse:\n ans=b_med-a_med+1\nprint(a... | ['Wrong Answer', 'Accepted'] | ['s480636134', 's230412859'] | [52408.0, 52508.0] | [599.0, 598.0] | [303, 308] |
p02661 | u413165887 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\na, b = [], []\nfor i in range(n):\n x, y = map(int, input().split())\n a.append(x)\n b.append(y)\na.sort()\nb.sort()\nif n%2==0:\n p = n//2\n right = (a[p]+a[p-1])/2 -1\n left = (b[p]+b[p-1])/2\n r = left-right\n if int(r)==r:\n print(int(r)*2)\n else:\n prin... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s883955662', 's965298269', 's576034959'] | [25436.0, 49268.0, 25484.0] | [473.0, 557.0, 465.0] | [397, 360, 400] |
p02661 | u434609232 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import statistics\n\nN = int(input())\nA = []\nB = []\nfor i in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nAm = statistics.median(A)\nBm = statistics.median(B)\n\nif N % 2 == 0:\n print(round(2 * Bm - Am) + 1)\nelse:\n print(Bm - Am + 1)', 'import statistics\nimport math\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s176990156', 's983111678', 's937912417'] | [28860.0, 28920.0, 28780.0] | [478.0, 495.0, 497.0] | [268, 314, 276] |
p02661 | u437990671 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['arr = []\na,b = [],[]\nfor _ in range(int(input())):\n x,y = list(map(int,input().split()))\n a.append(x)\n b.append(y)\n arr.append([x,y])\narr.sort()\nn = len(arr)\nif n%2!=0:\n x = n//2\n print(arr[x][1]-arr[x][0]+1)\nelse:\n x = n//2\n y = x-1\n minn = (arr[x][0]+arr[y][0])/2\n maxx ... | ['Wrong Answer', 'Accepted'] | ['s533226685', 's382095862'] | [42896.0, 25564.0] | [806.0, 474.0] | [396, 321] |
p02661 | u439063038 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['import numpy as np\n\nN = int(input())\na_list = []\nb_list = []\nfor i in range(N):\n ab = list(map(int, input().split()))\n a_list.append(ab[0])\n b_list.append(ab[1])\n\nif N%2 == 1:\n a_median = np.median(a_list)\n b_median = np.median(b_list)\n print(b_median-a_median+1)\nelif N%2 == 0:\n a_... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s356262617', 's373540810', 's665878863', 's803416115', 's130932507'] | [45804.0, 9868.0, 45768.0, 8824.0, 27148.0] | [514.0, 31.0, 512.0, 27.0, 491.0] | [397, 426, 453, 386, 442] |
p02661 | u439370642 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['def main():\n n = int(input())\n a = [None]*n\n b = [None]*n\n for i in range(n):\n a[i],b[i] = map(int, input().split())\n a.sort()\n b.sort() \n if n&1:\n print(b[n//2]-a[n//2]+1)\n else:\n print(b[n//2-1]+b[n//2]-a[n//2]+1)\n \nif __name__ == "__main__":\n... | ['Wrong Answer', 'Accepted'] | ['s487863852', 's852350799'] | [25248.0, 25324.0] | [408.0, 405.0] | [314, 324] |
p02661 | u441254033 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['# E\n\nN = int(input())\n\nab = []\n\nfor i in range(N):\n ab.append(tuple(map(int,input().split())))\n\nab.sort()\n \nimport statistics\nimport math\n\nam = statistics.median([i[0] for i in ab])\nbm = statistics.median([i[1] for i in ab])\n\nprint(am,bm)\nif am%0.5 != 0:\n print(bm-am+1)\nelse:\n print(int(bm-am... | ['Wrong Answer', 'Accepted'] | ['s626273926', 's103469977'] | [41492.0, 41468.0] | [687.0, 744.0] | [302, 290] |
p02661 | u455408345 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n=int(input(""))\na=[]\nb=[]\nfor i in range(n):\n cc=input("").split(" ")\n a+=[int(cc[0])]\n b+=[int(cc[1])]\ns=0\na.sort()\nb.sort()\nif (n%2==0):\n s=(a[n/2]+a[n/2-1]-b[n/2]-b[n/2-1])/2\nelse:\n s=a[int((n+1)/2)]-b[int((n+1)/2)]\nprint(-s+1)\n', 'n=int(input(""))\na=[]\nb=[]\nfor i in range(n):\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s836185059', 's970172670', 's987083030', 's138284648'] | [25444.0, 25440.0, 9104.0, 25448.0] | [472.0, 474.0, 27.0, 462.0] | [247, 247, 235, 270] |
p02661 | u462329577 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = int(input())\na, b = [0] * n, [0] * n\nfor i in range(n):\n a[i], b[i] = map(int, input().split())\n\naa, ba, aidx = zip(*sorted(zip(a, b, range(n)))) \nbb, ab, bidx = zip(*sorted(zip(b, a, range(n)))) \n\nif n % 2:\n print(bb[n // 2] - aa[n // 2] + 1)\nelse:\n if aidx[n // 2 - 1] == bidx[n // 2]:\n ... | ['Wrong Answer', 'Accepted'] | ['s371123626', 's766530123'] | [72252.0, 25484.0] | [2207.0, 454.0] | [967, 850] |
p02661 | u467957734 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['n = input()\nA = []\nB = []\nfor i in range(n):\n a,b = map(int, input().split())\n A.append(a)\n B.append(b)\nA.sort()\nB.sort()\nj = n//2\nif n%2 == 0:\n print((B[j]+B[j+1])-(A[j]+A[j+1])+1)\nelse:\n print(B[j]-A[j]+1)', 'n = int(input())\nA = []\nB = []\nfor i in range(n):\n a,b = list(map(int, input().split... | ['Runtime Error', 'Accepted'] | ['s665955270', 's446542211'] | [8976.0, 25456.0] | [23.0, 495.0] | [212, 223] |
p02661 | u471593927 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['\n#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport statistics\n\nN = int(input())\nAB = []\nfor _ in range(N):\n AB.append(list(map(int,input().split())))\n\nA = []\nB = []\n\nfor i in range(N):\n A.append(AB[i][0])\n B.append(AB[i][1])\n\nprint(statistics.median(B)-statistics.median(A)+1)\n', '\n#!/usr/... | ['Wrong Answer', 'Accepted'] | ['s246232245', 's954938909'] | [52664.0, 49196.0] | [590.0, 585.0] | [286, 338] |
p02661 | u479719434 | 2,000 | 1,048,576 | There are N integers X_1, X_2, \cdots, X_N, and we know that A_i \leq X_i \leq B_i. Find the number of different values that the median of X_1, X_2, \cdots, X_N can take. | ['from statistics import median\n\n\ndef main():\n N = int(input())\n A = [None] * N\n B = [None] * N\n for i in range(N):\n A[i], B[i] = map(int, input().split())\n min_median = median(A)\n max_median = median(B)\n if N % 2 == 1:\n print(max_median - min_median + 1)\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s781243533', 's259810691'] | [28920.0, 28900.0] | [440.0, 457.0] | [427, 389] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.