結果
問題 | No.5 数字のブロック |
ユーザー |
|
提出日時 | 2017-03-07 13:08:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 325 bytes |
コンパイル時間 | 778 ms |
コンパイル使用メモリ | 75,456 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 17:00:43 |
合計ジャッジ時間 | 1,776 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 10 |
ソースコード
#include<iostream>#include<vector>#include<algorithm>using namespace std;int main(){int l, n, tmp;vector<int> w;cin >> l >> n;for(int i = 0; i < n; i++){cin >> tmp;w.push_back(tmp);}sort(w.begin(), w.end());int sum = 0;for(int i = 0; i <= l; sum++){i += w[sum];}cout << --sum << endl;}