Count K-Subsequences of a String with Maximum Beauty Solution || Leetcode Bi-Weekly 112 Get link Facebook X Pinterest Email Other Apps - September 04, 2023 Count K-Subsequences of a String with Maximum Beauty Get link Facebook X Pinterest Email Other Apps
Dazzling Even-Odd Challenge Solution || Codechef Starters - 37 Get link Facebook X Pinterest Email Other Apps - May 04, 2022 Dazzling Even-Odd Challenge Solution Codechef Starters - 37Problem Code : EANDOProblem Link : https://www.codechef.com/START37C/problems/EANDOSolution :#include <bits/stdc++.h>#define ll long long intusing namespace std;int main(){ ll t = 1; cin >> t; while (t--) { ll n; cin >> n; ll a[n]; ll s = 0; ll even = 0, odd = 0; for (ll i = 0; i < n; i++) { cin >> a[i]; s += a[i]; if (a[i] % 2) { odd++; } else { even++; } } if (s % (n / 2) == 0) { ll temp = s / (n / 2); if (temp % 2 == 1) { cout << "YES\n"; } else { cout << "NO\n"; } } else { cout << "NO\n"; } }} Get link Facebook X Pinterest Email Other Apps Comments
Exact Marks Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Exact Marks Solution Read more
Substring of a Substring Solution || Codechef March Long Challenge 2022 - I - March 11, 2022 Substring of a Substring Solution Read more
Binary Base Basics Solution || Codechef February Long Challenge 2022 - I - February 04, 2022 Binary Base Basics Solution Read more
Comments
Post a Comment