• LQDOJ
  • Trang chủ
  • Bài tập
  • Bài nộp
  • Thành viên
  • Kỳ thi
  • Nhóm
  • Giới thiệu
    • Status
    • Khóa học
    • Đề xuất ý tưởng
    • Proposal Problem
    • Proposal Contest
    • Tools
    • Báo cáo tiêu cực
    • Báo cáo lỗi

Tiếng Việt

Tiếng Việt
English

Đăng nhập

Đăng ký

pvnhatminh2013

  • Giới thiệu
  • Bài tập
  • Bài nộp

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;
}


«    »
Thứ 2
Thứ 3
Thứ 4
Thứ 5
Thứ 6
Thứ 7
CN
Ít
Nhiều

proudly powered by DMOJ| developed by LQDJudge team