結果
| 問題 |
No.2796 Small Matryoshka
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-15 09:30:55 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 774 bytes |
| コンパイル時間 | 11,434 ms |
| コンパイル使用メモリ | 285,216 KB |
| 最終ジャッジ日時 | 2025-02-23 15:44:53 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 11 |
ソースコード
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
#define INF 1000000001LL
#define LNF 1000000000000000001LL
#define MOD 1000000007LL
#define MAX 300005
#define long long long
#define all(x) x.begin(),x.end()
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<pair<long,long>> arr(n);
for(int i = 0; i<n; i++)
cin >> arr[i].second >> arr[i].first;
sort(all(arr));
int p = 0;
int res = 0;
for(int i = 0; i<n; i++)
{
if(arr[i].second >= p)
{
res++;
p = arr[i].first;
}
}
cout << n-res << endl;
return 0;
}