結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
ichiruisyu
|
| 提出日時 | 2016-07-04 12:03:05 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 351 bytes |
| 記録 | |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 64,888 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-29 23:44:52 |
| 合計ジャッジ時間 | 5,699 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 34 |
ソースコード
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int L, N;
vector<int> W;
scanf("%d%d", &L, &N);
for (int i = 0; i < N; i++) {
scanf("%d", &W);
}
sort(W.begin(), W.end(), less<int>());
int ans = 0;
for (; ans < N; ans++) {
L -= W[ans];
if (L < 0) break;
}
printf("%d", ans);
return 0;
}
ichiruisyu