pvnhatminh2013
Rating
-
Bài tập
0
Điểm
0
Rating #
-
Điểm #
32735
Giới thiệu
include <bits/stdc++.h>
include <set>
using namespace std;
void lostmul(set<int> arr[], long long list_size, long long limit) {
long long tich = 1;
long long mod = 1000000007;
for (int a = 1; a <= limit; ++a) {
bool found = false;
for(int i = 0; i < list_size; ++i){
if (arr[i].find(a) != arr[i].end()) {
found = true;
break;
}
}
if (!found) {
tich = (tich * a) % mod;
}
}
long long result = tich % mod;
cout << result;
}
int main() {
long long n, m;
cin >> n >> m;
set<int> a[n];
for (int i = 0; i < n; ++i) {
int temp;
cin >> temp;
a[i].insert(temp);
}
lostmul(a, n, m);
return 0;
}