Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define int int64_t
  3. using namespace std;
  4.  
  5. const int INF = 1e9 + 7;
  6. const int N = 1e5 + 10;
  7.  
  8. int32_t main(){
  9. int n, a, b, l, r;
  10. cin >> n >> l >> r >> a >> b;
  11. int ans = r - l + 1;
  12. if(a >= l && a <= r){
  13. ans --;
  14. }
  15. if(b >= l && b <= r && b != a){
  16. ans --;
  17. }
  18. cout << ans;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement