結果
問題 | No.2128 Round up!! |
ユーザー |
![]() |
提出日時 | 2022-11-18 22:56:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 347 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-09-20 03:24:57 |
合計ジャッジ時間 | 6,358 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 8 |
ソースコード
from math import gcdfor _ in range(int(input())):x, a, b = map(int, input().split())if a == b: print((x%a!=0)+1); continueif a > b: a, b = b, am = a*b//gcd(a, b)n = (x-1+m)//m*mc = (x-1+a)//a*ad = (x-1+b)//b*bif x == d: ans = 1elif x == c or d <= c: ans = 2else: ans = 3print(ans+(n-d)//b*2)