結果
問題 |
No.2358 xy+yz+zx=N
|
ユーザー |
![]() |
提出日時 | 2023-06-26 23:05:05 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 733 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 82,392 KB |
実行使用メモリ | 82,476 KB |
最終ジャッジ日時 | 2024-07-03 18:08:32 |
合計ジャッジ時間 | 3,343 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 6 |
ソースコード
N = int(input()) x = 0 tmp = [] while 3 * x * x <= N: y = x if x == 0: y = 1 while y * (2 * x + y) <= N: if (N - x * y) % (x + y) == 0: z = (N - x * y) // (x + y) if x == y == z: tmp.append((x, x, x)) elif x == y or y == z: tmp.append((x, x, z)) tmp.append((x, z, x)) tmp.append((z, x, x)) else: tmp.append((x, y, z)) tmp.append((x, z, y)) tmp.append((y, x, z)) tmp.append((y, z, x)) tmp.append((z, x, y)) tmp.append((z, y, x)) y += 1 x += 1 print(len(tmp)) for t in tmp: print(*t)