結果
| 問題 |
No.2796 Small Matryoshka
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-28 21:28:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 514 bytes |
| コンパイル時間 | 2,157 ms |
| コンパイル使用メモリ | 205,872 KB |
| 最終ジャッジ日時 | 2025-02-22 00:55:15 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 5 RE * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
vector<pair<long long,long long>> rR(N);
for(auto &[r,R] : rR) cin >> r >> R;
sort(rR.rbegin(),rR.rend());
multiset<long long> S;
for(auto &[r,R] : rR){
auto itr = S.lower_bound(R);
if(itr == S.end()) S.insert(r);
else{
itr--;
S.erase(itr); S.insert(r);
}
}
cout << S.size()-1 << endl;
}