From 5ddfd7c8a401658bb7231817f8b5c64f003d871c Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Wed, 1 Jun 2022 00:12:46 +0200 Subject: Solved A from codeforces Round795 --- beatTheOdds/main.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 beatTheOdds/main.cpp (limited to 'beatTheOdds/main.cpp') diff --git a/beatTheOdds/main.cpp b/beatTheOdds/main.cpp new file mode 100644 index 0000000..beb04cf --- /dev/null +++ b/beatTheOdds/main.cpp @@ -0,0 +1,21 @@ +#include + +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 v(2); + for(int i = 0; i < n; i++) { + int x; + cin >> x; + v[x % 2]++; + } + cout << min(v[0] , v[1]) << '\n'; + } +} -- cgit v1.2.3