結果
問題 |
No.33 アメーバがたくさん
|
ユーザー |
👑 |
提出日時 | 2022-07-10 14:25:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 418 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2025-01-03 02:57:46 |
合計ジャッジ時間 | 1,753 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
n, d, t = map(int, input().split()) pos = {} X = list(map(int, input().split())) for x in X: p = x % d x //= d mi = x - t ma = x + t if p not in pos: pos[p] = {} pos[p][mi] = pos[p].get(mi, 0) + 1 pos[p][ma + 1] = pos[p].get(ma + 1 , 0) - 1 ans = 0 for dic in pos.values(): bef = -1 tot = 0 for k in sorted(dic.keys()): v = dic[k] if tot > 0: ans += k - bef bef = k tot += v print(ans)