Advertisement
Ahmed_Negm

Untitled

Feb 13th, 2023
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1.  int n , m ;
  2.      cin >> n >> m;
  3.      vector < int > a(n) , b(m);
  4.      for(auto & i : a)
  5.          cin >> i;
  6.      for(auto & i : b)
  7.          cin >> i;
  8. int j =0;
  9.      for(int i = 0 ; i < n ; i++){
  10.          if(b[j] >= a[i]) j++;
  11.          if(j == m) return void(cout << j << nl);
  12.      }
  13.      cout << j << nl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement