Source Code
// Online C++ compiler to run C++ program online
#include <iostream>
#include <set>
using namespace std;
int main() {
    
    int n,m;
    cin >> n >> m;
    
    int a[n],b[m];
    
    set<int>st;
    
    for(int i = 0 ; i < n ; i++){
        cin >> a[i];
        st.insert(a[i]);
    }
    for(int i = 0 ; i < m ; i++)cin >> b[i];
    
    int sum = 0;
    for(int i = 0 ; i < m ; i++){
        for(auto j : st){
            if(j > b[i])sum ++;
        }
    }
    
    cout << sum << endl;
    
    return 0;
}
Copy
Insertion sort. No not that one Abdullahbitar
GNU G++17
5 ms
384 KB
Wrong Answer