結果

問題 No.3039 配信者
ユーザー Carpenters-Cat
提出日時 2025-02-28 21:37:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 739 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 1,941 ms
コンパイル使用メモリ 194,904 KB
実行使用メモリ 6,888 KB
最終ジャッジ日時 2025-02-28 21:37:57
合計ジャッジ時間 9,817 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main () {
	int N, H;
	cin >> N >> H;
	std::vector<int> A(H + 1, 0);
	for (int i = 0; i < N; i ++) {
		int a, b;
		cin >> a >> b;
		A[a] ++;
		A[++b] --;
	}
	int ans = 0;
	int s = 0;
	for (auto& a : A) {
		s += a;
		ans = max(ans, s);
	}
	cout << ans << endl;
}
0