結果

問題 No.2358 xy+yz+zx=N
ユーザー hiro1729hiro1729
提出日時 2023-09-01 19:53:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,818 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 13,492 KB
最終ジャッジ日時 2023-09-01 19:53:15
合計ジャッジ時間 11,115 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,956 KB
testcase_01 AC 16 ms
7,956 KB
testcase_02 AC 17 ms
7,804 KB
testcase_03 AC 16 ms
7,820 KB
testcase_04 AC 16 ms
7,864 KB
testcase_05 AC 16 ms
7,804 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 24 ms
8,808 KB
testcase_08 AC 1,818 ms
13,368 KB
testcase_09 AC 1,782 ms
13,492 KB
testcase_10 AC 1,740 ms
10,068 KB
testcase_11 AC 1,796 ms
10,484 KB
testcase_12 AC 1,436 ms
9,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = set()
for x in range(int(n ** 0.5) + 1):
	for y in range(x, int(n ** 0.5) + 1):
		if x + y != 0 and (n - x * y) % (x + y) == 0:
			z = (n - x * y) // (x + y)
			ans.add((x, y, z))
			ans.add((x, z, y))
			ans.add((y, x, z))
			ans.add((y, z, x))
			ans.add((z, x, y))
			ans.add((z, y, x))
print(len(ans))
for i in list(ans):
	print(*i)
0