From 5266d805e7457ca0516b94d3475b4636dd546f1d Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Sat, 13 Apr 2024 12:19:53 +0600 Subject: [PATCH] added 1955F --- Codes/1955 F - Unfair Game/1955F.cpp | 64 ++++++++++++++++++++++++++++ Readme.md | 1 + 2 files changed, 65 insertions(+) create mode 100644 Codes/1955 F - Unfair Game/1955F.cpp diff --git a/Codes/1955 F - Unfair Game/1955F.cpp b/Codes/1955 F - Unfair Game/1955F.cpp new file mode 100644 index 0000000..de7c375 --- /dev/null +++ b/Codes/1955 F - Unfair Game/1955F.cpp @@ -0,0 +1,64 @@ +#include +using namespace std; + +#define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); +#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) +#else +#define dbg(...) +#endif +void __print(int x) {cerr << x;}void __print(long x) {cerr << x;} void __print(long long x){cerr << x;} +void __print(unsigned x){cerr << x;} void __print(unsigned long x){cerr << x;} void __print(unsigned long long x){cerr << x;} +void __print(float x){cerr << x;} void __print(double x){cerr << x;} void __print(long double x){cerr << x;} +void __print(char x){cerr << x;} void __print(const char *x){cerr << x;} void __print(const string &x){cerr << x;} +void __print(bool x){cerr << (x ? "true" : "false");} void _print() { cerr << "\n"; } +template void __print(const A &x); template void __print(const pair &p); +template void __print(const A &x) {bool f=1; cerr << '['; for (const auto &i : x) {cerr << (f ? "" : ","), __print(i); f = 0;} cerr << ']';} +template void __print(const pair &p) {cerr << '('; __print(p.first); cerr << ','; __print(p.second); cerr << ')';} +template void _print(const Head &H, const Tail &...T) { __print(H); if (sizeof...(T)) cerr << ", "; _print(T...);} +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void solve() +{ + int a,b,c,d; + cin>>a>>b>>c>>d; + int ans=a/2+b/2+c/2+d/2; + if(a&1 && b&1 && c&1) + ans++; + cout<> TC; + while (TC--) + solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index e9ef1f8..cf85556 100644 --- a/Readme.md +++ b/Readme.md @@ -296,6 +296,7 @@ This repository contains my solutions of Codeforces problems. They are in C++ la | 284 | 1955 C | Inhabitant of the Deep Sea | [Question](https://codeforces.com/problemset/problem/1955/C) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20C%20-%20Inhabitant%20of%20the%20Deep%20Sea) | 285 | 1955 D | Inaccurate Subsequence Search | [Question](https://codeforces.com/problemset/problem/1955/D) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20D%20-%20Inaccurate%20Subsequence%20Search) | 286 | 1955 E | Long Inversions | [Question](https://codeforces.com/problemset/problem/1955/E) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20E%20-%20Long%20Inversions) +| 287 | 1955 F | Unfair Game | [Question](https://codeforces.com/problemset/problem/1955/F) | [Solution](https://github.com/ShazidMashrafi/Codeforces-Solutions/tree/master/Codes/1955%20F%20-%20Unfair%20Game)