Пікірлер
@RastyRocky
@RastyRocky 4 сағат бұрын
Can you please make a video on selecting problems for practicing and which resources do you use learn for learning topics?
@rishabhnegi1937
@rishabhnegi1937 Күн бұрын
Worst explanation
@grandparick3176
@grandparick3176 Күн бұрын
In problem D1, it says you start with some element X but what exactly is that X? We don't really take anything X as input so how do we exactly guess what x to take?
@laxmanchoudhary4450
@laxmanchoudhary4450 2 күн бұрын
please explain what you have written in contest do not code a new code while explaining it creates problem in understanding the code
@jaadu2551
@jaadu2551 2 күн бұрын
Need a video on parallel binary search
@kz_cbble9670
@kz_cbble9670 2 күн бұрын
Thanks for codeforces. Can you also do this for atcoder?
@aryanc403
@aryanc403 2 күн бұрын
kzfaq.info/sun/PLY4qyBz7rQ86kKUmXmAcr8_FUyGIy7iJ2
@KuldeepSingh-yo7sh
@KuldeepSingh-yo7sh 2 күн бұрын
sir D1 wala bilkul smjh mai nhi aya
@faiazmahmud6277
@faiazmahmud6277 2 күн бұрын
u can ask me in cf id i can explain u there
@shivapandey8510
@shivapandey8510 3 күн бұрын
In question C, we can store the characters along with their frequency without sorting and then keep popping the front element for one time and then the other element. This continues while size of q is greater than 1 and at last we can pop the last character. #include <bits/stdc++.h> using namespace std; #define ll long long int #define pp pair<int,char> int main() { ll t; cin>>t; while(t--) { ll n; cin>>n; string s; cin>>s; unordered_map<char,int> mp; for(auto &x : s) mp[x]++; queue<pp> pq; for(auto &x: mp) pq.push({x.second, x.first}); string st=""; while(pq.size()>1) { auto tp= pq.front(); pq.pop(); st.push_back(tp.second); if(tp.first-1>0) { auto tp1 = pq.front(); pq.pop(); st.push_back(tp1.second); pq.push({tp.first-1,tp.second}); if(tp1.first>1) pq.push({tp1.first-1,tp1.second}); } } if(pq.size()) { auto tp = pq.front(); pq.pop(); for(int i=0;i<tp.first;i++) st.push_back(tp.second); } cout<<st<<endl; } } This also shows accepted.
@aryanc403
@aryanc403 3 күн бұрын
Yes this is another correct solution. Official editorial has this solution and a reason why it works. codeforces.com/blog/entry/132953
@vyomgoyal3125
@vyomgoyal3125 3 күн бұрын
bhai yeh aapke baal pure white kaise ho gaye ek dum se ?
@sagnikbiswas3268
@sagnikbiswas3268 2 күн бұрын
probably the lighting
@divaspathak8857
@divaspathak8857 3 күн бұрын
Sir can you please continue doing this for upcoming codeforces contest as well?
@aryanc403
@aryanc403 3 күн бұрын
I do this for almost every contest. :)
@csbotlol
@csbotlol 3 күн бұрын
In google OA there was a question in which given a tree we needed to find sum of medians of all odd length path of the tree.. i tried solving it using ordered set but got TLE.. tips on how to solve it
@vineetsingh4707
@vineetsingh4707 3 күн бұрын
Can someone suggest me like it took me almost 1 hour to hit the approach for the second one.
@AnkitSingh-ex6ib
@AnkitSingh-ex6ib 3 күн бұрын
Number of question solve by you in today contest can send someone to depression 😢 but motivating at same time
@padhai_karle_bhai
@padhai_karle_bhai 3 күн бұрын
Thanks a lot for this .
@shreyanray7624
@shreyanray7624 3 күн бұрын
congratulations! nice performance today
@aryanc403
@aryanc403 3 күн бұрын
Thank you very much!
@hkrai1372
@hkrai1372 3 күн бұрын
Will u Atcoder regular contest solution?
@aryanc403
@aryanc403 3 күн бұрын
Not planning to.
@frouMagician
@frouMagician 4 күн бұрын
didnt know pedro pascal started cp
@llarn.i5103
@llarn.i5103 4 күн бұрын
Amazing thank you so much
@zebra-er6xc
@zebra-er6xc 4 күн бұрын
C: 8:30
@prantobala8505
@prantobala8505 4 күн бұрын
plz add subtitle for better understanding.
@Study_With_Sachin
@Study_With_Sachin 4 күн бұрын
bro this is live stream how he can add subtitles . #aryan sir orz
@prantobala8505
@prantobala8505 4 күн бұрын
don't stop bro. Love from Bangladesh!
@HridoyNandi-cn3qk
@HridoyNandi-cn3qk 4 күн бұрын
bro whats your rating? i am also from bd
@prantobala8505
@prantobala8505 4 күн бұрын
@@HridoyNandi-cn3qk CF max 1122. you?
@HridoyNandi-cn3qk
@HridoyNandi-cn3qk 2 күн бұрын
@@prantobala8505 1200 max
@user-xk6ob5eb8t
@user-xk6ob5eb8t 4 күн бұрын
useful video,hope u do more vid like this
@kshitijtakarkhede7833
@kshitijtakarkhede7833 5 күн бұрын
Sir , can you explain distance colour problem , why we divide grid into k*k grids in n*m grid problem of codeforces
@ronakjain8164
@ronakjain8164 6 күн бұрын
I was trying G1 using binary search. But for checking if the division is possible. I was doing like consider that length is mid. So first mid character should be same. Now to count the number of subarrays which can have the common prefix of mid length I was doing something like int j = 0; int cnt = 0; for(int i = 0; i < n;i++){ if(s[i] == s[j]){ j++; if(j == mid){ cnt++; j = 0; } }else{ if(s[i] == s[0]){ j = 1; }else{ j = 0; } } } I have a pointer j which is telling which character to compare.. and when it reaches mid it means we have got one substring with the prefix and increase cnt. But I don't know why Is it giving wrong answer on test 3. Can you please help me out on this ? codeforces.com/contest/1968/submission/277009975
@sohamsanap5065
@sohamsanap5065 6 күн бұрын
Waiting for codechef staters 147 discussion video
@shivanshgoel2504
@shivanshgoel2504 6 күн бұрын
Problem E - > Plz compile this code and told me error this give me TLE ON 2ND TEST CASE #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> answr; for (int i = 0; i < n; i++) { int a = 0; int b = 0; cin >> a; cin >> b; vector<int> dp(200001, -1); vector<int> prefixsum(200001); for (int i = a; i <= b; i++) { int count = 0; int p = i; while (p) { count++; p /= 3; if (dp[p] != -1) { prefixsum[i] = dp[p]; continue; } } prefixsum[i] = count; dp[i] = count; } for (int i = a + 1; i <= b; i++) { prefixsum[i] += prefixsum[i - 1]; } int ans = prefixsum[a] * 2 + (prefixsum[b] - prefixsum[a]); answr.push_back(ans); } for (int i = 0; i < n; i++) { cout << answr[i]; cout << endl; } return 0; }
@simplify5251
@simplify5251 7 күн бұрын
what's your age sir
@ashishjukaria7332
@ashishjukaria7332 7 күн бұрын
this was my first time watching your video for upsolving , and i really like the way to break it , go in depth, plus code it . great work
@aryanc403
@aryanc403 7 күн бұрын
Glad it helped!
@iayushch
@iayushch 8 күн бұрын
Dear sir, If possible ajh codechef contest ka v video banna dijega
@AnkitRaj-ux7lv
@AnkitRaj-ux7lv 8 күн бұрын
Sir hamesha yahi hota hai ajj Maine A,b,c kar liya lekin ye question laga normal concept se hojayega but nahi hua Mughe ye topics karne hai sir segment tree, dp,graph please refer some road map??????
@sagnikbiswas3268
@sagnikbiswas3268 8 күн бұрын
thanks a lot for this. it takes a lot of effort to not only take the contest, but then make a 2 hour long vid. One day, I hope to achieve your level of problem-solving ability!
@aryanc403
@aryanc403 8 күн бұрын
Good luck!
@NafeezMahmudKhan
@NafeezMahmudKhan 8 күн бұрын
love you vai
@vaibhavyadav1787
@vaibhavyadav1787 8 күн бұрын
Hue Hue Hue Good One!!
@kumkumslab5811
@kumkumslab5811 8 күн бұрын
nice approach thanks
@vishalshrivastav1710
@vishalshrivastav1710 8 күн бұрын
while(1){ cout<<" Thankyou"; } you are really good teacher ❤❤
@LuffySingh-b4h
@LuffySingh-b4h 10 күн бұрын
Hello bhaiya , can u make a solution discussion for AtCoder's beginner contest 367 , I am still stuck on problem D
@hkrai1372
@hkrai1372 10 күн бұрын
will you upload recent atcoder contest solution?
@mankeshdhanawat5613
@mankeshdhanawat5613 10 күн бұрын
1:00:03 can you plz share the books, with good problems on game theory !
@aryanc403
@aryanc403 10 күн бұрын
www.annarchive.com/files/Winning%20Ways%20for%20Your%20Mathematical%20Plays%20V1.pdf
@superhumans5687
@superhumans5687 11 күн бұрын
This is absolute legend, all others just solve 5 or 6 this guy solves all of them and explains too
@nikhilbabar2226
@nikhilbabar2226 11 күн бұрын
I am getting tle on 21th testcase, plz help me debug For problem C Arrays.sort(arr); for(int i = n-2 ; i >= 0 ; i-=2){ if(k <= 0){ break; } else if(arr[i+1]-arr[i] <= k){ k -= arr[i+1]-arr[i]; arr[i] = arr[i+1]; } else { arr[i] += k; break; } } long ans = 0; for(int i = n-2 ; i >= 0 ; i-=2){ ans += arr[i+1]-arr[i]; } if(arr.length % 2 == 1){ ans += arr[0]; } pl(ans);
@sudhanshupandey6096
@sudhanshupandey6096 13 күн бұрын
for f , nlogn tc for generating suffix array is giving tc ?
@jjbpython
@jjbpython 13 күн бұрын
Please make a video on how to sovle these game theory problems, they are the worst.
@faiazmahmud6277
@faiazmahmud6277 12 күн бұрын
u have not seen worst yet mayb
@akshattheintrovert3153
@akshattheintrovert3153 13 күн бұрын
Easiest A to C in div 2 in recent times
@worldtravellzzz4585
@worldtravellzzz4585 13 күн бұрын
❤❤❤
@prateek6277
@prateek6277 14 күн бұрын
Why does it fails ? D #include <bits/stdc++.h> #define ll long long #define vl vector<long long> #define pb(x) push_back(x) #define all(x) x.begin(),x.end() #define fill(n,arr) for(int i=1;i<=n;i++){ll x;cin>>x;arr.pb(x);} #define rep(n) for(int i=0;i<n;i++) #define mod 1000000007 using namespace std; void solve() { ll n; cin>>n; vl arr; fill(n,arr); vector<unsigned long long int> pre(n,0); pre[0]=arr[0]; for(int i=1;i<n;i++){ pre[i]=pre[i-1]+arr[i]; } string s; cin>>s; unsigned long long int ans=0; int i=0,j=n-1; while(i<j){ while(s[i]!='L') i++; while(s[j]!='R') j--; if(i>=j) break; if(i==0){ ans+=pre[j]; } else{ ans+=(pre[j]-pre[i-1]); } i++; j--; } cout<<ans<<endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t; cin >> t; while (t--) { solve(); } return 0; } It is HACKED. Fails on some test cases.
@JIGARSINGTHAKOR-yy6qp
@JIGARSINGTHAKOR-yy6qp 15 күн бұрын
Mere me to gorila dikh hi nahi rahe thi jiski vajah se question hi samaj naii aya😅
@guptafactory
@guptafactory 15 күн бұрын
The problem statement was updated with that Gorilla grid at the very end. It would be beneficial, if pre-included in the statement.
@kondekarvaishnavi2348
@kondekarvaishnavi2348 15 күн бұрын
You made E just awesome. Tq aryanc🥳🥳
@arthkulkarnihere7274
@arthkulkarnihere7274 15 күн бұрын
D🙌
@akshatchaudhary9393
@akshatchaudhary9393 15 күн бұрын
thanks for the explanation
@aryanc403
@aryanc403 15 күн бұрын
Codeforces blog with hints - codeforces.com/blog/entry/132628 Greedy does not work in F. It fails on sample itself. codeforces.com/contest/2000/submission/276318164 This is mainly because as score on a particular rectangle increases, the new delta cost decreases.