From 61b4d6b1b575f15496a759aa2e41a3e9d7e50f0a Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sun, 17 Dec 2023 01:33:01 +0600 Subject: [PATCH] added 1905B --- Codes/1905B Begginer's Zelda/1905B.cpp | 89 ++++++++++++++++++++++++++ Readme.md | 1 + 2 files changed, 90 insertions(+) create mode 100644 Codes/1905B Begginer's Zelda/1905B.cpp diff --git a/Codes/1905B Begginer's Zelda/1905B.cpp b/Codes/1905B Begginer's Zelda/1905B.cpp new file mode 100644 index 0000000..ad200ea --- /dev/null +++ b/Codes/1905B Begginer's Zelda/1905B.cpp @@ -0,0 +1,89 @@ +#include +using namespace std; + +// Short forms +#define int long long +#define ll 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() + +// Outputs +#define yes cout<<"YES"< 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; + mapm; + for(int i=0; i>x>>y; + m[x]++; + m[y]++; + } + int ct=0; + for(auto it:m) + { + if(it.second==1) + ct++; + } + if(ct&1) + ct++; + cout<> TC; + while (TC--) solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 5cb2419..bcbbf65 100644 --- a/Readme.md +++ b/Readme.md @@ -196,6 +196,7 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 1901A | Line Trip | [Question](https://codeforces.com/problemset/problem/1901/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1901A%20Line%20Trip) | 1904A | Forked! | [Question](https://codeforces.com/problemset/problem/1904/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1904A%20Forked!) | 1905A | Constructive Problems | [Question](https://codeforces.com/problemset/problem/1905/A) | [Solution] +| 1905B | Begginer's Zelda | [Question](https://codeforces.com/problemset/problem/1905/B) | [Solution] | 1907A | Rook | [Question](https://codeforces.com/problemset/problem/1907/A) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1907A%20Rook) | 1907B | YetnotherrokenKeoard | [Question](https://codeforces.com/problemset/problem/1907/B) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1907B%20YetnotherrokenKeoard) | 1907C | Removal of Unattractive Pairs | [Question](https://codeforces.com/problemset/problem/1907/C) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1907C%20Removal%20of%20Unattractive%20Pairs)