en
Feedback
Codeforces|Leetcode|Codechef free solutions

Codeforces|Leetcode|Codechef free solutions

Open in Telegram

Free codeforces, Codechef, Leetcode solutions are available 😍😍😍😍😍😍 Helped More than 200+ students to crack coding round in 2022 and helped placed them in Good companies. 🥳🥳🥳🤩🤩🤩 Dm @Cpsoln if you want help in coding round.

Show more
4 317
Subscribers
No data24 hours
-137 days
-5230 days
Posts Archive
vectorb, c; vector> a=logs; b.push_back(a[0][0]); c.push_back(a[0][1]); for(int i=1;i=ma) { if(c[i]==ma) { if(b[i]

I will post free solution in channel

Leetcode solutions available

Dm fast guys 🔥🔥

Mivi earbuds at just Rs249 Dm fast for link🥳🥳🥳

If u need help in any oa (coding round) in any company Dm @Cpsoln

Contact me before your coding round and book your slot 100% solutions guaranteed 🔥🔥🔥🔥🔥 ‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️ Solution for all companies will be available 🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁 Get a special discount Dm @Cpsoln ‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️ Don't trust on other telegram channels they will take money and block you

Contact me before your coding round and book your slot 100% solutions guaranteed 🔥🔥🔥🔥🔥 ‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️ Solution for all companies will be available 🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁 Get a special discount Dm @Cpsoln ‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️ Don't trust on other telegram channels they will take money and block you

Enjoy guys Subscribe the channel for more codes🥳🥳

#include <bits/stdc++.h> #include <math.h> //in the name of god,aka allah //gray sety orz #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC optimize("-fgcse") #pragma GCC optimize("-fgcse-lm") #pragma GCC optimize("-fipa-sra") #pragma GCC optimize("-ftree-pre") #pragma GCC optimize("-ftree-vrp") #pragma GCC optimize("-fpeephole2") #pragma GCC optimize("-fsched-spec") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("-falign-jumps") #pragma GCC optimize("-falign-loops") #pragma GCC optimize("-falign-labels") #pragma GCC optimize("-fdevirtualize") #pragma GCC optimize("-fcaller-saves") #pragma GCC optimize("-fcrossjumping") #pragma GCC optimize("-fthread-jumps") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("-freorder-functions") #pragma GCC optimize("-findirect-inlining") #pragma GCC optimize("-fhoist-adjacent-loads") #pragma GCC optimize("-frerun-cse-after-loop") #pragma GCC optimize("-ftree-switch-conversion") #pragma GCC optimize("-foptimize-sibling-calls") #pragma GCC optimize("-fexpensive-optimizations") #pragma GCC optimize("-fdelete-null-pointer-checks") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma GCC optimize("unroll-loops") using namespace std; #define pi pair<long long , long long> #define pii pair<long long , pair<long long , long long>> const int maxm = 5e5; const long long mod = 1e9 + 7 ; typedef long long ll; ll l,r,mid; ll n,m; ll dis[maxm] , sum[maxm]; ll darage[maxm] , ss , mm; queue<int> q; vector<pi> g[maxm] , z[maxm]; ll sath[maxm]; bool vis[maxm] , gos[maxm]; ll pedaret[maxm]; ll get_par(ll v){     if (pedaret[v]==v) return v;     return pedaret[v] = get_par(pedaret[v]); } void merge(ll r , ll q){     if (get_par(r)!=get_par(q))l+=max(darage[r],darage[q])*1ll*sath[r]*1ll*sath[q];     r = get_par(r) , q = get_par(q);     if (r!=q){         if (sath[r]<sath[q]) swap(r,q);         pedaret[q] = r;         sath[r] += sath[q];     }     return ; } ll pars1[maxm] , pars2[maxm]; vector<ll> se[maxm]; set<ll> st; ll rp[maxm]; pi w[maxm]; ll dp[maxm]; //ll rw[maxm][maxm]; map<ll,ll> mp,pm; int main(){     ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);     int t;     cin >>t;     while (t--){         cin>>n;         mp.clear();         pm.clear();         int a1,b1,a2,b2,a3,b3,a4,b4;                 cin >>a1>>b1>>a2>>b2>>a3>>b3>>a4>>b4;         mp[a1]++,pm[b1]++ ,mp[a2]++,pm[b2]++,mp[a3]++,pm[b3]++;         if (a1%2==a2%2){             l = a3%2;         }         else{             if (a1%2==a3%2) l = a2%2;             else l = a1%2;         }         if (b1%2==b2%2){             r = b3%2;         }         else{             if (b1%2==b3%2) r = b2%2;             else r = b1%2;         }         if (l%2==a4%2 && r%2==b4%2) cout<<"NO"<<endl;         else{             if (mp[1]>1 | mp[n]>1 | pm[1]>1| pm[n]>1){                 if(1){                     if (mp[1]>1) r = 1 , l = 1;                     if (mp[n]>1) r = 1 , l = n;                     if (mp[1]>1 | mp[n]>1 | pm[1]>1| pm[n]>1) r = n , l = 1;                     if (mp[1]>1 | mp[n]>1 | pm[1]>1| pm[n]>1) r = n , l = n;                     if (a4==r || b4==l) cout<<"YES"<<endl;                     else cout<<"NO"<<endl;                 }             }             else cout<<"YES"<<endl;         }     } }

B🥳🥳🥳🥳

#include<bits/stdc++.h> #define ll long long using namespace std; ll good(ll n){ if(n==0) return 0; ll cnt=0; ll b=sqrt(n); ll sq=b*b; cnt=(b-1)*3; ll l=n-sq; cnt+=(l/b); return ++cnt; } void solve() { ll a,b; cin>>a>>b; a--; cout<<good(b)-good(a)<<endl; } signed main() { ll T=1; cin >> T; while(T--) solve(); }

Subscribe the channel

B will be posted soon

🥳🥳🥳🥳🥳

void solve() {     int n, m, k;     string s, res = "";     cin >> n >> m >> s;     map<char, int> mp;     for(auto x: s) mp[x]++;     int cnt[26];     for(int i = 0; i < 26; i++) cnt[i] = 0;     for(auto x: mp){       cnt[x.ff - 'a'] = x.ss;     }     k = m;     while(k--){       int flag = 1;       int j = 0;       int mx = min(n / m, 26);       for(int i = 0; i < mx; i++, j++){           if(cnt[i] == 0){             flag = 0;             break;           }           cnt[i]--;         }         (flag) ? res.pb('a' + n / m) : res.pb('a' + j);     }     cout << res << endl; }

A done ✅✅✅

Get ready for today's codeforces contest