結果
問題 | No.2358 xy+yz+zx=N |
ユーザー | lloyz |
提出日時 | 2023-06-23 23:03:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,724 ms / 2,000 ms |
コード長 | 588 bytes |
コンパイル時間 | 302 ms |
コンパイル使用メモリ | 87,152 KB |
実行使用メモリ | 85,252 KB |
最終ジャッジ日時 | 2023-09-14 10:15:50 |
合計ジャッジ時間 | 10,312 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
71,160 KB |
testcase_01 | AC | 75 ms
71,348 KB |
testcase_02 | AC | 76 ms
71,776 KB |
testcase_03 | AC | 74 ms
71,700 KB |
testcase_04 | AC | 74 ms
71,272 KB |
testcase_05 | AC | 74 ms
71,308 KB |
testcase_06 | AC | 83 ms
76,300 KB |
testcase_07 | AC | 110 ms
77,744 KB |
testcase_08 | AC | 1,724 ms
84,168 KB |
testcase_09 | AC | 1,693 ms
85,252 KB |
testcase_10 | AC | 1,702 ms
80,988 KB |
testcase_11 | AC | 1,681 ms
81,656 KB |
testcase_12 | AC | 1,319 ms
79,432 KB |
ソースコード
from math import sqrt from itertools import permutations n = int(input()) ANS = set() th1 = n // 3 th2 = (n + 2) // 3 for x in range(n + 1): if x**2 > th1: break for z in range(max(int(sqrt(th2)) - 5, x), n + 1): res = n - x * z if res < 0: break if x + z > 0 and res % (x + z) == 0: y = res // (x + z) if x <= y <= z: L = [x, y, z] for P in permutations(range(3)): ANS.add((L[P[0]], L[P[1]], L[P[2]])) print(len(ANS)) for x, y, z in ANS: print(x, y, z)