結果

問題 No.33 アメーバがたくさん
ユーザー yaoshimaxyaoshimax
提出日時 2015-02-15 15:45:15
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 483 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 7,124 KB
実行使用メモリ 6,460 KB
最終ジャッジ日時 2023-10-24 17:43:57
合計ジャッジ時間 761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,460 KB
testcase_01 AC 11 ms
6,460 KB
testcase_02 AC 11 ms
6,460 KB
testcase_03 AC 10 ms
6,460 KB
testcase_04 AC 10 ms
6,460 KB
testcase_05 AC 11 ms
6,460 KB
testcase_06 AC 11 ms
6,460 KB
testcase_07 AC 12 ms
6,460 KB
testcase_08 AC 11 ms
6,460 KB
testcase_09 AC 11 ms
6,460 KB
testcase_10 AC 12 ms
6,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,T=map(int,raw_input().split())
X=map(int,raw_input().split())
lists=[]
for x in X:
    lists.append((x%D,x))
lists.sort()
ans=N+T*2
for i in range(N-1):
    if lists[i][0] != lists[i+1][0]:
        ans += T*2
    elif lists[i+1][1]-lists[i][1] >= (2*T+1)*D:
        #print lists[i][j],'-',lists[i][j+1],"=",T*2
        ans += T*2
    else:
        #print lists[i][j],'-',lists[i][j+1],"=", (lists[i][j+1]-lists[i][j])/D-1
        ans += (lists[i+1][1]-lists[i][1])/D-1
print ans
0