結果

問題 No.2358 xy+yz+zx=N
ユーザー Basin-BugBasin-Bug
提出日時 2023-07-12 11:35:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,384 KB
実行使用メモリ 95,488 KB
最終ジャッジ日時 2023-10-12 01:46:16
合計ジャッジ時間 3,672 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,552 KB
testcase_01 AC 69 ms
71,544 KB
testcase_02 AC 69 ms
71,988 KB
testcase_03 AC 74 ms
71,384 KB
testcase_04 AC 69 ms
72,004 KB
testcase_05 AC 69 ms
71,700 KB
testcase_06 AC 72 ms
71,716 KB
testcase_07 AC 96 ms
78,040 KB
testcase_08 AC 240 ms
94,856 KB
testcase_09 AC 241 ms
95,488 KB
testcase_10 AC 204 ms
84,052 KB
testcase_11 AC 211 ms
85,996 KB
testcase_12 AC 176 ms
79,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

cnt = 0
ans = []
for x in range(int(pow(N, 0.5)) + 1):
  for y in range(x + 1):
    if x == y == 0:
      continue
    if (N - x * y) % (x + y) == 0 and (N - x * y) / (x + y) >= 0:
      ans.append([x, y, (N - x * y) // (x + y)])
      ans.append([y, x, (N - x * y) // (x + y)])
      ans.append([x, (N - x * y) // (x + y), y])
      ans.append([y, (N - x * y) // (x + y), x])
      ans.append([(N - x * y) // (x + y), x, y])
      ans.append([(N - x * y) // (x + y), y, x])
ans = list(map(list, set(map(tuple, ans))))
print(len(ans))
for i in range(len(ans)):
  print(*ans[i])
0