結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
higucheese_
|
| 提出日時 | 2017-06-19 20:11:31 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 395 bytes |
| 記録 | |
| コンパイル時間 | 1,658 ms |
| コンパイル使用メモリ | 183,512 KB |
| 実行使用メモリ | 10,052 KB |
| 最終ジャッジ日時 | 2026-09-08 17:36:45 |
| 合計ジャッジ時間 | 2,792 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 7 |
ソースコード
#include <bits/stdc++.h>
int main() {
int L, N;
std::vector<int> W;
scanf("%d\n", &L);
scanf("%d\n", &N);
for (int i = 0; i < N; i++) {
int temp;
scanf("%d", &temp);
W.push_back(temp);
}
std::sort(W.begin(), W.end());
int count, total = 0;
for (count = 0; count < W.size(); count++) {
total += W.at(count);
if (total >= L) break;
}
printf("%d\n", count);
return 0;
}
higucheese_