Source Code
#include <iostream>
using namespace std;
/*
4 2
1 1 2 3 
2 1
*/
int c,n,k;
int main() {
  cin>>n>>k;
  int arr[n];
  int arr1[k];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  for(int i=0;i<k;i++){
    cin>>arr1[i];
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<n;j++){
      if(arr[j]>arr1[i]){
        c++;
      }
    }
  }
cout<<c;
}
Copy
Insertion sort. No not that one Hadeel
GNU G++17
4 ms
484 KB
Wrong Answer