結果

問題 No.5 数字のブロック
ユーザー kei001
提出日時 2018-01-19 12:55:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 54,444 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 12:01:47
合計ジャッジ時間 1,615 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
static const int N = 10000;
int main(void){
  int l, n, w[N];

  cin >> l >> n;
  for(int i=0;i<n;i++) cin >> w[i];
  int block = 0, cnt = 1;
  for(int i=0;i<n;i++){
    block += w[i];
    while(block > l){
      block -= l; cnt++;
    }
  }

  cout << cnt << endl;  
}
0