diff options
Diffstat (limited to 'codechef/AjdacentSumParity')
| -rw-r--r-- | codechef/AjdacentSumParity/inp | 0 | ||||
| -rwxr-xr-x | codechef/AjdacentSumParity/main | bin | 0 -> 27320 bytes | |||
| -rw-r--r-- | codechef/AjdacentSumParity/main.cpp | 26 | ||||
| -rw-r--r-- | codechef/AjdacentSumParity/main_input0.txt | 9 | ||||
| -rw-r--r-- | codechef/AjdacentSumParity/main_output0.txt | 4 |
5 files changed, 39 insertions, 0 deletions
diff --git a/codechef/AjdacentSumParity/inp b/codechef/AjdacentSumParity/inp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/codechef/AjdacentSumParity/inp diff --git a/codechef/AjdacentSumParity/main b/codechef/AjdacentSumParity/main Binary files differnew file mode 100755 index 0000000..c642716 --- /dev/null +++ b/codechef/AjdacentSumParity/main diff --git a/codechef/AjdacentSumParity/main.cpp b/codechef/AjdacentSumParity/main.cpp new file mode 100644 index 0000000..899003a --- /dev/null +++ b/codechef/AjdacentSumParity/main.cpp @@ -0,0 +1,26 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + vector<int> v(n); + int sum = 0; + for(int &x : v) { + cin >> x; + sum += x; + } + if(sum % 2 == 0) { + cout << "YES" << endl; + } else { + cout << "NO" << endl; + } + + } +} diff --git a/codechef/AjdacentSumParity/main_input0.txt b/codechef/AjdacentSumParity/main_input0.txt new file mode 100644 index 0000000..12bae4c --- /dev/null +++ b/codechef/AjdacentSumParity/main_input0.txt @@ -0,0 +1,9 @@ +4 +2 +0 0 +2 +1 0 +4 +1 0 1 0 +3 +1 0 0 diff --git a/codechef/AjdacentSumParity/main_output0.txt b/codechef/AjdacentSumParity/main_output0.txt new file mode 100644 index 0000000..2bc7799 --- /dev/null +++ b/codechef/AjdacentSumParity/main_output0.txt @@ -0,0 +1,4 @@ +YES +NO +YES +NO |
