Please fill the feedback form for PCD: forms.gle/qoc6BDkEeCntCncu8
@shashankvashishtha44545 ай бұрын
ah, finally Viraj sir, he good PCD very very good, please assign viraj sir always or most of the time.
@anubhavmishra98675 ай бұрын
Best explanation for the problems till now
@deathigniter21555 ай бұрын
Kya hi pyaara aur bdhia teacher hai.. thank you sir.... baaki sab teachers ko smjhana nahi aata priyansh bhaia.. please let this teacher do all your videos.... he is amazing
@shreyanshjain15955 ай бұрын
TLE ELIMINATORS IS IMPROVING DAY-BY-DAY CONTESTS -AFTER-CONTESTS KUDOOS TO THE TEAM KEEP IT UP
@lofibeats23445 ай бұрын
The way you explained g with the exact intuition you had during contest is just awesome. Keep this quality
@ankitghosh98735 ай бұрын
Intuition + world class explanation ! Please TLE make all the editorials by Viraj and Gaurish,They are LGM at explanation ! other than these two all are newbies . Guys if you agree like the comment so that they can hear asap
@manpatel91575 ай бұрын
Sir, Please upload Leetcode Weekly Contest 401 Solutions. We're addicted to your explanation🥺🙏
@NITISHMISHRA-nr8fi4 ай бұрын
man this is like so good . these kind of explanation with intution is what makes a difference !
@TFue015 ай бұрын
loved the explanation of the E question was absolutely on point
@the_ghost_of_uchiha59395 ай бұрын
Great explanation Sir! 😇 Those who are trying for problem F the working range of r is 1e13 not 1e18.So don't take more than that. Because in worst case : power[i] = 2*1e5 cooldown[i]=1 and mid=(0+1e13)/2 => 1e13/2; Therefore, attack Power at that moment (2*1e5*1e13)/2 ==> 1e18. Therefore range of 'r' more than that won't work.
@JIGARSINGTHAKOR-yy6qp5 ай бұрын
yes i got hacked after contest🥲
@VirajChandra5 ай бұрын
Hi! Yes, you are correct. I have cleared this out in the other comments and also attached the correct submission link.
@the_ghost_of_uchiha59395 ай бұрын
😇
@puneet69465 ай бұрын
Great explanation, I've seen a lot of people do this but they all skip some or the other steps but this was just fantastic. I hope you continue the good work 😊
@pratyushdubey53625 ай бұрын
Thanks for such a detailed explanation.
@jackma95285 ай бұрын
sir, i'm having an issue, i can't solve div2 problems but i'm not complete newbie, shld i join level2 tle course
@harshyadav4-yearb.tech.che6345 ай бұрын
F is testcse pe nhi chlega.Jab n ki value 2*10^5 ho,saare ai ki value 2*10^5 ho aur saare ci ki value 1 ho. Fir hum log jo sum le rhe hai loop me wo overflow kar jayega. Isliye apne ko loop me hi check karlena chahiye aur jaise hi sum health se bada hota to whi pe break kar dena chahiye.
@VirajChandra5 ай бұрын
Hi, not exactly this, since I already have a check for h health becoming zero. So if everything is 2*10^5 then h becomes zero before going to BS. Correct hack to my solution would be if we give some case where I don’t exhaust h before going to BS. Anyways, hacking is fun! I’ll change the submission link so that we get a better solution.
@harshyadav4-yearb.tech.che6345 ай бұрын
@@VirajChandra okay got it
@channel-te5vk5 ай бұрын
In F . Try setting the high pointer =h *(2e5). This will work. Because worst case scenario is attack is 1 and its turn is 2e5
@VirajChandra5 ай бұрын
A pointer for 10^12 works. Base point, try not to overflow. Had this been python we would have been good enough.
@channel-te5vk5 ай бұрын
@@VirajChandra Yes exactly.
@AyushGupta-ux4gq5 ай бұрын
Thanks bro
@SubhranilKar-r6u5 ай бұрын
@@VirajChandra can you explain why we should take higher limit r = 1e18 ? can't undestand that.
@RashedunnabiRashed5 ай бұрын
Awesome explanation viraj🎉
@Gyanpapi_5 ай бұрын
I did like the way he explained ,super
@pabitrakb52915 ай бұрын
Thank you for this Great explanation
@dipanshuraj185 ай бұрын
In 3Q. (Good Prefix) If we take an array 1 2 2 3 then 5≠3 but 2+2=3+1 so it's a good array but it won't be counted according to the given solution.... Please help me out
@VirajChandra5 ай бұрын
Only one element has to be equal to all sum.
@ishwarreddy88205 ай бұрын
want discussions for every contest
@SubhranilKar-r6u5 ай бұрын
in problem F , why did you take higher limit = 1e18?
@priyanshubari96855 ай бұрын
great explanation. keep it up!
@prakashgk-tz3fv5 ай бұрын
In question E, k % ( a * b) and k /(a * b)
@VirajChandra5 ай бұрын
Hi! Since side c has to be integer, a*b should fully divide k. Hence k%(a*b). Next, whichever side value you get has to be less than equal to z, since your side c cannot go above z. Hence second condition.
@prakashgk-tz3fv5 ай бұрын
@@VirajChandra Okey sir got it thank you
@NOWSHINTABASSUM-vg8lx5 ай бұрын
aaap best ho jiii.......
@vickyroy35955 ай бұрын
i too got same intutuion when i look into problem d
@rituraj67525 ай бұрын
Viraj bhaiya god op
@001_abhijeetkumar75 ай бұрын
can anyone help me with this, i am using priority queue and getting wrong answer at test case 16 #include using namespace std; int main(){ long long t; cin>>t; vector ans; while(t--){ int h,n; cin>>h>>n; vector damage(n),cooldown(n); for(long long i=0;i>damage[i]; for(long long i=0;i>cooldown[i]; priority_queue pq; for(long long i=0;i
@VirajChandra5 ай бұрын
What is the TC 16?
@001_abhijeetkumar75 ай бұрын
@@VirajChandra Done, all test cases passed.
@sanjusabu54885 ай бұрын
@@001_abhijeetkumar7 faced the same problem what the issue?
@rachakondaeshwar41295 ай бұрын
F is an easy binary search on the answer . Missed it...
@gigachad24195 ай бұрын
Mine got hacked anyways
@ramanujangunturu49965 ай бұрын
I did try like that but it didn't work for me though
@geethakarnati5 ай бұрын
Could anyone tell that test case where binary search getting wrong
@Idk-qg7hb5 ай бұрын
@@geethakarnatikyu mc?
@Idk-qg7hb5 ай бұрын
@@geethakarnatihack karega?
@AyaGamal20105 ай бұрын
Thanks!
@gnanaprakash-ravi5 ай бұрын
Hi Viraj sir. Your vs code sectioning looks awesome. Please teach us how to set it up. Thanks!!
@VirajChandra5 ай бұрын
Sure, I'll try to cover a video on it.
@kevinjoythomas65285 ай бұрын
good explaination
@yashupadhyay89095 ай бұрын
how are you able to submit a solution at 5: 38 pm ??
@VirajChandra5 ай бұрын
Which one?
@akshitpanwar65055 ай бұрын
5:38 pm is according to Moscow time
@selvaarumugam3705 ай бұрын
F will also work on priority queue it passed for me
@vanshrana78075 ай бұрын
+1
@VirajChandra5 ай бұрын
That’s great! I mentioned in the video that I did not give alot of thought to the time complexity of a quick implementation in priority queue, so I went ahead with bs. It’s nice that you were able to solve it using priority queue.
@gigachad24195 ай бұрын
Plz share Submission and Approach
@gigachad24195 ай бұрын
@@VirajChandra Sir can you please share the approach with priority queues
@vanshrana78075 ай бұрын
@@gigachad2419 here is the approach just maintain a minheap where you keep the next time when you can use ith attack : #include using namespace std; #define ll long long int #define uni unsigned long long int #define pb(x) push_back(x) #define sz(arr) arr.size() #define ssz(s) s.length() #define nl endl #define read(arr,n) for(ll i=0;i>arr[i] #define srt(arr) sort(arr.begin(),arr.end()) #define srtr(arr) sort(arr.rbegin(),arr.rend()) #define rev(arr) reverse(arr.begin(),arr.end()) #define pi pair #define pl pair #define vi vector #define vll vector #define vuni vector #define vpi vector #define vpl vector #define vii vector #define vlll vector #define mn(a) *min_element(a.begin(),a.end()) #define mx(a) *max_element(a.begin(),a.end()) #define vs vector #define vss vector #define vc vector #define vcc vector #define pre_sum(pre,arr,n) for(i=1;i=0;i--) suf[i]=suf[i+1]+arr[i] const double pie=3.14159265358979323846264338327950; const ll mod=1e9+7; ll gcd(ll a,ll b){ while(a!=0 && b!=0){ if(a>b) a%=b; else b%=a; } if(a==0) return b; return a; } class cmp{ public: bool operator()(pl p1,pl p2){ return p1.first>p2.first; } }; int main() { int t; cin>>t; while(t--){ ll h,n,time=1,p=0; cin>>h>>n; vll a(n),c(n); read(a,n); read(c,n); priority_queue pq; //p.first=time,p.second=index for(ll i=0;i
@MDHabibur-qk7pj5 ай бұрын
r=10^18 dosen't work. use 10^12 instead of 10^18. it works prefect
@VirajChandra5 ай бұрын
Hi! Yes, you are correct. I have cleared this out in the other comments and also attached the correct submission link.
@Phoenix-dd3kb5 ай бұрын
How can I change my c++14 compiler to c++17 I have the required gcc version....Anyone please help
@TusharKumar-ty8kh5 ай бұрын
download from mingw
@darshanrajpattanaik21545 ай бұрын
Use compiler flag `-std=c++17` while compiling your c++ file without backticks
@VirajChandra5 ай бұрын
Are you using some extension?
@samsingh435 ай бұрын
use c++20 and precompile. If u want I can give complete setup (my github repo)
@Phoenix-dd3kb5 ай бұрын
@@samsingh43 yes please
@YashDabhade-cr5my5 ай бұрын
Sir, why your solution of F got hacked
@VirajChandra5 ай бұрын
Initially, when I put a check for h being negative, I thought that would suffice the overflow check. But I think we can bypass it, so keeping high as a lower value works now. Solution has been updated.