結果
問題 |
No.3039 配信者
|
ユーザー |
![]() |
提出日時 | 2025-03-29 16:40:13 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 301 ms / 2,000 ms |
コード長 | 1,299 bytes |
コンパイル時間 | 6,192 ms |
コンパイル使用メモリ | 332,460 KB |
実行使用メモリ | 24,708 KB |
最終ジャッジ日時 | 2025-03-29 16:40:27 |
合計ジャッジ時間 | 13,494 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; // デバッグ用 #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif #define nall(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define YES cout << "Yes\n" #define NO cout << "No\n" #define YN {cout << "Yes\n";}else{cout << "No\n";} #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define PRECISION(x) cout << fixed << setprecision(x) #define endl '\n' #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define each(o, a) for (auto &o : a) using ll = long long; using ld = long double; using ull = unsigned long long; template<typename T> using vc = vector<T>; template<typename T> using vv = vc<vc<T>>; using vi = vc<int>; using pii = pair<int, int>; using pll = pair<ll, ll>; using vl = vc<ll>; using vvl = vv<ll>; using vvvl = vv<vl>; const int MOD = 998244353; void solve() { ll n, h; cin >> n >> h; vl a(n), b(n), table(h+9); rep (i, n) { cin >> a[i] >> b[i]; table[a[i]]++; table[b[i] + 1]--; } ll ans = 0, tmp = 0; rep (i, h) { tmp += table[i]; chmax(ans, tmp); } cout << ans << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }