結果
問題 | No.33 アメーバがたくさん |
ユーザー | convexineq |
提出日時 | 2020-11-25 07:01:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 273 ms |
コンパイル使用メモリ | 87,244 KB |
実行使用メモリ | 71,628 KB |
最終ジャッジ日時 | 2023-10-01 01:40:00 |
合計ジャッジ時間 | 1,881 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,216 KB |
testcase_01 | AC | 73 ms
71,160 KB |
testcase_02 | AC | 81 ms
71,140 KB |
testcase_03 | AC | 77 ms
71,140 KB |
testcase_04 | AC | 73 ms
71,224 KB |
testcase_05 | AC | 76 ms
71,136 KB |
testcase_06 | WA | - |
testcase_07 | AC | 74 ms
71,100 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 73 ms
71,156 KB |
ソースコード
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)