結果

問題 No.2358 xy+yz+zx=N
ユーザー qibqib
提出日時 2023-06-29 13:54:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 85,516 KB
最終ジャッジ日時 2023-09-20 09:22:39
合計ジャッジ時間 4,480 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,152 KB
testcase_01 AC 76 ms
71,072 KB
testcase_02 AC 82 ms
70,972 KB
testcase_03 AC 77 ms
71,240 KB
testcase_04 AC 77 ms
71,212 KB
testcase_05 AC 77 ms
71,076 KB
testcase_06 AC 82 ms
75,684 KB
testcase_07 AC 114 ms
76,744 KB
testcase_08 AC 312 ms
84,832 KB
testcase_09 AC 318 ms
85,516 KB
testcase_10 AC 294 ms
80,804 KB
testcase_11 AC 294 ms
81,148 KB
testcase_12 AC 245 ms
78,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())

ans = set()
for x in range(int(math.sqrt(n)) + 1):
  for y in range(1, int(math.sqrt(n)) + 1):
    if (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 x, y, z in ans:
  print(f"{x} {y} {z}")
0