結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
khmonos
|
| 提出日時 | 2021-02-11 08:56:41 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 859 ms |
| コンパイル使用メモリ | 96,372 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-17 18:52:40 |
| 合計ジャッジ時間 | 2,435 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
int l, n;
std::cin >> l >> n;
std::vector<int> w(n);
for (auto& x : w) {
std::cin >> x;
}
std::sort(w.begin(), w.end());
int c = 0;
for (auto x : w) {
l -= x;
if (l < 0) break;
c++;
}
std::cout << c;
return 0;
}
khmonos