結果
問題 | No.2358 xy+yz+zx=N |
ユーザー |
![]() |
提出日時 | 2023-06-23 22:34:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 534 ms / 2,000 ms |
コード長 | 585 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,172 KB |
実行使用メモリ | 86,968 KB |
最終ジャッジ日時 | 2024-07-01 17:39:58 |
合計ジャッジ時間 | 3,979 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import mathN=int(input())lis=[]for x in range(math.ceil(math.sqrt(N))+1):for y in range(x,math.ceil(math.sqrt(N))+1):if x==0 and y==0:continue#print(x,y)z=-1if (N-x*y)>0 and (N-x*y)/(x+y)%1==0:z=(N-x*y)//(x+y)elif N-x*y==0:z=0if z!=-1:lis.append((x,y,z))lis.append((x,z,y))lis.append((y,x,z))lis.append((y,z,x))lis.append((z,x,y))lis.append((z,y,x))lis=set(lis)print(len(lis))for l in lis:print(*l)