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

Function main

codes/cpp/Code_5_03_2.cpp:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5int sum = 0; // A[1] + A[2] + ... + A[N] �̒l
6
7int main() {
8 // ���� �� ����̗v�f�̑��a sum �����߂�
9 cin >> N >> K;
10 for (int i = 1; i <= N; i++) cin >> A[i];
11 for (int i = 1; i <= N; i++) sum += A[i];
12
13 // �����̏o��
14 if (sum % 2 != K % 2) cout << "No" << endl;
15 else if (sum > K) cout << "No" << endl;
16 else cout << "Yes" << endl;
17 return 0;
18}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected