結果

問題 No.674 n連勤
ユーザー gaming1106
提出日時 2018-07-13 00:33:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 55,828 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 18:39:28
合計ジャッジ時間 2,016 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 RE * 1
other WA * 10 RE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main(){

  int D,Q,A,B,j=1,a=0,count=0;
  cin>>D>>Q;
  int *task=new int[D];
  for(int i=0;i<D;i++){
    task[i]=0;
  }
  
  while(a<Q){
    count=0;
    cin>>A>>B;
    for(int k=A;k<B;k++){
      task[k]++;
    }
    for(int k=0;k<D;k++){
      if(task[k]==j)count++;
    }
    j++;
    a++;
    cout<<count<<endl;
  }
  
  return 0;
}
0