longlong fina l=0;for(int i =0; i < n; i++){
ll x =lower_bound(a, a + n, b[i])- a;// lower_bound二分查找第一个大于或等于b[i]的数字
ll y = n -(upper_bound(c, c + n, b[i])- c);// upper_bound二分查找第一个大于b[i]的数字
final += y*x;//统计符合条件的个数}
#include<iostream>#include<algorithm>#define ll long longusingnamespace std;intmain(){int n;
cin >> n;int a[n];int b[n];int c[n];for(int i =0; i < n; i++){scanf("%d",&a[i]);}for(int i =0; i < n; i++){scanf("%d",&b[i]);}for(int i =0; i < n; i++){scanf("%d",&c[i]);}sort(a, a + n);sort(b, b + n);sort(c, c + n);
ll final =0;for(int i =0; i < n; i++){
ll x =lower_bound(a, a + n, b[i])- a;// lower_bound二分查找第一个大于或等于b[i]的数字
ll y = n -(upper_bound(c, c + n, b[i])- c);// upper_bound二分查找第一个大于b[i]的数字
final += y*x;}
cout << final;}