結果
問題 |
No.156 キャンディー・ボックス
|
ユーザー |
![]() |
提出日時 | 2015-07-02 08:04:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 225 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 55,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 21:50:20 |
合計ジャッジ時間 | 1,219 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 WA * 2 |
ソースコード
#include<iostream> using namespace std; int main(){ int n, m, c, emptyBox = 0; cin >> n >> m; for (int i = 0; i < n; i++){ cin >> c; if (m >= c){ m -= c; emptyBox++; } } cout << emptyBox << endl; return 0; }