結果
| 問題 |
No.2796 Small Matryoshka
|
| コンテスト | |
| ユーザー |
PyonPyon
|
| 提出日時 | 2024-09-29 22:48:38 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 475 bytes |
| コンパイル時間 | 6,214 ms |
| コンパイル使用メモリ | 313,736 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-29 22:48:51 |
| 合計ジャッジ時間 | 8,778 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 11 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define sz(c) ((ll)(c).size())
#define ALL(x) x.begin(),x.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
const long long inf=1e14;
int main() {
int n;cin>>n;
vector<pair<int,int>>P(n);
int c=-1;
rep(i,0,n){
int r,R;cin>>r>>R;
P[i]={R,r};
}
sort(ALL(P));
int ans=0;
rep(i,0,n){
if(c<=P[i].second){ans++;c=P[i].first;}
}
cout<<n-ans;
}
PyonPyon