結果

問題 No.156 キャンディー・ボックス
ユーザー a_tena_ten
提出日時 2016-03-23 19:21:31
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 234 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-09 21:10:26
合計ジャッジ時間 10,641 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
13,756 KB
testcase_01 AC 12 ms
6,944 KB
testcase_02 AC 12 ms
6,944 KB
testcase_03 AC 11 ms
6,940 KB
testcase_04 AC 10 ms
6,944 KB
testcase_05 AC 213 ms
6,940 KB
testcase_06 AC 527 ms
6,940 KB
testcase_07 AC 387 ms
6,940 KB
testcase_08 AC 281 ms
6,944 KB
testcase_09 AC 167 ms
6,940 KB
testcase_10 AC 347 ms
6,940 KB
testcase_11 AC 169 ms
6,940 KB
testcase_12 AC 485 ms
6,940 KB
testcase_13 AC 309 ms
6,944 KB
testcase_14 AC 167 ms
6,940 KB
testcase_15 AC 356 ms
6,944 KB
testcase_16 AC 174 ms
6,940 KB
testcase_17 AC 299 ms
6,944 KB
testcase_18 AC 159 ms
6,940 KB
testcase_19 AC 185 ms
6,940 KB
testcase_20 AC 15 ms
6,940 KB
testcase_21 AC 56 ms
6,940 KB
testcase_22 AC 146 ms
6,940 KB
testcase_23 AC 75 ms
6,940 KB
testcase_24 AC 11 ms
6,944 KB
testcase_25 AC 11 ms
6,940 KB
testcase_26 AC 11 ms
6,940 KB
testcase_27 AC 11 ms
6,944 KB
testcase_28 AC 11 ms
6,940 KB
testcase_29 AC 10 ms
6,944 KB
testcase_30 AC 914 ms
6,940 KB
testcase_31 AC 639 ms
6,940 KB
testcase_32 TLE -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding:utf-8

from heapq import heapify,heappop,heappush

N,M=map(int,raw_input().split())
C=map(int,raw_input().split())
C1=C

heapify(C)

cnt=0
while M:
	s=heappop(C)
	s-=1
	M-=1
	if s!=0:
		heappush(C,s)
	else:
		cnt+=1

print cnt
0