This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
long long n, m, x, s = 1;
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; ++i) cin >> x;
m -= 1;
for(int i = 2; i <= n; ++i)
{
s *= i;
m -= x;
s %= 1000000007;
}
int t = n + 1;
for(int i = 1; i <= m; ++i, ++t)
{
s = (s * t / i) % 1000000007;
}
cout << s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |