結果

問題 No.2358 xy+yz+zx=N
ユーザー SaimonSaimon
提出日時 2023-11-17 16:37:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,875 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 15,420 KB
最終ジャッジ日時 2023-11-17 16:37:31
合計ジャッジ時間 10,251 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,112 KB
testcase_01 AC 28 ms
10,112 KB
testcase_02 AC 28 ms
10,112 KB
testcase_03 AC 28 ms
10,112 KB
testcase_04 AC 29 ms
10,112 KB
testcase_05 AC 28 ms
10,112 KB
testcase_06 AC 29 ms
10,112 KB
testcase_07 AC 36 ms
10,496 KB
testcase_08 AC 1,875 ms
15,168 KB
testcase_09 AC 1,835 ms
15,420 KB
testcase_10 AC 1,788 ms
11,904 KB
testcase_11 AC 1,787 ms
12,160 KB
testcase_12 AC 1,471 ms
11,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())

n = int(math.sqrt(N))

a = set()

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

        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