MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / main

Function main

codes/cpp/Code_5_07_2.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27int main() {
28 // �z��̏������ifact[i] �� i �̊K��� 1000000007 �Ŋ������]��j
29 fact[0] = 1;
30 for (int i = 1; i <= 200000; i++) fact[i] = 1LL * i * fact[i - 1] % mod;
31
32 // ����
33 cin >> N;
34 for (int i = 1; i <= N; i++) cin >> A[i];
35
36 // ���������߂� �� �����̏o��
37 for (int i = 1; i <= N; i++) {
38 Answer += A[i] * ncr(N - 1, i - 1);
39 Answer %= mod;
40 }
41 cout << Answer << endl;
42 return 0;
43}

Callers

nothing calls this directly

Calls 1

ncrFunction · 0.70

Tested by

no test coverage detected