結果

問題 No.2128 Round up!!
ユーザー 👑 p-adicp-adic
提出日時 2023-06-22 21:08:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-09-12 15:27:01
合計ジャッジ時間 9,243 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,804 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 803 ms
7,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
def r(X,A):
	return(X+A-1)//A*A
for t in range(int(I())):
	X,A,B=map(int,I().split())
	if A>B:A,B=B,A
	Y,W=r(X,B),r(X,A)
	Z=r(Y,A)
	L=len({X,Y,Z,W,r(W,B)})
	a,b=A,B
	while a:a,b=b%a,a
	B//=b
	Z//=b
	print([[(L-1+2*(r(Z,A//b*B)-r(Z,B)+B)//B)%998244353,1][Z%B<1],L][A<b*2])
0