Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

NUMFACT Wrong Answer

$
0
0

Hello,
I am trying to solve NUMFACT, but it is giving me Runtime Error NZEC
My code seems to run perfectly fine for all cases I can think of but it is giving me an NZEC in cases after the first case in subtask 1.
Submission link

import math
T = int(raw_input())

for i in range(T):
    raw_input()
    p = [int(_) for _ in raw_input().split(" ")]
    p1 = 1
    for p_ in p:
            p1 *= p_
    facs = 2
    sqr = int(math.sqrt(p1))
    for j in range(2, sqr+1):
        if p1%j==0: facs+=2
    if sqr*sqr==p1: facs-=1
    print facs

Please tell me what cases I'm missing.


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>