結果
| 問題 |
No.2941 Sigma Music Game Score Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-30 12:33:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 479 ms / 2,500 ms |
| コード長 | 197 bytes |
| コンパイル時間 | 704 ms |
| コンパイル使用メモリ | 82,492 KB |
| 実行使用メモリ | 261,184 KB |
| 最終ジャッジ日時 | 2024-11-30 12:33:18 |
| 合計ジャッジ時間 | 10,323 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 29 |
ソースコード
m,n=map(int,input().split()) A=[0]+list(map(int,input().split())) A.append(m+1) n+=2 ans=0 for i in range(1,n): ans+=(A[i]-A[i-1]-1)*(A[i]-A[i-1])*(2*(A[i]-A[i-1])-1)//6 ans%=998244353 print(ans)