結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 661 ms
7,828 KB
testcase_06 AC 1,406 ms
7,828 KB
testcase_07 AC 723 ms
7,852 KB
testcase_08 AC 929 ms
7,816 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 804 ms
7,816 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=r(X,B)
	Z=r(Y,A)
	L=len({X,r(X,A),Y,Z})
	a,b=A,B
	while a:a,b=b%a,a
	A//=b
	B//=b
	print([L,[(L-1+2*(r(Z//b,A*B)-r(Z//b,B)+B)//B)%998244353,1][X%B<1]][A>1])
0