結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-01-28 22:44:09 |
| 言語 | C++11(old_compat) (gcc 12.4.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 5,000 ms |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 1,170 ms |
| コンパイル使用メモリ | 170,812 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-08 16:01:11 |
| 合計ジャッジ時間 | 2,669 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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