From 5bc6ad588a46ae1cda3b53af3a5752e36516450f Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sun, 31 Dec 2023 22:52:47 +0600 Subject: [PATCH] added 1916C --- .../1916C.cpp | 81 +++++++++++++++++++ Readme.md | 5 +- 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 Codes/1916 C - Training Before the Olympiad/1916C.cpp diff --git a/Codes/1916 C - Training Before the Olympiad/1916C.cpp b/Codes/1916 C - Training Before the Olympiad/1916C.cpp new file mode 100644 index 0000000..19ba75e --- /dev/null +++ b/Codes/1916 C - Training Before the Olympiad/1916C.cpp @@ -0,0 +1,81 @@ +#include +using namespace std; + +#define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); + +#define int long long +#define ll long long +#define ull unsigned long long +#define endl '\n' +#define ff first +#define ss second +#define pb push_back +#define all(x) x.begin(), x.end() +#define sz(x) (int)(x).size() + +#define yes cout<<"YES"<>= 1; } return ans; } +bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } + +#ifndef ONLINE_JUDGE +#define dbg(x) cerr << #x <<" "; _print(x); cerr << endl; +#define dbgin(x) cerr << #x <<" "; _print(x); cerr << ";"< void _print(pair p); +template void _print(vector v);template void _print(set v); +template void _print(map v);template void _print(multiset v); +template void _print(pair p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";} +template void _print(vector v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(set v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(multiset v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(unordered_set v) {cerr<<"[ "; for(T i : v) {_print(i); cerr<<" ";} cerr<<"]";} +template void _print(map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(multimap v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} +template void _print(unordered_map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int n; + cin>>n; + vectorv(n); + for(auto &i:v) cin>>i; + int odd=0,sum=0; + for(int i=0; i> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 05d04f7..99d6927 100644 --- a/Readme.md +++ b/Readme.md @@ -225,8 +225,9 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 213 | 1915 E | Romantic Glasses | [Question](https://codeforces.com/problemset/problem/1915/E) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1915%20E%20-%20Romantic%20Glasses) | 214 | 1916 A | 2023 | [Question](https://codeforces.com/problemset/problem/1916/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1916%20A%20-%202023) | 215 | 1916 B | Two Divisors | [Question](https://codeforces.com/problemset/problem/1916/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1916%20B%20-%20Two%20Divisors) -| 216 | 1917 A | Least Product | [Question](https://codeforces.com/problemset/problem/1917/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1917%20A%20-%20Least%20Product) -| 217 | 1917 B | Erase First or Second Letter | [Question](https://codeforces.com/problemset/problem/1917/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1917%20B%20-%20Erase%20First%20or%20Second%20Letter) +| 216 | 1916 C | Training Before the Olympiad | [Question](https://codeforces.com/problemset/problem/1916/C) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1916%20C%20-%20Training%20Before%20the%20Olympiad) +| 217 | 1917 A | Least Product | [Question](https://codeforces.com/problemset/problem/1917/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1917%20A%20-%20Least%20Product) +| 218 | 1917 B | Erase First or Second Letter | [Question](https://codeforces.com/problemset/problem/1917/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1917%20B%20-%20Erase%20First%20or%20Second%20Letter)