結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-12 14:36:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 571 ms |
| コンパイル使用メモリ | 71,520 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-22 04:10:46 |
| 合計ジャッジ時間 | 1,533 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 7 |
ソースコード
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int L,N;
cin >> L;
cin >> N;
vector<int> W(N);
for (int i = 0; i < N; i++) cin >> W[i];
sort(W.begin(),W.end());
int ret = 0;
while (L>0) L -= W[ret++];
if (L<0) ret--;
cout << ret << endl;
return 0;
}