結果
| 問題 |
No.2953 Maximum Right Triangle
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-08 21:24:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 269 bytes |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 52,992 KB |
| 最終ジャッジ日時 | 2024-11-08 21:24:26 |
| 合計ジャッジ時間 | 1,102 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 6 |
ソースコード
from math import gcd T=int(input()) for i in range(T): D,x,y=map(int,input().split()) if x==0 or y==0: print(max(x,y)*D) continue a,b=x//gcd(x,y),y//gcd(x,y) s=min(x//b,(D-y)//a) t=min(y//a,(D-x)//b) use=max(s,t) px=x-b*use py=y+a*use print(abs(px*y-py*x))