結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-26 01:46:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 1,366 ms |
| コンパイル使用メモリ | 214,692 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-03 21:13:45 |
| 合計ジャッジ時間 | 2,656 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
int l,n;
cin>>l>>n;
vector<int> w(n);
rep(i,n) cin>>w[i];
sort(w.begin(),w.end());
int sum=0,ans=0;
int i=0;
while(sum<l){
ans=i;
sum+=w[i];
i++;
}
cout<<ans<<endl;
return 0;
}