結果

問題 No.2358 xy+yz+zx=N
ユーザー ニックネームニックネーム
提出日時 2023-06-23 22:05:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 84,264 KB
最終ジャッジ日時 2023-09-14 10:08:54
合計ジャッジ時間 3,095 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,952 KB
testcase_01 AC 72 ms
71,980 KB
testcase_02 AC 73 ms
71,816 KB
testcase_03 AC 73 ms
71,464 KB
testcase_04 AC 75 ms
71,700 KB
testcase_05 AC 72 ms
71,732 KB
testcase_06 AC 74 ms
71,876 KB
testcase_07 AC 98 ms
77,788 KB
testcase_08 AC 217 ms
83,540 KB
testcase_09 AC 222 ms
84,264 KB
testcase_10 AC 206 ms
80,468 KB
testcase_11 AC 207 ms
80,896 KB
testcase_12 AC 175 ms
79,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
n = int(input())
ans = set()
for x in range(0,int(n**0.5)+1):
    for y in range(max(x,1),int(n**0.5)+1):
        if (n-x*y)%(x+y)==0:
            z = (n-x*y)//(x+y)
            if y>z: break
            ans |= set(permutations((x,y,z)))
print(len(ans))
for p in ans: print(*p)
0