結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
xecual
|
| 提出日時 | 2019-04-01 00:36:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 1,284 ms |
| コンパイル使用メモリ | 214,808 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-07 09:32:01 |
| 合計ジャッジ時間 | 2,830 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(x) cerr << x << '\n'
#define all(x) (x).begin(), (x).end()
#define exist(s, e) ((s).fine(e) != (s).end())
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll l, n;
cin >> l >> n;
vector<int> w(n);
for (ll i = 0;i < n;i++) {
cin >> w[i];
}
sort(all(w));
ll i = 0;
for (ll tmp = 0;tmp <= l && i < n;tmp += w[i++]) ;
cout << i-1;
return 0;
}
xecual