結果

問題 No.33 アメーバがたくさん
ユーザー pluto77pluto77
提出日時 2018-02-15 15:39:15
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 6,728 KB
実行使用メモリ 6,108 KB
最終ジャッジ日時 2023-08-26 21:56:40
合計ジャッジ時間 1,417 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,944 KB
testcase_01 AC 10 ms
5,904 KB
testcase_02 AC 10 ms
5,936 KB
testcase_03 AC 10 ms
5,932 KB
testcase_04 AC 10 ms
6,028 KB
testcase_05 AC 10 ms
5,948 KB
testcase_06 AC 10 ms
5,940 KB
testcase_07 AC 10 ms
5,884 KB
testcase_08 AC 11 ms
5,840 KB
testcase_09 AC 10 ms
6,108 KB
testcase_10 AC 10 ms
6,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d,t=map(int, raw_input().split())
dic=dict()
for i in map(int,raw_input().split()):
 j=(i%d+d)%d
 if j in dic:
  dic[j].append(i)
 else:
  dic[j]=[i]
res=0
for k,v in dic.items():
 v.sort()
 res+=len(v)+t*2
 for i in xrange(len(v)-1):
  if v[i]+t*d<v[i+1]-t*d:
   res+=t*2
  else:
   res+=(v[i+1]-v[i])/d-1
print res
0