結果

問題 No.674 n連勤
ユーザー GBGB
提出日時 2018-07-13 00:31:31
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 54,844 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 05:43:32
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

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