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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03253 | u375616706 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n, m = (list)(map(int, input().split()))\n\nl_prime = [0]*(n+1)\nN = n\nran = range(3, N+1)\n\nwhile n % 2 == 0:\n l_prime[2] += 1\n n /= 2\n\nfor i in ran:\n while n != 1:\n if n % i == 0:\n n /= i\n l_prime[i] += 1\n else:\n i += 2\n\n\ndef fact(n):\n tmp =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s251754760', 's560881781', 's881231969'] | [4492.0, 3064.0, 3064.0] | [2104.0, 19.0, 19.0] | [622, 516, 496] |
p03253 | u382423941 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\nfrom collections import Counter\n\nn, m = map(int, input().split())\nmod = 10**9 + 7\n\nfact = [0] * (n+21)\nifact = [0] * (n+21)\nfact[0] = 1\nfor i in range(1,n+21):\n fact[i] = fact[i-1] * i % mod\nifact[n+20] = pow(fact[n+20], mod-2, mod)\nfor i in reversed(range(1,n+21)):\n ifact[i-1] = ifact[... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s840900290', 's854113855', 's489734062'] | [11244.0, 11252.0, 11376.0] | [91.0, 96.0, 86.0] | [772, 746, 731] |
p03253 | u384124931 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\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... | ['Runtime Error', 'Accepted'] | ['s661211051', 's080825908'] | [3188.0, 3064.0] | [20.0, 20.0] | [675, 586] |
p03253 | u389910364 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\nfrom collections import Counter\n\nfrom scipy.misc import comb\n\n\ndef get_divisors(n):\n \n ret = []\n for i in range(1, int(math.sqrt(n)) + 1):\n if n % i == 0:\n ret.append(i)\n if n // i != i:\n ret.append(n // i)\n return ret\n\n\ndef get_fact... | ['Time Limit Exceeded', 'Accepted'] | ['s439427488', 's864482379'] | [15240.0, 3684.0] | [2109.0, 24.0] | [1436, 1958] |
p03253 | u403301154 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n, m = list(map(int, input().split()))\n\nMAX = 2*10**5+1\nMOD = 10**9+7\nfact = [0 for i in range(MAX)]\ninv = [0 for i in range(MAX)]\ninvfact = [0 for i in range(MAX)]\n\ndef comb_build(n):\n fact[0] = inv[0] = invfact[0] = 1\n fact[1] = inv[1] = invfact[1] = 1\n for i in range(2, n):\n fact[i] = fact[i-1]*i... | ['Wrong Answer', 'Accepted'] | ['s168815391', 's473678465'] | [27160.0, 27160.0] | [272.0, 290.0] | [788, 815] |
p03253 | u404676457 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\n(n, m) =map(int, input().split())\nsqm = math.sqrt(m)\nmap = {}\ni = 2\ny = m\nwhile m != 1 and sqm > i:\n if m % i == 0 :\n m = m / i\n if i in map:\n map[i] += 1\n else:\n map[i] = 1\n else:\n i += 1\nsum = 1\nfor i in map:\n tmpn = n + map[i]... | ['Wrong Answer', 'Accepted'] | ['s411393111', 's779843085'] | [3188.0, 3064.0] | [28.0, 25.0] | [486, 466] |
p03253 | u419686324 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['N,M = map(int, input().split())\nmod = 10 ** 9 + 7\n\nimport math\nclass PrimeUtils:\n @staticmethod\n def primes_sieve(n):\n sieve = [True] * (n + 1)\n for i in range(2, n + 1):\n if sieve[i]:\n for j in range(i + i, n + 1, i):\n sieve[j] = False\n ... | ['Wrong Answer', 'Accepted'] | ['s668235238', 's205261646'] | [7572.0, 7556.0] | [51.0, 51.0] | [2375, 2433] |
p03253 | u419877586 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from collections import defaultdict\n\nn, m = map(int, input().split())\n\nprime_list = defaultdict(int)\np = 2\nwhile p <= 10**4.5+5:\n if m%p == 0:\n prime_list[p] += 1\n m //= p\n else:\n p += 1\n\nif m > 1:\n prime_list[m] += 1\n\nMOD=10**9+7\n\ndef comb(n, r): \n if r<0 or r>n: \... | ['Wrong Answer', 'Accepted'] | ['s747825553', 's747670250'] | [3316.0, 3316.0] | [31.0, 30.0] | [566, 547] |
p03253 | u427344224 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['def prime_factorize(num):\n """\n This function performs prime factorization on the input natural number.\n The result is returned in the form of a dictionary with the prime number as the key\n and its number as the value.\n :param num:\n :return prime_factor: Dictionary with the prime number as the... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s142843187', 's877034273', 's952701444'] | [4400.0, 4404.0, 3064.0] | [2104.0, 2104.0, 20.0] | [962, 962, 1031] |
p03253 | u442581202 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\ndef comb(x,y):\n f = 1\n for i in range(y):\n f *= (x-i)\n f //= (i+1)\n\n return f\n\nn,m = map(int,input().split())\n\ncnt = [0]\nfor i in range(2,int(math.sqrt(m))+1):\n while m!=i:\n if m%i==0:\n m //=i\n cnt[-1]+=1\n else:\n cn... | ['Wrong Answer', 'Accepted'] | ['s576451570', 's869943309'] | [3628.0, 3064.0] | [39.0, 19.0] | [510, 406] |
p03253 | u466331465 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from operator import mul\nfrom functools import reduce\n\ndef cmb(n,r):\n r = min(n-r,r)\n if r == 0: return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // under\nimport itertools\nN,M = [int(x) for x in input().split()]\ne = [0]*(int(M**0.5)+1)\nfor ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s543959750', 's613260894', 's699271956'] | [3944.0, 3816.0, 3700.0] | [43.0, 44.0, 29.0] | [445, 472, 508] |
p03253 | u476435125 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m=map(int,input().split())\n\ndef prime(n):\n for i in range(2,n):\n if n%i==0:\n return 0\n return 1\n\n\n\n\n# yield i\n#n以下の素数のリスト\n\n\n\n\n# l[(i+2)*j-2]=0\n\n\ndef prime_l(n):\n l=[1 for i in range(2,n+1)]\n #sq_n=n**(1/2)\n for i in range(n-1):\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s087850213', 's105517462', 's144901746', 's185333709', 's825445422', 's472257806'] | [11484.0, 11388.0, 11388.0, 11388.0, 8140.0, 11388.0] | [931.0, 956.0, 949.0, 946.0, 2104.0, 954.0] | [2506, 2361, 2504, 2337, 985, 2502] |
p03253 | u492026192 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m=map(int,input().split())\nMOD=10**9+7\ndef factorization(n):\n arr = []\n temp = n\n if n==1:\n return arr\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.appe... | ['Wrong Answer', 'Accepted'] | ['s080021139', 's546302217'] | [3064.0, 3064.0] | [20.0, 20.0] | [767, 768] |
p03253 | u532966492 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['N,M=map(int,input().split())\n\nfrom collections import Counter\n \ndef soinsuu(n):\n list_=[]\n while(n!=1):\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n list_.append(i)\n n=n//i\n break\n else:\n list_.append(n)\n ... | ['Runtime Error', 'Accepted'] | ['s108481716', 's493017374'] | [3316.0, 3316.0] | [230.0, 229.0] | [932, 761] |
p03253 | u537905693 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ["#!/usr/bin/env python\n# coding: utf-8\n\nimport math\nfrom operator import mul\nfrom functools import reduce\n\n\ninf = 10**9+7\n\n\n# nCr\ndef combination(n,r):\n r = min(n-r,r)\n if r == 0: return 1\n over = reduce(mul, range(n, n - r, -1))\n under = reduce(mul, range(1,r + 1))\n return over // unde... | ['Wrong Answer', 'Accepted'] | ['s678026781', 's647250690'] | [4724.0, 4724.0] | [65.0, 65.0] | [1618, 1618] |
p03253 | u545368057 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from collections import deque\n\nN, M = map(int,input().split())\n\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n return sorted(divisors,reverse=True)\n\... | ['Wrong Answer', 'Accepted'] | ['s905543090', 's551593325'] | [4296.0, 16808.0] | [2108.0, 725.0] | [1832, 1667] |
p03253 | u547167033 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m=map(int,input().split())\nmod=10**9+7\ndef comb(n,k,p):\n from math import factorial\n if n<0 or k<0 or n<k:return 0\n if n==0 and k==0:return 1\n a=factorial(n)%p\n b=factorial(k)%p\n c=factorial(n-k)%p\n return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p\ndef power_func(a,b,p):\n if b==0:\n return ... | ['Wrong Answer', 'Accepted'] | ['s979508591', 's121455338'] | [4244.0, 3064.0] | [2104.0, 20.0] | [691, 475] |
p03253 | u562935282 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['def comb(a, b):\n if b > a - b:\n return comb(a, a - b)\n # res = 1\n mul = 1\n div = 1\n for i in range(b):\n # res *= (a - i)\n # res /= (i + 1)\n mul *= (a - i)\n div *= (i + 1)\n res = mul / div\n return res\n\n\nn, m = map(int, input().split())\n\nMOD = 10 ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s158328867', 's940570075', 's569938093'] | [3064.0, 3064.0, 3064.0] | [2103.0, 2104.0, 23.0] | [570, 609, 583] |
p03253 | u577170763 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ["class Solution:\n\n def solve(self, N: int, M: int) -> int:\n\n mod = 10**9+7\n INT_MAX = 10**7\n\n # calculate {m+n}C{n}\n\n def egcd(a, b):\n if a == 0:\n return b, 0, 1\n else:\n g, y, x = egcd(b % a, a)\n return g, x... | ['Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s422907752', 's815937021', 's083616200'] | [81268.0, 3188.0, 3064.0] | [2104.0, 18.0, 21.0] | [1666, 1666, 1367] |
p03253 | u593005350 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['#How many ways M=a1*a2*...*aN ex)N=2,M=6 a={1,6},{2,3},{3,2},{6,1}\nimport math\nn,m=map(int,input().split())\nfactor=[]\nc=0\nmod=10**9+7\n\n\nwhile m%2 == 0:\n m//=2\n c+=1\nif c != 0:\n factor.append([2,c])\n#Alternate\nfor i in range(3,int(math.sqrt(m+1)),2):\n c=0\n while m%i == 0:\n m//=i\... | ['Wrong Answer', 'Accepted'] | ['s349494587', 's001489121'] | [3064.0, 3188.0] | [2103.0, 72.0] | [1076, 1488] |
p03253 | u606045429 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['N, M = [int(i) for i in input().split()]\n\ndef prime_decomposition(n):\n table = []\n i = 2\n while i * i <= n:\n count = 0\n while n % i == 0:\n n //= i\n count += 1\n if count != 0:\n table.append((i, count))\n i += 1\n if n > 1:\n table.append((n, 1))\n return table\n\ndef cmb... | ['Wrong Answer', 'Accepted'] | ['s705007616', 's421448646'] | [3572.0, 3572.0] | [24.0, 24.0] | [674, 665] |
p03253 | u622523700 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\nimport collections\nn, m = map(int, input().split())\n\nfactor = []\ntmp = int(m ** (1/2)) + 1\nfor i in range(2, tmp):\n while m % i == 0:\n m //= i\n factor.append(i)\nif m > 1:\n factor.append(m)\nnum = list(collections.Counter(factor).most_common())\n\nans = 1\nfor i in range(len(... | ['Runtime Error', 'Accepted'] | ['s646651139', 's779865445'] | [3440.0, 3444.0] | [26.0, 24.0] | [451, 502] |
p03253 | u623687794 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import sys\nn,m=map(int,input().split())\nMOD = 10**9+7\nans=1\ndef inv_mod(a, p=MOD):\n def inv_mod_sub(a, p):\n if a == 1:\n return 1, 0\n else:\n d, r = p//a, p%a\n x, y = inv_mod_sub(r, a)\n return y-d*x, x\n if p < 0: p = -p\n a %= p\n return ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s317963832', 's744742263', 's792867426', 's996193323', 's251740699'] | [3064.0, 3064.0, 11064.0, 2055412.0, 11076.0] | [18.0, 17.0, 447.0, 2128.0, 471.0] | [862, 862, 773, 786, 867] |
p03253 | u623819879 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m = map(int,input().split())\ndef div(x,y):\n if x%y!=0:\n return 0\n else:\n return 1+div(int(x/y),y)\n\np=[]\n\ndef fact(s):\n if len(p)!=0:\n k=p[-1]\n else:\n k=2\n for i in range(2,max(int(s**0.5) +2,2)):\n a=div(s,i)\n if a==0:\n 0\n e... | ['Wrong Answer', 'Accepted'] | ['s688967524', 's773079014'] | [3064.0, 3192.0] | [22.0, 22.0] | [716, 746] |
p03253 | u628262476 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m=map(int,input().split())\npw = []\nd = 2\nwhile d*d <= m:\n e = 0\n while m % d == 0:\n e += 1\n m //= d\n if e > 0: pw.append(e)\n d += 1\nif m > 1: pw.append(1)\nprint(pw)\nans = 1\nfor e in pw:\n comb = 1\n for i in range(e):\n comb = comb * (n+i) // (1+i)\n ans = ans * comb % 1000000007\nprint... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s016345538', 's270764107', 's386130792', 's060708722'] | [3064.0, 3064.0, 3064.0, 3064.0] | [19.0, 26.0, 19.0, 19.0] | [305, 280, 272, 295] |
p03253 | u631277801 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import sys\nstdin = sys.stdin\n\ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readline().rstrip()\ndef lc(): return list... | ['Wrong Answer', 'Accepted'] | ['s704150066', 's590686135'] | [15392.0, 27276.0] | [103.0, 194.0] | [1849, 1855] |
p03253 | u633105820 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ["import math\nimport sys\nimport collections\n\n\nmod = 1000000007\nsys.setrecursionlimit(mod)\nfact = {1: 1}\n\n\ndef run(n, m):\n print('{}を{}個の数列で表現'.format(m, n))\n ans = 1\n primes = []\n for i in range(2, m):\n if m == 1:\n break\n if m % i == 0:\n cnt = 0\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s407551965', 's997228186', 's666213493'] | [4728.0, 4444.0, 3316.0] | [2104.0, 2104.0, 22.0] | [1361, 1229, 1619] |
p03253 | u634461820 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\nmod = 1000000007\nN,M = list(map(int,input().strip().split()))\nl = []\n\ndef P(n, r):\n return math.factorial(n)//math.factorial(n-r)\ndef C(n, r):\n return P(n, r)//math.factorial(r)\n\ncnt = 0\nwhile M%2 == 0:\n M = M//2\n cnt += 1\nl.append(cnt)\n\n\nfor i in range(3,int(math.sqrt(M)),2):\n cnt... | ['Wrong Answer', 'Accepted'] | ['s058530839', 's207073383'] | [4408.0, 3064.0] | [2104.0, 19.0] | [443, 392] |
p03253 | u643495354 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from scipy.misc import comb\n\n\ndef main():\n n, m = map(int, input().split())\n MOD = 10 ** 9 + 7\n\n m0 = m\n primes = {}\n p = 2\n \n while m0 > 1:\n if m0 % p == 0:\n m0 /= p\n if p in primes:\n primes[p] += 1\n else:\n pr... | ['Time Limit Exceeded', 'Accepted'] | ['s602394185', 's228395470'] | [15152.0, 3688.0] | [2108.0, 30.0] | [501, 807] |
p03253 | u652081898 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['def FACTOR(DICT, N):\n FACT = DICT\n LIM = int(N**0.5)+2\n for i in range(2, LIM):\n if N%i == 0:\n FACT[i] = 0\n while N%i == 0:\n FACT[i] += 1\n N //= i\n if len(FACT) == len(DICT):\n if N != 1:\n FACT[N] = 1\n return FACT\n retu... | ['Wrong Answer', 'Accepted'] | ['s089811549', 's760845798'] | [3064.0, 3064.0] | [23.0, 22.0] | [652, 637] |
p03253 | u652150585 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\n\nn,m=map(int,input().split())\na=math.floor(math.sqrt(m))+1\nl=[0]*(a+1)\nfor i in range(2,a+1):\n while m%i==0:\n l[i]+=1\n m//=i\nb=list(filter(lambda x:x!=0,l))\nshow=False\nif len(b)==0:\n show=True\nans=1\nprint(b)\nfor i in b:\n com=1\n for j in range(i):\n com*=n+... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s002444654', 's383191197', 's529146406', 's836882418'] | [3316.0, 2940.0, 2940.0, 3316.0] | [30.0, 17.0, 17.0, 27.0] | [402, 532, 528, 578] |
p03253 | u685263709 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import sympy\nsympy.factorint(2016)', 'N, M = map(int, input().split())\nmod = 10**9 + 7\n\n\ndef factorize(n):\n b = 2\n fct = {}\n while b * b <= n:\n while n % b == 0:\n n //= b\n if b in fct.keys():\n fct[b] += 1\n else:\n fct[b] = 1\n... | ['Runtime Error', 'Accepted'] | ['s267724180', 's173599506'] | [2940.0, 3572.0] | [17.0, 24.0] | [34, 709] |
p03253 | u690536347 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from collections import Counter as c\nfrom scipy.misc import comb\nfrom functools import reduce\n\ndef f(n):\n d=c()\n for i in range(2,1+int(n**0.5)):\n while n%i==0:\n d[i]+=1\n n/=i\n if n:d[n]+=1\n return d.values()\n\nn,m=map(int,input().split())\nmod=10**9+7\nprint(reduce(lambda x,y:x*y%mod,map... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s161876851', 's348545992', 's502821898', 's503843554', 's537023366', 's955077537', 's355168873'] | [15272.0, 13308.0, 13240.0, 13176.0, 15224.0, 22584.0, 11316.0] | [197.0, 162.0, 159.0, 159.0, 160.0, 325.0, 450.0] | [349, 346, 350, 364, 350, 346, 580] |
p03253 | u704284486 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['mod = 10**9+7\ndef prime(n,p):\n iteral = 0\n while n%p == 0:\n n //= p\n iteral += 1\n return iteral,n\ndef modpow(a,n):\n if n==0:\n return 1\n elif n==1:\n return a%mod\n elif n%2==0:\n return (modpow(a,n/2)**2)%mod\n else:\n return (a*modpow(a,n-1))%m... | ['Wrong Answer', 'Accepted'] | ['s280035482', 's833195797'] | [3192.0, 3700.0] | [20.0, 25.0] | [881, 1353] |
p03253 | u726615467 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['# encoding: utf-8\nimport math\nN, M = map(int, input().split())\n\ndef distribute(pos, full, tmp):\n return memo[tmp][pos]\n\n# define search range\np_max = int(M / 2) # M is prime if M has a factor p (> p_max)\nip_up = int(math.log2(p_max))\n\n#### O(MlogM) below (if M has a very large prime factor)\nM_tmp = M\n... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s177585940', 's300842774', 's747835001', 's950662347', 's230902413'] | [320816.0, 37620.0, 3064.0, 3064.0, 192284.0] | [2123.0, 2106.0, 17.0, 2104.0, 951.0] | [1330, 1331, 1255, 639, 960] |
p03253 | u727148417 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['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 if temp != 1:\n arr.append([temp, 1])\n ... | ['Runtime Error', 'Accepted'] | ['s440051757', 's028804183'] | [12644.0, 11508.0] | [2104.0, 70.0] | [2264, 1415] |
p03253 | u729008627 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import numpy as np\nN, M = map(int, input().split())\nbigp = 10**9+7\nL1 = []\nL2 = []\np = 2\nmax = np.sqrt(M)\nK = M\nwhile p <= max:\n if K%p == 0:\n L1.append(p)\n K = K//p\n if p not in L2:\n L2.append(p)\n else:\n p = p+1\n\nans = 1\ndef ModComb(n, r, p):\n N = n%... | ['Wrong Answer', 'Accepted'] | ['s295983730', 's337565487'] | [12508.0, 3064.0] | [178.0, 18.0] | [592, 629] |
p03253 | u729133443 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from scipy.misc import comb\nn,m=map(int,input().split())\na=1\np=2\nwhile m>1:\n if m%p:\n p+=1\n continue\n c=0\n while not m%p:\n m//=p\n c+=1\n a=a*comb(n+c-1,c,exact=1)%(10**9+7)\nprint(a)', 'import math\nimport random\nclass Prime:\n seed_primes=[2,3,5,7,11,13,17,19,23... | ['Time Limit Exceeded', 'Accepted'] | ['s514396360', 's595359000'] | [14220.0, 11460.0] | [2109.0, 81.0] | [220, 3064] |
p03253 | u780529129 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n = int(input())\nm = int(input())\na = list(map(int,input().split()))\nM = 10000\n\ndp = [[0]*(m+1) for i in range(n+1)]\n\nfor i in range(n+1):\n dp[i][0] = 1\n \nfor i in range(n):\n for j in range(1,m+1):\n if j - 1 - a[i] >= 0:\n dp[i + 1][j] = (dp[i + 1][j - 1] + dp[i][j] - dp[i][j -... | ['Runtime Error', 'Accepted'] | ['s952167315', 's243845660'] | [9172.0, 42400.0] | [26.0, 188.0] | [419, 588] |
p03253 | u790905630 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from math import *\nfrom collections import *\n\ndef Prime_Factorization(M):\n factor_list = []\n\n for i in range(2, int(sqrt(M)) + 1):\n while M % i == 0:\n factor_list.append(i)\n M = M // i\n if (M == 1):\n break\n\n return factor_list\n\ndef comb(num_object... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s147087492', 's271490812', 's787980386', 's110919435'] | [4740.0, 4696.0, 4424.0, 3064.0] | [2104.0, 2104.0, 2104.0, 18.0] | [888, 828, 1010, 1020] |
p03253 | u803848678 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from collections import Counter\nmod = 10**9 + 7\nn, m = map(int, input().split())\n\ndef fact(m):\n c = Counter()\n s = 2\n while s**2 <= m:\n if m % s:\n s += 1\n continue\n while m % s == 0:\n c[s] += 1\n m //= s\n if m > 1:\n c[m] += 1\n... | ['Wrong Answer', 'Accepted'] | ['s966889050', 's683460758'] | [3316.0, 3316.0] | [23.0, 23.0] | [595, 580] |
p03253 | u814986259 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['N, M = map(int, input().split())\n\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 if temp !... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s188583536', 's330819172', 's371063456', 's373412448', 's393428621', 's419901136', 's597282764', 's613931662', 's605189811'] | [20876.0, 21260.0, 20900.0, 20948.0, 8996.0, 9000.0, 32956.0, 20724.0, 20876.0] | [121.0, 121.0, 129.0, 121.0, 23.0, 25.0, 221.0, 125.0, 103.0] | [1372, 1223, 1335, 1270, 1282, 1283, 1216, 1347, 1286] |
p03253 | u826263061 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sun Sep 23 22:00:37 2018\nABC110D\n@author: maezawa\n"""\nimport collections\n\ndef comb(n, r):\n if n == 0 or r == 0:\n return 1\n return comb(n, r-1)*(n-r+1)//r\n\nn, m = list(map(int, input().split()))\n\nmod = 10**9+7\nnp = int(10**4.5 + 10)\nis_prime = [True]... | ['Wrong Answer', 'Accepted'] | ['s695931220', 's409211316'] | [3700.0, 3700.0] | [32.0, 34.0] | [903, 873] |
p03253 | u846150137 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['n,m=map(int,input().split())\ni=2\ns=[]\nwhile i*i<=m:\n j=0\n while m % (i**(j+1))==0:\n j+=1\n if j:\n m//=i**j\n s+=[j]\n i+=1\na=1\nfor v in s:\n c = 1\n for i in range(v):\n c = c * (n+i) // (1+i)\n a = a * c % (10**9+7)\nprint(a)\n', 'n,m=map(int,input().split())\ni=2\ns=[]\nwhile i**2<=m:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s034771940', 's227754612', 's373150826', 's519240034', 's596197706', 's909416655', 's381954667'] | [3064.0, 3060.0, 3064.0, 3060.0, 3064.0, 3064.0, 3064.0] | [20.0, 22.0, 33.0, 22.0, 38.0, 2103.0, 19.0] | [238, 239, 262, 238, 251, 238, 251] |
p03253 | u875361824 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ["from collections import Counter\n\n\ndef main():\n \n N, M = map(int, input().split())\n\n ans = editorial(N, M)\n print(ans)\n\n\ndef factorize(N):\n \n import math\n factors = []\n while True:\n if N % 2 == 0:\n factors.append(2)\n N //= 2\n else:\n ... | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s280280542', 's762292071', 's845469035', 's025662235'] | [3332.0, 3336.0, 3332.0, 3332.0] | [2104.0, 2104.0, 24.0, 24.0] | [6527, 6501, 6543, 6572] |
p03253 | u883048396 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['iN,iM = [int(x) for x in input().split()]\niD = 10**9 +7 \n\ndef fPrimeCounter(iM):\n iS = int(iM ** 0.5) + 1\n aRet = []\n for i in range(2,iS):\n iCounter = 0\n while iM % i == 0:\n iM = iM // i\n iCounter += 1\n if 0 < iCounter : aRet.append(iCounter)\n return... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s064455348', 's420285751', 's524120694', 's771828779'] | [10868.0, 10996.0, 10868.0, 3064.0] | [88.0, 91.0, 87.0, 24.0] | [1119, 1119, 1145, 717] |
p03253 | u894258749 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['inpl = lambda: list(map(int,input().split()))\nMOD = 10**9 + 7\nN, M = inpl()\n\ndef factorize(n):\n prime_list = []\n factorize_list = []\n i = 2\n while i <= n:\n for p in prime_list:\n if i % p == 0:\n break\n else:\n prime_list.append(i)\n k = 0\n while n % i == 0:\n n ... | ['Wrong Answer', 'Accepted'] | ['s546855300', 's034333234'] | [3064.0, 3064.0] | [2104.0, 19.0] | [563, 537] |
p03253 | u895515293 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['from math import factorial, sqrt\nN,M=map(int,input().split())\nprms={}\ntmp=M\nfor i in range(2, int(sqrt(M))+2):\n while not tmp%i:\n if not i in prms:\n prms[i]=1\n else:\n prms[i]+=1\n tmp //= i\nif tmp != 1:\n prms[tmp] = 1\n\nprint(prms)\n\nres=1\ndef cmb(a,b):\n... | ['Wrong Answer', 'Accepted'] | ['s578779448', 's657147148'] | [3064.0, 3064.0] | [21.0, 21.0] | [529, 532] |
p03253 | u901098617 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\n\ndef isprime(n):\n if(n<2):\n return False\n for i in range(2,int(n**0.5)+1):\n if(n%i==0):\n return False\n return True\n\ndef primelist(n):\n return [i for i in range(n) if isprime(i)]\n\ndef factor(n):\n f = {}\n for p in primelist(int(n**0.5)+1):\n w... | ['Wrong Answer', 'Accepted'] | ['s867777269', 's052007199'] | [4424.0, 3188.0] | [2104.0, 21.0] | [729, 688] |
p03253 | u903460784 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['# 2 6=>4 (1,6)*2,(2,3)*2\n# 3 12=>18 (1,1,12)*3,(1,2,6)*6,(1,3,4)*6,(2,2,3)*3\nimport math\ndef comb(a,b): # aCb\n return math.factorial(a)//math.factorial(a-b)//math.factorial(b)\n\nn,m=map(int,input().split())\nrootm=int(m**0.5)\ndivisor={}\ntmp=m\nfor i in range(2,m+1):\n while tmp%i==0:\n tmp//=i\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s349839984', 's576755358', 's597341089', 's508679151'] | [4392.0, 4396.0, 4388.0, 3064.0] | [2107.0, 2104.0, 2104.0, 25.0] | [533, 533, 535, 845] |
p03253 | u920299620 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['def com(n,m):\n if(n-m < m):\n m=n-m\n result=1\n mylist=[i for i in range(1,m+1)]\n j=1\n for i in range(1,m+1):\n result*=(n+1-i)\n if(j<m):\n while(result%mylist[j]==0):\n result//=mylist[j]\n j+=1\n if(j>=m):\n ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s171697662', 's511802515', 's804186925', 's832466071'] | [3064.0, 3064.0, 3064.0, 3192.0] | [2104.0, 30.0, 30.0, 19.0] | [669, 684, 346, 884] |
p03253 | u922901775 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import operator as op\nfrom itertools import groupby\nfrom functools import reduce\n\nNN = 10 ** 9 + 7\n\n\ndef prime_factors(n):\n i = 2\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n yield i\n if n > 1:\n yield i\n\n\ndef ncr(n, r):\n r... | ['Wrong Answer', 'Accepted'] | ['s673426024', 's533862339'] | [3696.0, 3568.0] | [97.0, 23.0] | [638, 638] |
p03253 | u938486382 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ["N, M = list(map(int, input().split(' ')))\nMOD = int(1e9 + 7)\nseeds = []\np = 2\nwhile p*p > M:\n while M % p == 0:\n seeds.append(p)\n M = M // p\n p += 1\nif M > 1:\n seeds.append(M)\n \ndef comb(n, k):\n ans = 1\n for i in range(1, k + 1):\n ans = (ans * (n + 1 - i) // i)\n return ans\n \nans = 1\n... | ['Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s633371825', 's847166618', 's442081327'] | [3064.0, 3336.0, 3064.0] | [2103.0, 2104.0, 19.0] | [430, 1069, 431] |
p03253 | u942915776 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import math\n\nN, M = map(int, input().split())\nyakusu = dict()\nsqrt_M = int(math.sqrt(M))\nfor i in range(2, sqrt_M + 1):\n count = 0\n while M % i == 0:\n count += 1\n M //= i\n if count > 0:\n yakusu[i] = count\nif M > 1:\n yakusu[M] = 1\n\n\ndef nCr(n, r):\n if r > n - r:\n ... | ['Wrong Answer', 'Accepted'] | ['s305985460', 's828922234'] | [3064.0, 3064.0] | [23.0, 23.0] | [576, 563] |
p03253 | u944209426 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import collections\ndef primes(n):\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for i in range(n +... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s017303065', 's073273593', 's142882872', 's215762352', 's454263024', 's529242727', 's896568006'] | [3692.0, 3444.0, 3692.0, 3316.0, 3316.0, 3316.0, 3316.0] | [25.0, 39.0, 26.0, 35.0, 20.0, 39.0, 23.0] | [826, 392, 785, 511, 536, 506, 424] |
p03253 | u952708174 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | [' if M == 1:\n return 1\n\n def prime_factorization_power_list(n):\n i = 2\n table = {}\n while i**2 <= n:\n table[i] = 0\n while n % i == 0:\n table[i] += 1\n n //= i\n if table[i] == 0:\n table.pop(i)\n ... | ['Runtime Error', 'Accepted'] | ['s538821602', 's142972337'] | [2940.0, 11824.0] | [17.0, 54.0] | [1375, 1702] |
p03253 | u969190727 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['import collections\nimport math\nn,m=map(int,input().split())\nflag=0\nP=[]\np=m\nwhile flag==0:\n cur=p\n for i in range(2,int(p**0.5)+1):\n if p%if==0:\n P.append(i)\n p//=i\n break\n if p==cur:\n P.append(p)\n flag=1\nc=collections.Counter(P)\nPrimes=set(P)\ndef f(i):\n return math.fact... | ['Runtime Error', 'Accepted'] | ['s905339394', 's306633287'] | [2940.0, 18932.0] | [18.0, 180.0] | [402, 544] |
p03253 | u984276646 | 2,000 | 1,048,576 | You are given positive integers N and M. How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7. Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''. | ['N, M = map(int, input().split())\nmod = int(1e+9 + 7)\na = mod - 2\nax = []\nwhile a != 0:\n ax = [a%2] + ax[:]\n a //= 2\ndef inved(x):\n y = 1\n for i in range(len(ax)):\n if ax[i] == 1:\n y *= x\n y %= mod\n if i != len(ax) - 1:\n y *= y\n y %= mod\n return y\n\np, n = 2, M\nL = []\n... | ['Wrong Answer', 'Accepted'] | ['s931951109', 's043246687'] | [7108.0, 7212.0] | [69.0, 70.0] | [864, 856] |
p03254 | u006167882 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\ncount = 0\nfor i in range(N):\n x = x - a[i]\n if x >= 0:\n count += 1 \n\nprint(count)', 'N, x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\ncount = 0\nfor i in range(N):\n x = x - a[i]\n if... | ['Wrong Answer', 'Accepted'] | ['s012615873', 's331649831'] | [3060.0, 3060.0] | [17.0, 17.0] | [171, 204] |
p03254 | u007886915 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['# -*- coding: utf-8 -*-\nimport sys\nimport itertools\nimport math\n#w=input()\nN, x=input().split()\nN=int(N)\nx=int(x)\n#x=[]\n#y=[]\n\n\n\n\n#l=0\n#t[0],x[0],y[0]=[0, 0, 0]\n\n\n# t[i+1], x[i+1], y[i+1] = map(int, input().split())\nchild_i = list(map(int, input().split()))\n#w_len=len(w)\n#w_list=list(w)\n#print(... | ['Wrong Answer', 'Accepted'] | ['s957999462', 's912895492'] | [3060.0, 3060.0] | [17.0, 18.0] | [871, 905] |
p03254 | u013202780 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\nl1=list(map(int,input().split()))\nl1.sort()\nans=0\nwhile len(l1)>0:\n t1=l1.pop(0)\n if x>=t1:\n x-=t1\n ans+=1\nprint (ans)', 'n,x=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort()\nans=ac=0\nfor i in l:\n ac+=i\n if x>=ac:\n ans+=1\... | ['Wrong Answer', 'Accepted'] | ['s069828345', 's441188342'] | [3060.0, 3060.0] | [17.0, 17.0] | [167, 162] |
p03254 | u013408661 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\na.reverse()\nans=0\nwhile x>0:\n if len(a)==0:\n break\n if a[-1]<=x:\n x-=a.pop()\n ans+=1\n else:\n break\nprint(ans)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\na.reverse()\nans=0\nwhile x>0:\n... | ['Wrong Answer', 'Accepted'] | ['s190628602', 's375536905'] | [3064.0, 3060.0] | [18.0, 18.0] | [195, 229] |
p03254 | u017810624 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nb=a[0]\nif b>x:c=0\nelse:c=1\nfor i in range(n):\n b=b+a[i]\n if b>x:\n break\n c+=1\nif c>n:c=n\nprint(c)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nc=0\nfor i in range(n-1):\n x=x-a[i]\n if x>=0:c+=1\... | ['Wrong Answer', 'Accepted'] | ['s106340133', 's990709897'] | [3316.0, 3316.0] | [23.0, 21.0] | [174, 148] |
p03254 | u021548497 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n, x = map(int, input().split())\na = [int(x) for x in input().split()]\na.sort()\nans = 0\nfor i in range(n):\n if a[i] <= x:\n ans += 1\n x -= a[i]\n else:\n break\nprint(ans)', 'n, x = map(int, input().split())\na = [int(x) for x in input().split()]\na.sort()\nans = 0\nfor i in range(n):\n if a[i] <= x... | ['Wrong Answer', 'Accepted'] | ['s380653812', 's989300170'] | [2940.0, 3060.0] | [17.0, 17.0] | [178, 221] |
p03254 | u022215787 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n, x = map(int, input().split())\na_l = list(map(int, input().split()))\na_l = sorted(a_l)\nans = 0\nfor a in a_l:\n x = x-a\n if x < 0:\n break\n ans += 1\nprint(ans)', 'n, x = map(int, input().split())\na_l = list(map(int, input().split()))\na_l = sorted(a_l)\nans = 0\nfor a in a_l:\n x = x-a\n ... | ['Wrong Answer', 'Accepted'] | ['s665087973', 's452896593'] | [9124.0, 9184.0] | [30.0, 26.0] | [174, 197] |
p03254 | u038107109 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\nchild_list = list(map(int, input().split()))\n\ncount = 0\nfor child in sorted(child_list):\n x -= child\n if x < 0:\n break\n count += 1\n\n\nprint(count)', 'N, x = map(int, input().split())\nchild_list = list(map(int, input().split()))\n\ncount = 0\nfor child in sorted(child_... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s392830583', 's849336529', 's557861770'] | [9104.0, 9100.0, 9132.0] | [27.0, 26.0, 28.0] | [184, 218, 251] |
p03254 | u039860745 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nsum = 0\nans = 0\nfor i,a in enumerate(A):\n sum += a\n\n if sum == x:\n ans = i + 1\n break\n elif sum > x:\n break\n ans = i + 1\n\n\nprint(ans)\n', 'N, x = map(int, input().split())\nA = list(map(int, ... | ['Wrong Answer', 'Accepted'] | ['s993721923', 's113091362'] | [9088.0, 9092.0] | [29.0, 29.0] | [245, 308] |
p03254 | u041382530 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N,x=map(int,input().split())\ncount=0\nc=list(map(int,input().split()))\nc.sort()\nfor i in range(N):\n\tx=x-int(c[i])\n\tif x>=0:\n\t\tcount+=1\nprint(count)', 'N,x=map(int,input().split())\ncount=0\nc=list(map(int,input().split()))\nc.sort()\nfor i in range(N):\n\tx=x-int(c[i])\n\tif x>=0:\n\t\tcount+=1\nif x>0:\n\... | ['Wrong Answer', 'Accepted'] | ['s829814316', 's206458596'] | [2940.0, 3060.0] | [18.0, 17.0] | [146, 169] |
p03254 | u044026875 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\ncount=0\n\nfor i in range(n):\n if x>0:\n x-=a[i]\n count+=1\n else:\n break\nprint(count)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\ncount=0\n\nfor i in range(n-1):\n if x>=a[i]:\... | ['Wrong Answer', 'Accepted'] | ['s637586714', 's712549492'] | [2940.0, 3060.0] | [17.0, 21.0] | [180, 213] |
p03254 | u045408189 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\n_=0\nans=0\nfor i in range(N):\n _+=a[i]\n if _ <= x:\n ans += 1\nprint(ans)\n \n', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\nA=0\nfor i in range(len(a)):\n A += a[i]\nif A < x:\n print(n-1)\nelse:\n ... | ['Wrong Answer', 'Accepted'] | ['s742475423', 's450053739'] | [2940.0, 3060.0] | [17.0, 18.0] | [163, 264] |
p03254 | u048176319 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, X = map(int, input().split())\nla = sorted(list(map(int, input().split())))\n\nprint(la)\n\nif X < la[0]:\n print(0)\nelif X > sum(la):\n print(N-1)\nelif X == sum(la):\n print(N)\nelse:\n j = 0\n while X > 0:\n X = X - la[j]\n j += 1\n print(j)', 'N, X = map(int, input().split())\n... | ['Wrong Answer', 'Accepted'] | ['s531008292', 's319111364'] | [3060.0, 3064.0] | [17.0, 17.0] | [264, 300] |
p03254 | u064408584 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int, input().split())\na=list(map(int, input().split()))\na.sort()\ncount=0\ni=0\nwhile x>0 and i<n:\n x-=a[i]\n if x>=0:count+=1\n i+=1 \nprint(count)', 'n,x=map(int, input().split())\na=list(map(int, input().split()))\na.sort()\ncount=0\ni=0\nwhile x>0 and i<n:\n x-=a[i]\n if x>=0:count+=1\n ... | ['Wrong Answer', 'Accepted'] | ['s598733725', 's929198747'] | [3060.0, 3064.0] | [17.0, 17.0] | [159, 189] |
p03254 | u066455063 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nans = 0\n\nfor i in range(N):\n if x > 0:\n if x >= a[i]:\n ans += 1\n x -= a[i]\n \n else:\n break\n \nprint(ans)', 'N, x = map(int, input().split())\na = list(map(int, input().split()... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s072116406', 's176894877', 's502832680'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 19.0] | [233, 234, 478] |
p03254 | u067227603 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\na = sorted(list(map(int, input().split())))\n\nchild = 0\ncandy = 0\n\nprint(a)\n\nfor i in a:\n candy += i\n if candy <= x:\n child += 1\n\nif sum(a) < x:\n child -= 1\n\nprint(child)', 'N, x = map(int, input().split())\na = sorted(list(map(int, input().split())))\n\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s253640434', 's275519792', 's215792525'] | [3060.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [218, 223, 213] |
p03254 | u067983636 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['import bisect\n\nN, x = map(int, input().split())\nA = list(map(int, input().split()))\nS = [0] * (N + 1)\nA.sort()\n\nfor i, a in enumerate(A):\n S[i + 1] = S[i] + a\n\nif S[-1] > x:\n print(N - 1)\nelif S[-1] == x:\n print(N)\nelse:\n print(bisect.bisect_right(S, x))\n\n', 'import bisect\n\nN, x = map(i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s294490164', 's705441242', 's923604805'] | [3060.0, 3060.0, 3060.0] | [19.0, 17.0, 18.0] | [268, 195, 267] |
p03254 | u075012704 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\nans = 0\nfor a in A:\n if x >= a:\n x -= a\n ans += 1\n\nprint(ans)', 'N, x = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\nans = 0\nfor a in A:\n if x >= a:\n x -= a\n ans +=... | ['Wrong Answer', 'Accepted'] | ['s039755399', 's578872676'] | [3316.0, 2940.0] | [21.0, 17.0] | [156, 206] |
p03254 | u076306174 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['import math\nimport heapq\nimport sys\nfrom collections import Counter\n\n\n\n\nN,x=map(int, input[0].split()) \na=list(map(int,input[1].split())) \n\nheapq.heapify(a) \n\nfor i in range(N):\n x-=heapq.heappop(a) \n #print(x,a)\n if x<=0 or i==N-1:\n print(i+1)\n break', 'import math\nimpor... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s001333676', 's414656381', 's498020343', 's025604837'] | [3316.0, 3316.0, 3444.0, 3316.0] | [20.0, 21.0, 21.0, 21.0] | [733, 734, 798, 799] |
p03254 | u077291787 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['# AGC027A - Candy Distribution Again\n# greedy algorithm\nfrom itertools import accumulate\n\n\ndef main():\n # maximize the number of proper distribution -> begin with small values\n n, x = tuple(map(int, input().rstrip().split()))\n A = sorted(map(int, input().rstrip().split()))\n ans = sum(i <= x for i... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s405433319', 's493510783', 's897988921'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0] | [382, 465, 465] |
p03254 | u078349616 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, X = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(N):\n if X >= A[i]:\n X -= A[i]\n ans += 1\nprint(ans)', 'N, X = map(int, input().split())\nA = sorted(list(map(int, input().split())))\nl = [0]*N\nfor i in range(N):\n if X >= A[i]:\n if i == N-1:\n ... | ['Wrong Answer', 'Accepted'] | ['s325598850', 's047960559'] | [2940.0, 3064.0] | [17.0, 17.0] | [157, 298] |
p03254 | u090436701 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['import sys\n\nN, x = sys.stdin.readline().split()\nN = int(N)\nx = int(x)\nal = [int(a) for a in sys.stdin.readline().split()]\n\nal.sort()\n\nused = 0\nans = N\nfor i, a in enumerate(al):\n if used+a > x:\n ans = i\n break\n used += a\n\nprint(ans)\n \n \n \n', 'import sys\n\nN, ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s068673739', 's184530913', 's567617447', 's638521830', 's743994306', 's733787393'] | [3060.0, 3060.0, 2940.0, 3060.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 18.0, 17.0] | [276, 330, 231, 238, 221, 312] |
p03254 | u092244748 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n, x = map(int, input().split())\narray = list(map(int, input().split()))\n\ncount = 0\narray = sorted(array, reverse=True)\nfor i in range(n):\n x = x - array[i]\n if x >= 0:\n count += 1\n else:\n break\nprint(count)', 'n, x = map(int, input().split())\narray = list(map(int, input().split()))... | ['Wrong Answer', 'Accepted'] | ['s941265947', 's646020912'] | [3060.0, 3064.0] | [18.0, 17.0] | [230, 241] |
p03254 | u094191970 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['from sys import stdin\nnii=lambda:map(int,stdin.readline().split())\nlnii=lambda:list(map(int,stdin.readline().split()))\n\nn,x=nii()\na=lnii()\na.sort()\n\na_sum=0\nfor i in range(n):\n a_sum+=a[i]\n if a_sum>x:\n print(i)\n exit()\n\nprint(n)', 'from sys import stdin\nnii=lambda:map(int,stdin.readline().spl... | ['Wrong Answer', 'Accepted'] | ['s471078169', 's349465727'] | [9072.0, 9124.0] | [29.0, 29.0] | [237, 292] |
p03254 | u094999522 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x,*a=map(int,open(0).read().split())\na.sort()\ns=0\ni=0\nwhile s<x or i<=n:\n i+=1\n s+=a[i]\nprint(~-i)', 'n,x,*a=map(int, open(0).read().split())\na.sort()\nfor i in range(n):\n x-=a[i]\n if x<0:\n print(i)\n exit()\nprint(n)', 'n,x,*a=map(int, open(0).read().split())\na.sort()\nfor i in ra... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s004729209', 's475614660', 's237459482'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 19.0] | [106, 128, 175] |
p03254 | u100277898 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['\nin1 = input()\nin2 = input()\nN, x = in1.split()\nN = int(N)\nx = int(x)\na = list()\nfor i in in2.split():\n a.append(int(i))\na.sort()\ncount = 0\nfor ai in a:\n if x > ai:\n count += 1\n x -= ai\n elif x == ai:\n count += 1\n break\n else:\n break\nprint(count)', 'in1 = input()\nin2 = input()\... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s212857373', 's301958357', 's314301019', 's773960362'] | [3064.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 17.0, 18.0] | [265, 265, 326, 326] |
p03254 | u102242691 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['\nn,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nb = []\nnum = a[0]\ni = 1\n\nwhile num <= x:\n num += a[i]\n if x - a[i] > 0:\n x -= a[i]\n b.append(a[i])\n i += 1\n else:\n b.append(max(0,a[i]))\n break\n\nprint(a)\nprint(b)\nprint(num)\n\na... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s360012888', 's858190864', 's258987454'] | [3064.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [389, 395, 231] |
p03254 | u102461423 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['import numpy as np\nN,x = map(int,input().split())\nA = np.array(input().split(), dtype = np.int64)\nA.sort()\nA = A.cumsum()\nanswer = (A <= x).sum()\nprint(answer)', 'import numpy as np\nN,x = map(int,input().split())\nA = np.array(input().split(), dtype = np.int64)\nA.sort()\nnp.cumsum(A, out = A)\nanswer = (A <= ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s078852642', 's186466860', 's665490087', 's864069192', 's444535945'] | [12396.0, 20384.0, 20748.0, 12396.0, 3060.0] | [152.0, 298.0, 311.0, 148.0, 18.0] | [159, 166, 152, 167, 348] |
p03254 | u102902647 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['\nN, x = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nA = sorted(A)\nres = 0\nfor a in A:\n x -= a\n if x <= 0:\n break\n else:\n res += 1\nprint(res)\n\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Sep 15 23:36:39 2018\n\n@author: Yuki\n"""\n\nN, x = map(int, input()... | ['Wrong Answer', 'Accepted'] | ['s982836425', 's323304692'] | [2940.0, 3064.0] | [17.0, 17.0] | [186, 391] |
p03254 | u102960641 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nn = 0\nfor i in a:\n n += 1\n x -= i\n if x < 0:\n n -= 1\n break\nprint(n)\n', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nn = 0\nfor i in a:\n n += 1\n x -= i\n if x < 0:\n n -= 1\n bre... | ['Wrong Answer', 'Accepted'] | ['s818316672', 's376991085'] | [2940.0, 3060.0] | [17.0, 17.0] | [153, 172] |
p03254 | u103902792 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\nans=0\nfor a in A:\n x-=a\n if x>=0:\n ans+=1\n else:\n print(ans)\n break', 'n,x=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\nans=0\nfor a in A[:-1]:\n x-=a\n if x>=0:\n ans+=1\n else:\n break\nif ... | ['Wrong Answer', 'Accepted'] | ['s244946516', 's823967760'] | [2940.0, 3060.0] | [18.0, 17.0] | [150, 173] |
p03254 | u105302073 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, X = list(map(int, input().split()))\nA = list(map(int, input().split()))\nret = 0\nfor a in A:\n if a <= X:\n ret += 1\n X -= a\nprint(ret)', 'N, X = list(map(int, input().split()))\nA = sorted(list(map(int, input().split())))\nlast_index = len(A) - 1\nret = 0\nfor i, a in enumerate(A):\n if a ... | ['Wrong Answer', 'Accepted'] | ['s147138699', 's947395640'] | [2940.0, 3060.0] | [17.0, 17.0] | [152, 234] |
p03254 | u106118504 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['children = list(map(int,input().split())) \nchildren.sort()\ncount=0\nc = 0\nif x < children[0]:\n print(0)\n exit()\nfor i in range(n):\n count += children[i]\n c += 1\n if count == x:\n print(c)\n exit()\n elif count > x:\n print(c-1)\n exit()\n\nprint(n-1)', 'n, x = map(int,input().split())\nchil... | ['Runtime Error', 'Accepted'] | ['s653003427', 's674870695'] | [9176.0, 9116.0] | [21.0, 27.0] | [260, 293] |
p03254 | u106778233 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x = map(int,input().split()) \nA= list(map(int,input().split())) \nA.sort()\na_sum=0 \nfor i in range(n):\n a_sum+= A[i]\n if x<a_sum:\n print(i)\n exit() \n\nprint(n)', 'n,x = map(int,input().split()) \nA= list(map(int,input().split())) \nA.sort()\na_sum=0 \nfor i in range(n):\n a_sum+= A[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s046515365', 's651017251', 's242737349'] | [9044.0, 8984.0, 9172.0] | [27.0, 31.0, 26.0] | [180, 224, 219] |
p03254 | u106971015 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N,x=map(int,input().split())\na = list(map(int,input().split()))\ncnt = 0\na.sort()\nfor i in a:\n if x >= i:\n x -= i\n cnt +=1\n else:\n print(cnt)\n exit()\nprint(cnt)', 'N,x=map(int,input().split())\na = list(map(int,input().split()))\ncnt = 0\na.sort()\nfor i in a:\n if x >= ... | ['Wrong Answer', 'Accepted'] | ['s315479653', 's049124437'] | [2940.0, 3060.0] | [17.0, 18.0] | [193, 230] |
p03254 | u107915058 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['N, x = map(int, input().split())\na = sorted(map(int, input().split()))\ncnt = 0\nfor i in a:\n if x < i:\n break\n cnt += 1\n x -= i\n if x > 0:\n cnt -= 1\nprint(cnt)', 'N, x = map(int, input().split())\na = sorted(map(int, input().split()))\ncnt = 0\nfor i in a:\n if x < i:\n br... | ['Wrong Answer', 'Accepted'] | ['s203278683', 's510944873'] | [9096.0, 8916.0] | [27.0, 26.0] | [184, 190] |
p03254 | u108990937 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ["n, x = (int(i) for i in input().split(' '))\na = [int(i) for i in input().split(' ')]\n\nch = 0 \n\nwhile x != 0: \n if x - a[i] < 0: \n x = 0\n else:\n x -= a[i]\n ch += 1\n\nprint(ch) \n \n ", "n, x = (int(i) for i in input().split(' '))\na = sorted([int(i) for i in input().s... | ['Runtime Error', 'Accepted'] | ['s854060021', 's325838518'] | [2940.0, 3064.0] | [17.0, 17.0] | [306, 282] |
p03254 | u111421568 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n, x = map(int, input().split())\n\na = list(map(int, input().split()))\n\ndef score(a, m, x):\n ans = x*(n+m)\n l = n//m\n for i in range(n):\n t = (n-1-i)//m\n if i < m:\n ans += ((t+2)**2) * a[i]\n else:\n ans += ((t+2)**2) * (a[i] - a[i-m])\n for i in range(m... | ['Wrong Answer', 'Accepted'] | ['s577329250', 's264877808'] | [3064.0, 3316.0] | [20.0, 19.0] | [1299, 241] |
p03254 | u113107956 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\ncnt=0\nfor i in range(n):\n if a[i]<=x:\n x-=a[i]\n cnt+=1\n else:\n break\nprint(cnt)\n', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\nb=[0]*n\na.sort()\ncnt=0\nfor i in range(n):\n if a[i]<=x:... | ['Wrong Answer', 'Accepted'] | ['s746361310', 's398842769'] | [9116.0, 9092.0] | [28.0, 32.0] | [178, 232] |
p03254 | u114954806 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\nlst=sorted(list(map(int,input().split())))\nans=0\nfor i in range(1,n+1):\n if sum(lst[:i]) <= x:\n ans = len(lst[:i])\nprint(ans)', 'N,x=map(int,input().split())\nA=sorted(list(map(int,input().split())))\na=[0]*N\na[0]=A[0]\nfor i in range(N-1):\n a[i+1]=a[i]+A[i+1]\nans=0\... | ['Wrong Answer', 'Accepted'] | ['s763825790', 's537621028'] | [3060.0, 3060.0] | [18.0, 17.0] | [164, 212] |
p03254 | u125545880 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['def main():\n N, x = map(int, input().split())\n a = list(map(int, input().split()))\n a.sort()\n if sum(a) <= x:\n print(N)\n return\n for i in range(N):\n x -= a[i]\n if x < 0:\n break\n ans = i\n print(ans)\n\nif __name__ == "__main__":\n main()\n', 'd... | ['Wrong Answer', 'Accepted'] | ['s874487901', 's130639045'] | [3060.0, 3060.0] | [17.0, 18.0] | [297, 297] |
p03254 | u127499732 | 2,000 | 1,048,576 | There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ... | ['n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\nc,i=0,0\nwhile(i<n and x>0):\n if a[i]<=x:\n x-=a[i]\n c+=1\n i+=1\n else:\n break\nprint(c)', 'n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\nc,i=0,0\nwhile(i<n and x>0):\n if a[i]<=x:\n x-=a[i]\n c+... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s411941619', 's993303861', 's745030708'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 22.0] | [168, 168, 197] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.