結果

問題 No.5 数字のブロック
ユーザー aa
提出日時 2020-04-11 11:29:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 752 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 169,120 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 00:12:06
合計ジャッジ時間 2,783 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 6 ms
4,348 KB
testcase_04 AC 5 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 5 ms
4,348 KB
testcase_07 AC 5 ms
4,348 KB
testcase_08 AC 5 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 9 ms
4,348 KB
testcase_11 AC 4 ms
4,348 KB
testcase_12 AC 6 ms
4,348 KB
testcase_13 AC 8 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 WA -
testcase_16 AC 8 ms
4,348 KB
testcase_17 AC 10 ms
4,348 KB
testcase_18 AC 9 ms
4,348 KB
testcase_19 AC 10 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *  author:   TakeruOkuyama
 *  created:  2020-04-09 14:53:46
**/
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MOD = 1000000007;

int main(){
    int L, N;
    cin >> L >> N;
    vector<int> W(N);
    rep(i, N){
        cin >> W[i];
    }
    int ans = 0;
    while(1){
        if(*min_element(W.begin(), W.end()) < L){
            L = L - *min_element(W.begin(), W.end());
            *min_element(W.begin(), W.end()) = 10001;
            ans ++;    
        }else{
            break;
        }
    }
    cout << ans << endl;
    //rep(i, N){
    //    cout<<W[i];
    //}
return 0;}

/**
 * g++ code.cpp
 * ./a.out
 * shift + ctrl + i
**/ 
0