From a7ff9b401555a413721612a924573500144e94ad Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Wed, 8 May 2024 23:00:54 +0600 Subject: [PATCH] added 1756B+E+K+M --- Codes/1765 B - Broken Keyboard/1765B.cpp | 39 +++ Codes/1765 E - Exchange/1765E.cpp | 26 ++ Codes/1765 K - Torus Path/1765K.cpp | 36 +++ Codes/1765 M - Minimum LCM/1765M.cpp | 35 +++ Readme.md | 374 ++++++++++++----------- 5 files changed, 325 insertions(+), 185 deletions(-) create mode 100644 Codes/1765 B - Broken Keyboard/1765B.cpp create mode 100644 Codes/1765 E - Exchange/1765E.cpp create mode 100644 Codes/1765 K - Torus Path/1765K.cpp create mode 100644 Codes/1765 M - Minimum LCM/1765M.cpp diff --git a/Codes/1765 B - Broken Keyboard/1765B.cpp b/Codes/1765 B - Broken Keyboard/1765B.cpp new file mode 100644 index 0000000..63c1ec8 --- /dev/null +++ b/Codes/1765 B - Broken Keyboard/1765B.cpp @@ -0,0 +1,39 @@ +#include +using namespace std; +#define ll long long +#define endl '\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() +{ + ll n; + string s; + cin>>n>>s; + if(n%3==2) + { + cout<<"NO\n"; + return; + } + for(int i=2; i> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#define ll long long +#define endl '\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() +{ + ll n,a,b; + cin>>n>>a>>b; + if(a>b) cout<<1<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#define ll long long +#define endl '\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() +{ + ll n; + cin>>n; + ll grid[n][n]; + ll sum=0,mn=INT_MAX; + for(ll i=0; i>grid[i][j]; + sum += grid[i][j]; + } + mn = min(mn, grid[i][n-1-i]); + } + cout<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "< +using namespace std; +#define ll long long +#define endl '\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() +{ + ll n; + cin>>n; + ll ans=1; + for(ll i=2; i*i<=n; ++i) + { + if(n%i==0) + { + cerr<> TCS; + for (int TC = 1; TC <= TCS; ++TC) + { + // cout<<"Case "<