結果

問題 No.5 数字のブロック
ユーザー lemon
提出日時 2018-10-31 17:31:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 609 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 54,352 KB
実行使用メモリ 16,968 KB
最終ジャッジ日時 2024-11-19 12:33:46
合計ジャッジ時間 211,840 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 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;
    
    for (;;){
        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;
                max = 0;
                cnt = 0;
            }
        }
    }
}
0