結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2020-07-17 20:25:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 575 bytes |
コンパイル時間 | 3,428 ms |
コンパイル使用メモリ | 230,228 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 16:53:00 |
合計ジャッジ時間 | 4,620 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 WA * 7 |
ソースコード
//debug #define _GLIBCXX_DEBUG //include #include <bits/stdc++.h> //using using namespace std; using ll = long long; //define #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define inf 1e9 //function void solve() { int l; cin >> l; int n; cin >> n; vector<int> w(n); rep(i, n) cin >> w[i]; sort(all(w)); int ans = 0; rep(i, n) { l -= w[i]; if (l <= 0) break; ans++; } cout << ans << endl; return; } //main int main() { solve(); return 0; }