Submission #76637134


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
//#define int ll
//#define ll long long
#define pb emplace_back
#define pr pair<int,int>
#define mp make_pair
#define endl "\n"
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
void write(int x)
{
    if(x<0)putchar('-'),x=-x;
    if(x<10)putchar(x+'0');
    else write(x/10),putchar(x%10+'0');
}
int n;
pr d[300005];
int minx[300005],miny[300005];
bool cmp1(pr q,pr p){return q.first<p.first;}
bool cmp2(pr q,pr p){return q.second<p.second;}
signed main(){
	n=read();
	for(int i=1;i<=n;i++){d[i].first=read();d[i].second=read();}
	sort(d+1,d+1+n,cmp1);
	miny[0]=INT_MAX;
	for(int i=1;i<=n;i++) miny[i]=min(miny[i-1],d[i].second);
	sort(d+1,d+1+n,cmp2); 
	minx[0]=INT_MAX;
	for(int i=1;i<=n;i++) minx[i]=min(minx[i-1],d[i].first);
	int ans=0;
	for(int i=1;i<=n;i++){
		if(d[i].second<=miny[d[i].first-1]&&d[i].first<=minx[d[i].second-1]) ans++;
	}
	cout<<ans;
	return 0;
}


Submission Info

Submission Time
Task C - Not Covered Points
User Fireflies
Language C++23 (GCC 15.2.0)
Score 300
Code Size 1094 Byte
Status AC
Exec Time 65 ms
Memory 8300 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 25
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3428 KiB
00_sample_01.txt AC 1 ms 3500 KiB
00_sample_02.txt AC 1 ms 3376 KiB
01_random_00.txt AC 1 ms 3372 KiB
01_random_01.txt AC 34 ms 8272 KiB
01_random_02.txt AC 49 ms 8272 KiB
01_random_03.txt AC 32 ms 8164 KiB
01_random_04.txt AC 47 ms 8236 KiB
01_random_05.txt AC 43 ms 6632 KiB
01_random_06.txt AC 64 ms 8168 KiB
01_random_07.txt AC 35 ms 6308 KiB
01_random_08.txt AC 65 ms 8112 KiB
01_random_09.txt AC 37 ms 6228 KiB
01_random_10.txt AC 64 ms 8164 KiB
01_random_11.txt AC 19 ms 5156 KiB
01_random_12.txt AC 65 ms 8112 KiB
01_random_13.txt AC 65 ms 8148 KiB
01_random_14.txt AC 49 ms 8208 KiB
01_random_15.txt AC 51 ms 8148 KiB
01_random_16.txt AC 47 ms 8228 KiB
01_random_17.txt AC 47 ms 8300 KiB
01_random_18.txt AC 47 ms 8208 KiB
01_random_19.txt AC 47 ms 8272 KiB
01_random_20.txt AC 47 ms 8228 KiB
01_random_21.txt AC 49 ms 8124 KiB