結果
問題 | No.156 キャンディー・ボックス |
ユーザー |
![]() |
提出日時 | 2015-10-13 11:32:50 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 256 bytes |
コンパイル時間 | 42 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-07-05 15:43:53 |
合計ジャッジ時間 | 1,297 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
N, M = map(int, raw_input().split()) boxes = map(int, raw_input().split()) boxes.sort() for i in range(1, N+1): if M < sum(boxes[:i]): ans = i-1 break elif M == sum(boxes[:i]): ans = i else: continue print ans