結果
| 問題 | No.2358 xy+yz+zx=N |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-07 12:24:15 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 156 ms / 2,000 ms |
| コード長 | 514 bytes |
| 記録 | |
| コンパイル時間 | 330 ms |
| コンパイル使用メモリ | 84,716 KB |
| 実行使用メモリ | 86,548 KB |
| 最終ジャッジ日時 | 2026-04-03 03:50:39 |
| 合計ジャッジ時間 | 5,273 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
from itertools import permutations
def make_divisors_pairs(n): #約数のペアを作る O(sqrt(n))
divisors = []
i = 1
while i*i <= n:
if n % i == 0:
divisors.append([i,n//i])
i += 1
return divisors
N = int(input())
ans = set()
for x in range(int((N/3)**(1/2))+10):
for p, q in make_divisors_pairs(N+x*x):
if p-x >= 0 and q-x >= 0:
for per in permutations((x, p-x, q-x)):
ans.add(per)
print(len(ans))
for a in ans:
print(*a)