結果
問題 | No.3039 配信者 |
ユーザー |
|
提出日時 | 2025-03-02 11:53:57 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 823 bytes |
コンパイル時間 | 1,197 ms |
コンパイル使用メモリ | 117,244 KB |
実行使用メモリ | 10,996 KB |
最終ジャッジ日時 | 2025-03-02 11:54:03 |
合計ジャッジ時間 | 5,075 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 WA * 12 |
ソースコード
#include <iostream>#include <cstdint>#include <vector>#include <algorithm>#include <queue>#include <functional>using namespace std;template<typename T> constexpr T chmax(T& variable, const T value) noexcept{if (variable < value) return (variable = value);else return variable;}int main(){cin.tie(nullptr);ios::sync_with_stdio(false);uint32_t N, H, i;cin >> N >> H;vector<pair<uint32_t, uint32_t>> stream_time(N);for (i = 0; i != N; ++i) cin >> stream_time[i].first >> stream_time[i].second;uint32_t ans = 0;priority_queue<uint32_t, vector<uint32_t>, greater<uint32_t>> pq;pq.push(UINT32_MAX);for (i = 0; i != N; ++i){while (pq.top() < stream_time[i].first) pq.pop();pq.push(stream_time[i].second);chmax<uint32_t>(ans, pq.size() - 1);}cout << ans << '\n';return 0;}