結果
問題 |
No.2128 Round up!!
|
ユーザー |
|
提出日時 | 2022-11-19 16:17:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-20 16:10:11 |
合計ジャッジ時間 | 6,609 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 12 |
ソースコード
import math t=int(input()) for _ in range(t): x,a,b=map(int,input().split()) if a==b: print(1) continue if a<b: a,b=b,a l=a*b//math.gcd(a,b) y=((x+l-1)//l)*l ans=2*(y//a-(x-1)//a)-1 z=((x+a-1)//a)*a if x%b>=z%b: ans+=1 if x%a>0 and x%b>0: ans+=1 print(ans%998244353)