結果
問題 | No.2358 xy+yz+zx=N |
ユーザー | Alex Wice |
提出日時 | 2023-06-23 22:20:53 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 202 ms / 2,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 369 ms |
コンパイル使用メモリ | 87,128 KB |
実行使用メモリ | 86,988 KB |
最終ジャッジ日時 | 2023-09-14 10:10:50 |
合計ジャッジ時間 | 3,063 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
71,792 KB |
testcase_01 | AC | 72 ms
71,944 KB |
testcase_02 | AC | 73 ms
71,560 KB |
testcase_03 | AC | 71 ms
71,880 KB |
testcase_04 | AC | 74 ms
71,860 KB |
testcase_05 | AC | 78 ms
71,668 KB |
testcase_06 | AC | 73 ms
71,672 KB |
testcase_07 | AC | 100 ms
77,080 KB |
testcase_08 | AC | 200 ms
86,324 KB |
testcase_09 | AC | 202 ms
86,988 KB |
testcase_10 | AC | 177 ms
81,036 KB |
testcase_11 | AC | 185 ms
81,980 KB |
testcase_12 | AC | 163 ms
78,976 KB |
ソースコード
N = int(input()) ans = [] for x in range(1, int(N**0.5) + 1): top = int((x * x + N) ** 0.5) - x for y in range(x, top + 1): numer = N - x * y if numer % (x + y) == 0: z = numer // (x + y) ans.append((x, y, z)) if N % x == 0: y = N // x if x <= y: ans.append((0, x, y)) fans = set() for x, y, z in ans: fans.add((x, y, z)) fans.add((x, z, y)) fans.add((y, x, z)) fans.add((y, z, x)) fans.add((z, x, y)) fans.add((z, y, x)) print(len(fans)) for t in fans: print(*t)