SHARE
TWEET

danya idi na

a guest Feb 27th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long n,m;
  8.     cin>>n>>m;
  9.     int arn[n][2];
  10.     for(int i =0;i<n;i++){
  11.         cin>>arn[i][0];
  12.         cin>>arn[i][1];
  13.         if(arn[i][0]>arn[i][1]){
  14.             swap(arn[i][0],arn[i][1]);
  15.         }
  16.     }
  17.     long long arm[m];
  18.     for(int i =0;i<m;i++){
  19.         cin>>arm[i];
  20.     }
  21.     for(int i = 0,z=0;i<m;i++){
  22.         for(int k = 0;k<n;k++){
  23.             if(arm[i]>=arn[k][0]&&arm[i]<=arn[k][1]){
  24.                 z++;
  25.             }
  26.         }
  27.         cout<<z<<" ";
  28.             z=0;
  29.     }
  30.     return 0;
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top