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
Test Case #1
1 ms
188 KB
Accepted
Input
4 2
1 1 2 3
5 6
Output
0
Judge Output
0
Checker Message
single line: '0'
Test Case #2
1 ms
208 KB
Accepted
Input
4 2
1 1 2 3
2 1
Output
3
Judge Output
3
Checker Message
single line: '3'
Test Case #3
5 ms
384 KB
Wrong Answer
Input
1379 920
1 2 2 2 2 3 4 4 4 4 4 4 5 5 6 7 7 7 8 8 9 9 10 11 13 13 14 18 19 20 23 23 23 23 24 26 28 28 28 28 29 30 30 31 32 33 33 34 34 35 36 38 38 39 39 40 40 40 40 41 41 45 47 47 47 47 47 48 48 48 48 51 51 53 54 55 55 55 55 56 56 57 57 58 60 60 62 ...
Output
359836
Judge Output
399569
Checker Message
1st lines differ - expected: '399569', found: '359836'