結果
| 問題 | No.2603 Tone Correction |
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2024-01-13 02:18:49 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 190 ms / 2,000 ms |
| コード長 | 230 bytes |
| 記録 | |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 135,572 KB |
| 最終ジャッジ日時 | 2026-04-14 18:11:04 |
| 合計ジャッジ時間 | 5,794 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
n,m = map(int,input().split()) a = [0]+list(map(int,input().split()))+[0] b = [0]+list(map(int,input().split()))+[0] d = sorted((b[i+1]-a[i+1]-b[i]+a[i])%m for i in range(n+1)) c = sum(d)//m print((sum(d[:-c])+c*m-sum(d[-c:]))//2)
ニックネーム