This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>> v;
const int mxn=2e5;
long long sm,w;
array <int,2> a[mxn];
int main()
{
long long n;
cin>>n;
for(int i=0; i<n; i++)
{
cin>>a[i][1]>>a[i][0];
}
sort(a,a+n);
for(int i=0; i<n; i++)
{
if(a[i][1]>=w)
{
sm++;
w=a[i][0];
}
}
cout<<sm;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |