結果

問題 No.674 n連勤
ユーザー ei1333333ei1333333
提出日時 2017-05-06 03:54:37
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 2,525 ms
コンパイル使用メモリ 150,968 KB
実行使用メモリ 4,800 KB
最終ジャッジ日時 2023-10-12 13:18:06
合計ジャッジ時間 4,357 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
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 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int64 D, Q, A[30000], B[30000];
  vector< int64 > nums;
  int64 touch[600000] = {};


  scanf("%lld %lld", &D, &Q);
  for(int i = 0; i < Q; i++) {
    scanf("%lld %lld", &A[i], &B[i]);
    nums.push_back(A[i] - 1);
    nums.push_back(A[i]);
    nums.push_back(B[i]);
  }

  sort(begin(nums), end(nums));
  nums.erase(unique(begin(nums), end(nums)), end(nums));

  for(int i = 0; i < Q; i++) {
    A[i] = lower_bound(begin(nums), end(nums), A[i]) - begin(nums);
    B[i] = lower_bound(begin(nums), end(nums), B[i]) - begin(nums);
  }

  int64 ret = 0;
  for(int i = 0; i < Q; i++) {
    int last = -1;
    for(int64 j = 0; j < nums.size(); j++) {
      if(A[i] <= j && j <= B[i]) touch[j] = true;
    }
    printf("%lld\n", ret);
  }
}
0