結果
| 問題 |
No.3039 配信者
|
| ユーザー |
|
| 提出日時 | 2025-03-20 15:19:11 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,201 ms / 2,000 ms |
| コード長 | 4,492 bytes |
| コンパイル時間 | 6,666 ms |
| コンパイル使用メモリ | 334,052 KB |
| 実行使用メモリ | 38,004 KB |
| 最終ジャッジ日時 | 2025-03-20 15:19:33 |
| 合計ジャッジ時間 | 20,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
//loop
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP2(i, s, n) for (ll i = s; i < (ll)n; i++)
#define REP3(v, A) for(auto v: A)
#define REP4(It, A) for (auto It=A.begin();It!=A.end();++It)
#define REP5(i, n) for (ll i = 0; i * i < (ll)(n); i++)
//vector
#define ALL(A) A.begin(), A.end()
#define RV(A) reverse(ALL(A))
#define RALL(A) A.rbegin(), A.rend()
#define SORT(A) sort(ALL(A))
#define RSORT(A) sort(RALL(A))
template<class T> inline void getSum(T& a,vector<T> b) {for(auto v:b) a+=v;}
//input
template<class T> inline void input(T& a) { cin >> a; }
template<class T> inline void input_li(T& a) {for(auto &ob:a) cin >> ob;}
template<class... T> inline void input(T&... a) { ((cin >> a), ...); }
//output
template<class T> inline void print(T& a) { cout << a << endl; }
template<class... T> inline void print(T&... a) { ((cout << a << " "), ...); cout << endl;}
#define Yes(bo) cout << ((bo) ? "Yes":"No") << endl
#define YES(bo) cout << ((bo) ? "YES":"NO") << endl
#define yes(bo) cout << ((bo) ? "yes":"no") << endl
#define Taka(bo) cout << ((bo) ? "Takahashi":"Aoki") << endl
//other
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define sz size
#define is insert
#define ps push
#define tp top
#define ft front
#define pp pop
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}
//const
#define I_MAX 2147483647
#define I_MIN -2147483647
#define UI_MAX 4294967295
#define LL_MAX 9223372036854775807
#define LL_MIN -9223372036854775808
#define ULL_MAX 18446744073709551615
#define Inf 1LL<<60
//type
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using Pair = pair<ll,ll>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vp = vector<pair<ll,ll>>;
using field = vector<string>;
using mint = modint998244353;
using mint1 = modint1000000007;
using Graph_n = vector<vector<ll>>;
using Graph_w = vector<vector<Pair>>;
using Graph_s = vector<set<ll>>;
using Graph_e = vector<pair<ll,ll>>;
using Edges_n = vector<pair<ll,ll>>;
using Edges_w = vector<array<ll,3>>;
using Stack = stack<ll>;
using Queue = queue<ll>;
using Deque = deque<ll>;
//debug
#ifdef _DEBUG
#define debug(x) cerr << "dbg_var : " << #x << ": " << x << endl
#define debug2(x,y) cerr << "dbg_var : " << #x << ": " << x << " "<< #y << ": " << y << endl
#define debug3(x,y,z) cerr << "dbg_var : " << #x << ": " << x << " "<< #y << ": " << y << " " << #z << ": " << z <<endl
#define debug_v(x) cerr << "dbg_vect: " << #x << ": "; REP3(v,x) cerr << v << " "; cerr << endl
#define debug_s(x) cerr << "dbg_set : " << #x << ": {"; REP3(v,x) cerr << v << ","; cerr << "}" << endl
#define debug_p(x) cerr << "dbg_pair: " << #x << "Fir: " << x.first << " Sec: " << x.second << endl
#define debug_m(x) cerr << "dbg_map : " << #x << ": "; REP4(Ite1,x)cerr << "key: " << Ite1->first << " : " << Ite1->second << " "; cerr<< endl
#define debug_l() cerr << "======================================" << endl
#else
#define debug(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug_v(x)
#define debug_s(x)
#define debug_p(x)
#define debug_m(x)
#define debug_l()
#endif
ll GCD(ll a, ll b) {if (b == 0) return a;else return GCD(b, a % b);}
ll LCM(ll a, ll b) {return a * b/GCD(a , b);}
/*zahyou to ka*/
bool poich(ll P,ll Q){return(0<=P&&P<Q);}
bool poich2(ll i,ll j,ll H,ll W){return(poich(j,W)&&poich(i,H));}
vector<Pair> dxy{{1,0},{-1,0},{0,1},{0,-1}};
//https://algo-logic.info/calc-pow/
ll dpow(ll x, ll n,ll mod) {
ll ret = 1;
while (n > 0) {
if (n & 1) ret = ret * x % mod;
x = x * x % mod;
n >>= 1;
}
return ret;
}
ll chd21(ll N,ll i,ll j){
return N*i+j;
}
Pair chd12(ll N,ll X){
return {X/N,X%N};
}
int main(){
ll N,H;cin >> N >> H;
priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> que;
for(ll i=0;i<N;i++){
ll A,B;input(A,B);
que.push(make_pair(A,1));
que.push(make_pair(B+1,-1));
}
ll now=0;
ll ans=0;
while(!que.empty()){
auto[a,b]=que.top();que.pop();
now+=b;
chmax(ans,now);
}
cout << ans << endl;
return 0;
}