QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89934 | #5103. Fair Division | _skb_# | WA | 13ms | 7948kb | Python3 | 434b | 2023-03-21 20:13:56 | 2023-03-21 20:14:00 |
Judging History
answer
import math
n, m = map(int, input().split())
max_pow = int(pow(1e19, 1.0 / n))
pw = []
pw.append(1)
for i in range(1, max_pow + 1):
pw.append(pow(i, n))
for q in range(1, max_pow + 1):
for p in range(1, max_pow + 1):
if p < q and math.gcd(p, q) == 1:
if m % (pw[q] - pw[q - p]) == 0:
print(p, end=' ')
print(q)
exit(0)
print("impossible")
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 13ms
memory: 7948kb
input:
13 382475111752106101
output:
impossible
result:
wrong answer 1st lines differ - expected: '17 28', found: 'impossible'