結果

問題 No.2154 あさかつの参加人数
ユーザー norikamenorikame
提出日時 2022-12-09 21:29:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 869 ms / 2,000 ms
コード長 677 bytes
コンパイル時間 3,729 ms
コンパイル使用メモリ 260,652 KB
実行使用メモリ 5,024 KB
最終ジャッジ日時 2023-08-04 22:26:52
合計ジャッジ時間 24,026 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 857 ms
4,884 KB
testcase_01 AC 869 ms
4,876 KB
testcase_02 AC 850 ms
4,956 KB
testcase_03 AC 858 ms
4,948 KB
testcase_04 AC 859 ms
4,872 KB
testcase_05 AC 144 ms
4,380 KB
testcase_06 AC 466 ms
4,376 KB
testcase_07 AC 488 ms
4,408 KB
testcase_08 AC 529 ms
4,384 KB
testcase_09 AC 316 ms
4,376 KB
testcase_10 AC 444 ms
4,380 KB
testcase_11 AC 815 ms
4,876 KB
testcase_12 AC 531 ms
4,380 KB
testcase_13 AC 244 ms
4,380 KB
testcase_14 AC 539 ms
4,384 KB
testcase_15 AC 509 ms
4,500 KB
testcase_16 AC 570 ms
4,428 KB
testcase_17 AC 544 ms
4,380 KB
testcase_18 AC 646 ms
4,396 KB
testcase_19 AC 78 ms
4,376 KB
testcase_20 AC 625 ms
4,616 KB
testcase_21 AC 294 ms
4,376 KB
testcase_22 AC 620 ms
5,024 KB
testcase_23 AC 727 ms
4,504 KB
testcase_24 AC 818 ms
4,664 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