QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#89929 | #5103. Fair Division | _skb_# | WA | 14ms | 7896kb | Python3 | 458b | 2023-03-21 20:04:29 | 2023-03-21 20:04:30 |
Judging History
answer
import math
n, m = map(int, input().split())
max_pow = int(pow(1e20, 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 * p * pw[q - p] % (q * pw[q] - 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: 14ms
memory: 7896kb
input:
13 382475111752106101
output:
impossible
result:
wrong answer 1st lines differ - expected: '17 28', found: 'impossible'