結果
問題 | No.2358 xy+yz+zx=N |
ユーザー |
|
提出日時 | 2023-06-23 22:08:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 199 ms / 2,000 ms |
コード長 | 702 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 81,860 KB |
実行使用メモリ | 86,040 KB |
最終ジャッジ日時 | 2024-07-01 17:33:19 |
合計ジャッジ時間 | 2,586 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import syssys.setrecursionlimit(5*10**5)input = sys.stdin.readlinefrom collections import defaultdict, deque, Counterfrom heapq import heappop, heappushfrom bisect import bisect_left, bisect_rightfrom math import gcdn = int(input())sq = int(n**0.5)+5ans = set()for x in range(sq):for y in range(x, sq):if x + y == 0: continueleft = n-x*yif left < 0:breakif left % (x+y) == 0:z = left//(x+y)if z <y :breakans.add((x,y,z))ans.add((x,z,y))ans.add((y,x,z))ans.add((y,z,x))ans.add((z,x,y))ans.add((z,y,x))print(len(ans))for i in ans:print(*i)