結果

問題 No.5 数字のブロック
ユーザー Series_205
提出日時 2019-10-20 15:43:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 1,452 ms
コンパイル使用メモリ 160,224 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-02 17:27:07
合計ジャッジ時間 2,610 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int l,n,a[10000],i,sum;
int main(){
    cin>>l>>n;
    for(;i<n;i++)cin>>a[i];
    sort(a,a+n);
    for(i=0;i<n&&sum<=l;i++){
        sum+-a[i];
    }cout<<i<<endl;
    return 0;
}
0