Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long r1,r2,l1,l2;
- int main()
- {
- cin>>l1>>r1>>l2>>l2;
- if(l1>r1) swap(l1,r1);
- if(l2>r2) swap(l2,r2);
- if(l1<l2) swap(l1,l2);
- if(r1<r2) swap(r1,r2);
- if(r2<l1) cout<<0;
- else cout<<r2-l1<< endl;
- return 0;
- }
- // r2-l1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement