Submission #798727

#TimeUsernameProblemLanguageResultExecution timeMemory
798727tlnk07Magneti (COCI21_magneti)C++17
0 / 110
1 ms212 KiB
#include<bits/stdc++.h> using namespace std; long long n, m, x, s = 1, mod = 1e9 + 7; 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 %= mod; } if(m < 0) { cout << 0; return 0; } int t = n + 1; for(int i = 1; i <= m; ++i, ++t) { s = (s * t / i) % mod; } cout << s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...