結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-31 21:45:25 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 333 bytes |
| 記録 | |
| コンパイル時間 | 3,425 ms |
| コンパイル使用メモリ | 357,084 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-31 21:45:33 |
| 合計ジャッジ時間 | 5,216 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int l,n; cin>>l>>n;
vector<int> a(n);
for(int i=0; i<n; i++) {
cin>>a[i];
}
int sum = 0;
int ans = 0;
sort(a.begin(), a.end());
while(sum<l){
sum+=a[ans];
ans++;
}
cout<<ans-1<<endl;
}