結果
問題 |
No.33 アメーバがたくさん
|
ユーザー |
![]() |
提出日時 | 2020-11-25 07:01:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 82,532 KB |
実行使用メモリ | 53,624 KB |
最終ジャッジ日時 | 2024-07-23 19:12:23 |
合計ジャッジ時間 | 1,219 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 3 |
ソースコード
n,d,t = map(int,input().split()) *x, = map(int,input().split()) dic = {} for xi in x: pi,qi = xi//d,xi%d if qi in dic: dic[qi].append(pi) else: dic[qi] = [pi] ans = 0 for lst in dic.values(): st = [] for i in lst: if st and st[-1][1] >= i-t: st[-1][1] = i+t else: st.append([i-t,i+t]) for L,R in st: ans += R-L+1 print(ans)