QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602473#7033. Resistors in ParalleltarjenCompile Error//C++20564b2024-10-01 01:49:572024-10-01 01:49:58

Judging History

This is the latest submission verdict.

  • [2024-10-01 01:49:58]
  • Judged
  • [2024-10-01 01:49:57]
  • Submitted

answer

import math

def isprime(x):
    for i in range (2,10000):
        if i*i>x:
            return True
        if x % i ==0 :
            return False
    return True        
def solve(x):
    now=1
    p=1
    q=1
    for i in range(2,100000):
        if not isprime(i):
            continue
        if now*i > x:
            break
        now=now*i
        p=p*i
        q=q*(i+1)
    g=math.gcd(p,q)
    p=p//g
    q=q//g
    print(f"{p}/{q}")
    return None

T = int(input())
while T>0:
    T=T-1
    x=int(input())
    solve(x)

Details

answer.code:1:1: error: ‘import’ does not name a type
    1 | import math
      | ^~~~~~
answer.code:1:1: note: C++20 ‘import’ only available with ‘-fmodules-ts’, which is not yet enabled with ‘-std=c++20’