# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
905216 | Petrix | Advertisement 2 (JOI23_ho_t2) | C++17 | 1 ms | 432 KiB |
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 <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<pair<int,int>> v;
int main()
{
int n,cnt=0,i,curent=-1,a,b;
cin>>n;
for(i=0;i<n;i++){
cin>>a>>b;
v.push_back({a-b,-b+a});
}
sort(v.begin(),v.end());
for(i=0;i<v.size();i++){
if(curent<v[i].first){
cnt++;curent=-v[i].second;
}
}
cout<<cnt;
return 0;
}
Compilation message (stderr)
# | 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... |