結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 WA -
testcase_02 AC 15 ms
7,728 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 711 ms
7,900 KB
testcase_06 AC 1,447 ms
7,800 KB
testcase_07 AC 774 ms
7,748 KB
testcase_08 AC 964 ms
7,816 KB
testcase_09 WA -
testcase_10 AC 603 ms
7,804 KB
testcase_11 AC 606 ms
7,840 KB
testcase_12 AC 848 ms
7,800 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
	a,b,Y,W=A,B,r(X,B),r(X,A)
	Z=r(Y,A)
	S={X,Y,Z,W,r(W,B)}
	L=sum(x<Z for x in S)
	while a:a,b=b%a,a
	print([len(S),[(L+2*(r(Z,A//b*B)-r(Z,B)+B)//B)%998244353,1][Z%B<1]][A>b])
0