QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#373817 | #6566. Power of Divisors | chirpyboat | TL | 10ms | 9648kb | Python3 | 474b | 2024-04-02 07:44:31 | 2024-04-02 07:44:32 |
Judging History
answer
def d(n):
p = 2
divisors = 1
current = 0
while n > 1:
while n % p == 0:
current += 1
n //= p
divisors *= current + 1
current = 0
p += 1
return divisors
x = int(input())
if x == 1:
print(1)
exit()
for f in range(100, 1, -1):
n = x ** (1 / f)
if abs(n - round(n)) < 1e-9 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: 9528kb
input:
15625
output:
25
result:
ok single line: '25'
Test #2:
score: 0
Accepted
time: 9ms
memory: 9460kb
input:
64000000
output:
20
result:
ok single line: '20'
Test #3:
score: 0
Accepted
time: 0ms
memory: 9528kb
input:
65536
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 9396kb
input:
1
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 9ms
memory: 9528kb
input:
10
output:
-1
result:
ok single line: '-1'
Test #6:
score: 0
Accepted
time: 10ms
memory: 9648kb
input:
100
output:
-1
result:
ok single line: '-1'
Test #7:
score: 0
Accepted
time: 9ms
memory: 9640kb
input:
10000
output:
10
result:
ok single line: '10'
Test #8:
score: 0
Accepted
time: 4ms
memory: 9496kb
input:
1000000000000000000
output:
100
result:
ok single line: '100'
Test #9:
score: 0
Accepted
time: 5ms
memory: 9588kb
input:
10372926089038969
output:
218089
result:
ok single line: '218089'
Test #10:
score: 0
Accepted
time: 3ms
memory: 9528kb
input:
10642944803293201
output:
10157
result:
ok single line: '10157'
Test #11:
score: -100
Time Limit Exceeded
input:
10646534823110209