Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n, m, c[1001], a[1001];
- scanf("%d%d", &n, &m);
- for(int i = 0 ; i < n; ++i){
- scanf("%d", &c[i]);
- }
- for(int j = 0; j < m; ++j){
- scanf("%d", &a[j]);
- }
- int cnt = 0, j = 0;
- for(int i = 0; i < n; ++i){
- if(a[j] >= c[i]){
- cnt++;
- j++;
- //printf("cnt = %d, a[j] = %d\n", cnt ,a[j]);
- }
- }
- printf("%d\n", cnt);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement