結果

問題 No.2358 xy+yz+zx=N
ユーザー とりゐとりゐ
提出日時 2023-07-03 23:35:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 344 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 83,636 KB
最終ジャッジ日時 2023-09-24 21:06:24
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,784 KB
testcase_01 AC 78 ms
71,944 KB
testcase_02 AC 79 ms
71,828 KB
testcase_03 AC 78 ms
71,392 KB
testcase_04 AC 78 ms
71,768 KB
testcase_05 AC 79 ms
71,872 KB
testcase_06 AC 84 ms
76,248 KB
testcase_07 AC 106 ms
77,236 KB
testcase_08 AC 336 ms
82,852 KB
testcase_09 AC 344 ms
83,636 KB
testcase_10 AC 306 ms
80,220 KB
testcase_11 AC 309 ms
80,560 KB
testcase_12 AC 251 ms
78,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n=int(input())
ans=set()
for x in range(0,int(n**0.5)+10):
  for y in range(1,int(n**0.5)+10):
    if (n-x*y)%(x+y)==0:
      z=(n-x*y)//(x+y)
      if z>=0:
        for p in itertools.permutations([x,y,z]):
          ans.add(p)

print(len(ans))
for i in ans:
  print(*i)
0