結果
| 問題 | No.674 n連勤 | 
| コンテスト | |
| ユーザー |  GB | 
| 提出日時 | 2018-07-13 00:31:31 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 382 bytes | 
| コンパイル時間 | 470 ms | 
| コンパイル使用メモリ | 55,760 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-04 18:31:02 | 
| 合計ジャッジ時間 | 2,557 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 2 RE * 1 | 
| other | WA * 10 RE * 7 | 
ソースコード
#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;
}
            
            
            
        