From 232214b66b84b7dc3413cf2b1a0334743a49d7ec Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Wed, 21 Aug 2024 09:13:22 +0600 Subject: [PATCH] added 1106C, 1279A, 1301A, 1608A --- .../1106C.cpp | 51 ++ Codes/1279 A - New Year Garland/1279A.cpp | 42 ++ Codes/1301 A - Three Strings/1301A.cpp | 49 ++ .../1680 A - Minimums and Maximums/1680A.cpp | 51 ++ Readme.md | 602 +++++++++--------- 5 files changed, 496 insertions(+), 299 deletions(-) create mode 100644 Codes/1106 C - Lunar New Year and Number Division/1106C.cpp create mode 100644 Codes/1279 A - New Year Garland/1279A.cpp create mode 100644 Codes/1301 A - Three Strings/1301A.cpp create mode 100644 Codes/1680 A - Minimums and Maximums/1680A.cpp diff --git a/Codes/1106 C - Lunar New Year and Number Division/1106C.cpp b/Codes/1106 C - Lunar New Year and Number Division/1106C.cpp new file mode 100644 index 0000000..e2988d6 --- /dev/null +++ b/Codes/1106 C - Lunar New Year and Number Division/1106C.cpp @@ -0,0 +1,51 @@ +#include +using namespace std; +#ifdef ONLINE_JUDGE +#define dbg(...) +#else +#include "Assets/debug.h" +#endif +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define ins insert +#define pb push_back +#define ppb pop_back +#define sz(x) (int)(x).size() +#define all(x) x.begin(), x.end() +#define rep(i,a,b) for(int i=a; i=b; --i) +#define yn(f) f? cout<<"YES\n":cout<<"NO\n" +#define FAST (ios_base::sync_with_stdio(false), cin.tie(nullptr)); +ll pow(ll x,ll y,ll m=1e9+7) {ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + int n; + cin>>n; + vectorv(n); + for(auto &i:v) cin>>i; + sort(all(v)); + int ans=0; + rep(i,0,n/2) + { + int sum=v[i]+v[n-i-1]; + sum *= sum; + ans += sum; + } + cout<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#ifdef ONLINE_JUDGE +#define dbg(...) +#else +#include "Assets/debug.h" +#endif +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define ins insert +#define pb push_back +#define ppb pop_back +#define sz(x) (int)(x).size() +#define all(x) x.begin(), x.end() +#define rep(i,a,b) for(int i=a; i=b; --i) +#define yn(f) f? cout<<"YES\n":cout<<"NO\n" +#define FAST (ios_base::sync_with_stdio(false), cin.tie(nullptr)); +ll pow(ll x,ll y,ll m=1e9+7) {ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + int r,b,g; + cin>>r>>b>>g; + if(r>b+g+1 || b>r+g+1 || g>r+b+1) yn(0); + else yn(1); +} + +signed main() +{ + FAST; + int TCS = 1; + cin >> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#ifdef ONLINE_JUDGE +#define dbg(...) +#else +#include "Assets/debug.h" +#endif +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define ins insert +#define pb push_back +#define ppb pop_back +#define sz(x) (int)(x).size() +#define all(x) x.begin(), x.end() +#define rep(i,a,b) for(int i=a; i=b; --i) +#define yn(f) f? cout<<"YES\n":cout<<"NO\n" +#define FAST (ios_base::sync_with_stdio(false), cin.tie(nullptr)); +ll pow(ll x,ll y,ll m=1e9+7) {ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + string a,b,c; + cin>>a>>b>>c; + rep(i,0,sz(a)) + { + if(a[i]!=c[i] && b[i]!=c[i]) + { + yn(0); + return; + } + } + yn(1); +} + +signed main() +{ + FAST; + int TCS = 1; + cin >> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#ifdef ONLINE_JUDGE +#define dbg(...) +#else +#include "Assets/debug.h" +#endif +#define int long long +#define ll long long +#define endl '\n' +#define ff first +#define ss second +#define ins insert +#define pb push_back +#define ppb pop_back +#define sz(x) (int)(x).size() +#define all(x) x.begin(), x.end() +#define rep(i,a,b) for(int i=a; i=b; --i) +#define yn(f) f? cout<<"YES\n":cout<<"NO\n" +#define FAST (ios_base::sync_with_stdio(false), cin.tie(nullptr)); +ll pow(ll x,ll y,ll m=1e9+7) {ll ans=1;x%=m;while(y){if(y&1)ans=(ans*x)%m;x=(x*x)%m;y>>=1;}return ans;} + +void solve() +{ + int l1,r1,l2,r2; + cin>>l1>>r1>>l2>>r2; + int ans=0; + rep(i,l1,r1+1) + { + if(i>=l2 && i<=r2) + { + ans=i; + break; + } + } + if(ans) cout<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "<