結果

問題 No.2452 Incline
ユーザー 👑 p-adicp-adic
提出日時 2023-08-19 23:51:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 911 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-28 09:08:59
合計ジャッジ時間 6,417 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,940 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 843 ms
7,848 KB
testcase_04 AC 911 ms
7,972 KB
testcase_05 AC 864 ms
7,788 KB
testcase_06 AC 837 ms
7,972 KB
testcase_07 AC 885 ms
7,784 KB
testcase_08 AC 840 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
P=998244353
u=(P+1)//2
for t in range(int(I())):
	N,M,L,R=map(int,I().split())
	N-=1
	a,b,c,d=R//N,-((M-L)//N),-((M-R)//N),L//N
	print((M*(c-b)+R*(a-c+1)+((d+b)*(d-b+1)-(a+c)*(a-c+1))*u*N-L*(d-b+1)+a-b+1)%P)
0