結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
kaage
|
| 提出日時 | 2018-07-14 21:27:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 418 bytes |
| コンパイル時間 | 567 ms |
| コンパイル使用メモリ | 67,808 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 20:43:11 |
| 合計ジャッジ時間 | 1,576 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdlib>
#include<ctime>
using namespace std;
typedef long long ll;
int main() {
int l, n, a[10010], ans = 0;
cin >> l >> n;
for (int i = 0; i < n; i++)cin >> a[i];
sort(a, a + n);
for (int i = 0;; i++) {
l -= a[i];
if (l < 0)break;
ans++;
}
cout << ans << endl;
return 0;
}
kaage