結果

問題 No.2154 あさかつの参加人数
ユーザー yicodeyicode
提出日時 2023-06-05 15:48:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 970 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 1,592 ms
コンパイル使用メモリ 167,888 KB
実行使用メモリ 11,124 KB
最終ジャッジ日時 2023-08-28 09:35:45
合計ジャッジ時間 26,263 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 964 ms
10,824 KB
testcase_01 AC 967 ms
11,008 KB
testcase_02 AC 949 ms
10,884 KB
testcase_03 AC 970 ms
11,124 KB
testcase_04 AC 952 ms
10,872 KB
testcase_05 AC 158 ms
5,800 KB
testcase_06 AC 524 ms
8,308 KB
testcase_07 AC 562 ms
7,520 KB
testcase_08 AC 593 ms
7,588 KB
testcase_09 AC 351 ms
5,156 KB
testcase_10 AC 495 ms
6,976 KB
testcase_11 AC 814 ms
9,812 KB
testcase_12 AC 579 ms
8,108 KB
testcase_13 AC 269 ms
5,940 KB
testcase_14 AC 591 ms
8,296 KB
testcase_15 AC 566 ms
7,204 KB
testcase_16 AC 653 ms
8,800 KB
testcase_17 AC 615 ms
8,832 KB
testcase_18 AC 741 ms
9,304 KB
testcase_19 AC 83 ms
4,376 KB
testcase_20 AC 697 ms
8,624 KB
testcase_21 AC 321 ms
4,944 KB
testcase_22 AC 633 ms
6,980 KB
testcase_23 AC 729 ms
9,092 KB
testcase_24 AC 837 ms
10,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
long long GCD(long long a,long long b) {
  if(a%b == 0) return b;
  return GCD(b,a%b);
}
int main() {
  long long N,M; cin >> N >> M;
  vector<pair<int,int>> A(M);
  vector<int> X(N + 1,0);
  for(int i = 0; i < M; i++) {
    int a,b; cin >> a >> b;
    A[i] = {a,b};
    X[b]++;
    X[a + 1]--;
  }
  
  vector<int> Q(N + 1,0);
  for(int i = 1; i <= N; i++) {
    Q[i] = Q[i - 1] + X[i];
  }
  for(int i = N; i >= 1; i--) {
    cout << Q[i] << endl;
  }
}
0