結果

問題 No.5 数字のブロック
ユーザー reo85
提出日時 2021-03-10 01:39:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 1,701 ms
コンパイル使用メモリ 171,152 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 17:58:03
合計ジャッジ時間 3,039 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int L,N;
    cin>> L >> N;
    vector<int> wide(N);
    for(int i=0;i<N;i++){
        cin >> wide[i];
    }
    
    sort(wide.begin(),wide.end());
    int count = 0;
    int ans = 0;
    for(int i=0;i<N;i++){
        count += wide[i];
        if(count >= L){
            cout << ans <<endl;
            break;
        }
        cout << ans <<endl;
    }
        
    return 0;
}
0