結果

問題 No.2941 Sigma Music Game Score Problem
ユーザー ニックネームニックネーム
提出日時 2024-10-18 21:54:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,440 ms / 2,500 ms
コード長 193 bytes
コンパイル時間 3,432 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 127,088 KB
最終ジャッジ日時 2024-10-18 22:42:45
合計ジャッジ時間 15,163 ms
ジャッジサーバーID
(参考情報)
judge7 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 28 ms
10,496 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 29 ms
10,752 KB
testcase_06 AC 28 ms
10,624 KB
testcase_07 AC 29 ms
10,624 KB
testcase_08 AC 28 ms
10,752 KB
testcase_09 AC 36 ms
11,520 KB
testcase_10 AC 32 ms
10,880 KB
testcase_11 AC 33 ms
11,008 KB
testcase_12 AC 32 ms
10,880 KB
testcase_13 AC 37 ms
11,520 KB
testcase_14 AC 41 ms
11,776 KB
testcase_15 AC 31 ms
10,880 KB
testcase_16 AC 1,044 ms
95,596 KB
testcase_17 AC 1,155 ms
109,468 KB
testcase_18 AC 1,350 ms
116,144 KB
testcase_19 AC 1,097 ms
96,192 KB
testcase_20 AC 886 ms
81,572 KB
testcase_21 AC 411 ms
39,136 KB
testcase_22 AC 425 ms
43,256 KB
testcase_23 AC 405 ms
39,524 KB
testcase_24 AC 1,293 ms
122,704 KB
testcase_25 AC 182 ms
22,148 KB
testcase_26 AC 29 ms
10,752 KB
testcase_27 AC 30 ms
10,624 KB
testcase_28 AC 27 ms
10,624 KB
testcase_29 AC 397 ms
49,104 KB
testcase_30 AC 571 ms
78,680 KB
testcase_31 AC 1,427 ms
127,088 KB
testcase_32 AC 1,440 ms
126,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

m,n = map(int,input().split())
x = [0]+list(map(int,input().split()))+[m+1]
s = 0; o = 998244353; z = pow(6,-1,o)
for i in range(n+1): d = x[i+1]-x[i]-1; s += d*(d+1)%o*(2*d+1)%o*z%o
print(s%o)
0