結果
| 問題 |
No.2358 xy+yz+zx=N
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-12 11:35:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 222 ms / 2,000 ms |
| コード長 | 615 bytes |
| コンパイル時間 | 441 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 95,040 KB |
| 最終ジャッジ日時 | 2024-09-14 01:35:56 |
| 合計ジャッジ時間 | 2,926 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
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])