Submission #76637716


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
struct node{int x,y;}a[300005];
int n,ans,t[300005];
void add(int i){for(;i<=n;i+=i&(-i)) t[i]++;}
int qry(int i){int ans=0;for(;i;i-=i&(-i))ans+=t[i];return ans;}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i].x>>a[i].y;
	sort(a+1,a+n+1,[&](node a,node b){return a.x==b.x?a.y<b.y:a.x<b.x;});
	for(int i=1;i<=n;i++){
		if(qry(a[i].y-1)==0) ans++;
		add(a[i].y);
	}
	cout<<ans;
}

Submission Info

Submission Time
Task C - Not Covered Points
User Rya_
Language C++23 (GCC 15.2.0)
Score 300
Code Size 445 Byte
Status AC
Exec Time 126 ms
Memory 7212 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 3628 KiB
00_sample_02.txt AC 1 ms 3496 KiB
01_random_00.txt AC 1 ms 3476 KiB
01_random_01.txt AC 105 ms 7188 KiB
01_random_02.txt AC 123 ms 7012 KiB
01_random_03.txt AC 107 ms 7152 KiB
01_random_04.txt AC 124 ms 7212 KiB
01_random_05.txt AC 84 ms 6000 KiB
01_random_06.txt AC 126 ms 7024 KiB
01_random_07.txt AC 68 ms 5648 KiB
01_random_08.txt AC 126 ms 7156 KiB
01_random_09.txt AC 72 ms 5648 KiB
01_random_10.txt AC 126 ms 7184 KiB
01_random_11.txt AC 37 ms 4656 KiB
01_random_12.txt AC 126 ms 7188 KiB
01_random_13.txt AC 126 ms 7212 KiB
01_random_14.txt AC 124 ms 7024 KiB
01_random_15.txt AC 124 ms 7156 KiB
01_random_16.txt AC 124 ms 7088 KiB
01_random_17.txt AC 124 ms 7188 KiB
01_random_18.txt AC 124 ms 7012 KiB
01_random_19.txt AC 124 ms 7080 KiB
01_random_20.txt AC 124 ms 7184 KiB
01_random_21.txt AC 123 ms 7008 KiB