結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-01-28 22:44:09 |
| 言語 | C++11(old_compat) (gcc 12.4.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| + 378µs | |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 956 ms |
| コンパイル使用メモリ | 168,816 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-28 01:17:11 |
| 合計ジャッジ時間 | 2,581 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int l, n;
while (cin>>l>>n) {
vector<int> a(n);
for(int& v: a) cin>>v;
sort(begin(a), end(a));
int s=0, i;
for(i=0;i<n;++i) if ((s+=a[i])>l) break;
cout<<i<<endl;
}
}
hogeover30