結果

問題 No.5 数字のブロック
ユーザー lemon
提出日時 2018-10-31 17:39:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 55,352 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-19 12:35:21
合計ジャッジ時間 1,807 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int box;
    int block;
    int block_size;
    int sum = 0;
    int cnt = 0;
    int max = 0;
    
    cin >> box;
    cin >> block;
        
    for (int i = 0; i < block; i++) {
    cin >> block_size;
        sum += block_size;
        if (box >= block_size) {
            cnt++;
        } else {
            if (max < cnt) {
                max = cnt;
            }
        }
    cout << max << endl;
    }

}
0