結果
問題 | No.156 キャンディー・ボックス |
ユーザー |
![]() |
提出日時 | 2016-02-27 15:43:14 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 229 bytes |
コンパイル時間 | 43 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-07-05 15:47:20 |
合計ジャッジ時間 | 1,272 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
# -*- coding: utf-8 -*-N, M = map(int, raw_input().split())C = map(int, raw_input().split())C.sort()tot = 0cnt = 0while tot < M and cnt != N:tot += C[cnt]cnt += 1if M == tot:print cntelse:print cnt - 1