結果

問題 No.2358 xy+yz+zx=N
ユーザー SaimonSaimon
提出日時 2023-11-17 16:28:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 14,296 KB
最終ジャッジ日時 2023-11-17 16:28:59
合計ジャッジ時間 11,456 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())

n = int(math.sqrt(N))

a = set()

for x in range(n):
    for y in range(x, n):

        if x + y != 0 and (n-x*y) % (x+y) == 0:

            z = (n-x*y) // (x+y)

            a.add((x, y, z))
            a.add((x, z, y))
            a.add((y, x, z))
            a.add((y, z, x))
            a.add((z, x, y))
            a.add((z, y, x))

print(len(a))

for i in list(a):
    print(*i)
0