結果

問題 No.2154 あさかつの参加人数
ユーザー norikamenorikame
提出日時 2022-12-09 21:29:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,019 ms / 2,000 ms
コード長 677 bytes
コンパイル時間 4,642 ms
コンパイル使用メモリ 253,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 20:44:08
合計ジャッジ時間 26,222 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 991 ms
5,376 KB
testcase_01 AC 1,011 ms
5,376 KB
testcase_02 AC 1,011 ms
5,376 KB
testcase_03 AC 1,019 ms
5,376 KB
testcase_04 AC 999 ms
5,376 KB
testcase_05 AC 174 ms
5,376 KB
testcase_06 AC 570 ms
5,376 KB
testcase_07 AC 576 ms
5,376 KB
testcase_08 AC 617 ms
5,376 KB
testcase_09 AC 365 ms
5,376 KB
testcase_10 AC 500 ms
5,376 KB
testcase_11 AC 887 ms
5,376 KB
testcase_12 AC 612 ms
5,376 KB
testcase_13 AC 286 ms
5,376 KB
testcase_14 AC 621 ms
5,376 KB
testcase_15 AC 583 ms
5,376 KB
testcase_16 AC 699 ms
5,376 KB
testcase_17 AC 659 ms
5,376 KB
testcase_18 AC 777 ms
5,376 KB
testcase_19 AC 84 ms
5,376 KB
testcase_20 AC 731 ms
5,376 KB
testcase_21 AC 317 ms
5,376 KB
testcase_22 AC 640 ms
5,376 KB
testcase_23 AC 769 ms
5,376 KB
testcase_24 AC 893 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

using ll = long long;

#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#define all(x) (x).begin(), (x).end()

const int INF = (int)(1e9);

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> sub(n+1);
	rep(i, m) {
		int li, ri;
		cin >> li >> ri;
		li = -li + n, ri = -ri + n + 1;
		sub[li]++;
		sub[ri]--;
	}
	rep(i, n) sub[i+1] += sub[i];
	rep(i, n) cout << sub[i] << endl;
	return 0;
}
0