#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 10;
int n;
long long a[MAX], b[MAX];
pair<long long, bool> ab[MAX * 2];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lld", a + i);
}
sort(a, a + n);
for (int i = 0; i < n; i++) {
scanf("%lld", b + i);
}
sort(b, b + n);
long long ans = 1;
for (int i = 0; i < n; i++) {
ab[i] = make_pair(a[i], false);
}
for (int i = 0; i < n; i++) {
ab[n + i] = make_pair(b[i], true);
}
sort(ab, ab + 2 * n);
int cnt = 0;
for (int i = 0; i < n * 2; i++) {
if (ab[i].second) {
// com
if (cnt > 0) {
(ans *= cnt) %= MOD;
}
cnt--;
} else {
// el
if (cnt < 0) {
(ans *= -cnt) %= MOD;
}
cnt++;
}
}
printf("%d\n", ans);
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:47:23: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
printf("%d\n", ans);
^
./Main.cpp:12:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
^
./Main.cpp:14:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld", a + i);
^
./Main.cpp:18:29: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld", b + i);
^