結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
yu_ji_n_0412
|
| 提出日時 | 2017-08-30 20:20:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 255 bytes |
| コンパイル時間 | 590 ms |
| コンパイル使用メモリ | 59,528 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-06 14:33:09 |
| 合計ジャッジ時間 | 1,735 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 14 |
ソースコード
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int l, n, w[10000], cnt=0, x=0;
cin>>l>>n;
for(int i=0;i<n;i++) cin>>w[i];
sort(w, w+n);
while(x<l){
x+=w[cnt];
cnt++;
}
cout<<cnt-1<<endl;
return 0;
}
yu_ji_n_0412