結果
問題 |
No.156 キャンディー・ボックス
|
ユーザー |
|
提出日時 | 2015-05-28 23:24:36 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 245 bytes |
コンパイル時間 | 64 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-06 10:10:24 |
合計ジャッジ時間 | 1,513 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | AC * 2 RE * 28 |
ソースコード
# -*- coding:utf-8 -*- if __name__ == "__main__": n,m = map(int,raw_input().split()) cands = map(int,raw_input().split()) cands.sort() sum = 0 ans = 0 while ans <= n: sum += cands[ans] if sum > m: break elf ans += 1 print ans