QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#373830#6566. Power of DivisorschirpyboatWA 10ms9716kbPython3414b2024-04-02 07:56:522024-04-02 07:56:53

Judging History

你现在查看的是最新测评结果

  • [2024-04-02 07:56:53]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:9716kb
  • [2024-04-02 07:56:52]
  • 提交

answer

from math import sqrt

def d(n):
    divisors = 0
    for i in range(1, round(sqrt(n)) + 1):
        if (n % i == 0):
            divisors += 1 + (n // i != i)

    return divisors

x = int(input())

if x == 1:
    print(1)
    exit()

for f in range(60, 1, -1):
    n = x ** (1 / f)

    if abs(n - round(n)) < 1e-12 and d(round(n)) == f:
        print(round(n))
        exit()

print(-1)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 9524kb

input:

15625

output:

25

result:

ok single line: '25'

Test #2:

score: 0
Accepted
time: 6ms
memory: 9504kb

input:

64000000

output:

20

result:

ok single line: '20'

Test #3:

score: 0
Accepted
time: 4ms
memory: 9656kb

input:

65536

output:

-1

result:

ok single line: '-1'

Test #4:

score: 0
Accepted
time: 7ms
memory: 9640kb

input:

1

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 10ms
memory: 9704kb

input:

10

output:

-1

result:

ok single line: '-1'

Test #6:

score: 0
Accepted
time: 10ms
memory: 9584kb

input:

100

output:

-1

result:

ok single line: '-1'

Test #7:

score: 0
Accepted
time: 6ms
memory: 9716kb

input:

10000

output:

10

result:

ok single line: '10'

Test #8:

score: 0
Accepted
time: 10ms
memory: 9528kb

input:

1000000000000000000

output:

100

result:

ok single line: '100'

Test #9:

score: -100
Wrong Answer
time: 10ms
memory: 9652kb

input:

10372926089038969

output:

-1

result:

wrong answer 1st lines differ - expected: '218089', found: '-1'