QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#68482#5103. Fair Divisionnocriz#WA 12ms8484kbPython3245b2022-12-16 20:14:462022-12-16 20:14:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-16 20:14:48]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:8484kb
  • [2022-12-16 20:14:46]
  • 提交

answer

n, m = map(int, input().split())
qn = [1]
for i in range(2, 10000000):
	v = pow(i, n)
	if v - qn[-1] > m:
		print("impossible")
		quit()
	for j, q in enumerate(qn):
		if m % (v - q) == 0:
			print(i-(j+1), i)
			quit()
	qn.append(v)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 12ms
memory: 8484kb

input:

13 382475111752106101

output:

impossible

result:

wrong answer 1st lines differ - expected: '17 28', found: 'impossible'