結果
| 問題 |
No.156 キャンディー・ボックス
|
| コンテスト | |
| ユーザー |
あかりき
|
| 提出日時 | 2021-02-09 21:58:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 220 bytes |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 82,224 KB |
| 実行使用メモリ | 52,096 KB |
| 最終ジャッジ日時 | 2024-07-07 03:56:22 |
| 合計ジャッジ時間 | 2,630 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
n,m=map(int,input().split())
c=list(map(int,input().split()))
c.sort()
ans=0
for i in range(n):
if m>c[i]:
m-=c[i]
ans+=1
elif m==c[i]:
print(ans+1)
exit()
else:
print(ans)
exit()
print(ans)
あかりき