結果
| 問題 |
No.33 アメーバがたくさん
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-11-25 06:59:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 405 bytes |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 81,712 KB |
| 実行使用メモリ | 53,872 KB |
| 最終ジャッジ日時 | 2024-07-23 19:12:22 |
| 合計ジャッジ時間 | 1,168 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 8 |
ソースコード
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)
convexineq