Codeforces Round 952 (Div 4) | Video Solutions - A to H1 | by Viraj Chandra | TLE Eliminators

  Рет қаралды 11,994

TLE Eliminators - by Priyansh

TLE Eliminators - by Priyansh

Күн бұрын

Пікірлер: 87
@TLE_Eliminators
@TLE_Eliminators 5 ай бұрын
Please fill the feedback form for PCD: forms.gle/qoc6BDkEeCntCncu8
@shashankvashishtha4454
@shashankvashishtha4454 5 ай бұрын
ah, finally Viraj sir, he good PCD very very good, please assign viraj sir always or most of the time.
@anubhavmishra9867
@anubhavmishra9867 5 ай бұрын
Best explanation for the problems till now
@deathigniter2155
@deathigniter2155 5 ай бұрын
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
@shreyanshjain1595
@shreyanshjain1595 5 ай бұрын
TLE ELIMINATORS IS IMPROVING DAY-BY-DAY CONTESTS -AFTER-CONTESTS KUDOOS TO THE TEAM KEEP IT UP
@lofibeats2344
@lofibeats2344 5 ай бұрын
The way you explained g with the exact intuition you had during contest is just awesome. Keep this quality
@ankitghosh9873
@ankitghosh9873 5 ай бұрын
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
@manpatel9157
@manpatel9157 5 ай бұрын
Sir, Please upload Leetcode Weekly Contest 401 Solutions. We're addicted to your explanation🥺🙏
@NITISHMISHRA-nr8fi
@NITISHMISHRA-nr8fi 4 ай бұрын
man this is like so good . these kind of explanation with intution is what makes a difference !
@TFue01
@TFue01 5 ай бұрын
loved the explanation of the E question was absolutely on point
@the_ghost_of_uchiha5939
@the_ghost_of_uchiha5939 5 ай бұрын
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-yy6qp
@JIGARSINGTHAKOR-yy6qp 5 ай бұрын
yes i got hacked after contest🥲
@VirajChandra
@VirajChandra 5 ай бұрын
Hi! Yes, you are correct. I have cleared this out in the other comments and also attached the correct submission link.
@the_ghost_of_uchiha5939
@the_ghost_of_uchiha5939 5 ай бұрын
😇
@puneet6946
@puneet6946 5 ай бұрын
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 😊
@pratyushdubey5362
@pratyushdubey5362 5 ай бұрын
Thanks for such a detailed explanation.
@jackma9528
@jackma9528 5 ай бұрын
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.che634
@harshyadav4-yearb.tech.che634 5 ай бұрын
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.
@VirajChandra
@VirajChandra 5 ай бұрын
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.che634
@harshyadav4-yearb.tech.che634 5 ай бұрын
@@VirajChandra okay got it
@channel-te5vk
@channel-te5vk 5 ай бұрын
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
@VirajChandra
@VirajChandra 5 ай бұрын
A pointer for 10^12 works. Base point, try not to overflow. Had this been python we would have been good enough.
@channel-te5vk
@channel-te5vk 5 ай бұрын
@@VirajChandra Yes exactly.
@AyushGupta-ux4gq
@AyushGupta-ux4gq 5 ай бұрын
Thanks bro
@SubhranilKar-r6u
@SubhranilKar-r6u 5 ай бұрын
@@VirajChandra can you explain why we should take higher limit r = 1e18 ? can't undestand that.
@RashedunnabiRashed
@RashedunnabiRashed 5 ай бұрын
Awesome explanation viraj🎉
@Gyanpapi_
@Gyanpapi_ 5 ай бұрын
I did like the way he explained ,super
@pabitrakb5291
@pabitrakb5291 5 ай бұрын
Thank you for this Great explanation
@dipanshuraj18
@dipanshuraj18 5 ай бұрын
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
@VirajChandra
@VirajChandra 5 ай бұрын
Only one element has to be equal to all sum.
@ishwarreddy8820
@ishwarreddy8820 5 ай бұрын
want discussions for every contest
@SubhranilKar-r6u
@SubhranilKar-r6u 5 ай бұрын
in problem F , why did you take higher limit = 1e18?
@priyanshubari9685
@priyanshubari9685 5 ай бұрын
great explanation. keep it up!
@prakashgk-tz3fv
@prakashgk-tz3fv 5 ай бұрын
In question E, k % ( a * b) and k /(a * b)
@VirajChandra
@VirajChandra 5 ай бұрын
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-tz3fv
@prakashgk-tz3fv 5 ай бұрын
@@VirajChandra Okey sir got it thank you
@NOWSHINTABASSUM-vg8lx
@NOWSHINTABASSUM-vg8lx 5 ай бұрын
aaap best ho jiii.......
@vickyroy3595
@vickyroy3595 5 ай бұрын
i too got same intutuion when i look into problem d
@rituraj6752
@rituraj6752 5 ай бұрын
Viraj bhaiya god op
@001_abhijeetkumar7
@001_abhijeetkumar7 5 ай бұрын
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
@VirajChandra
@VirajChandra 5 ай бұрын
What is the TC 16?
@001_abhijeetkumar7
@001_abhijeetkumar7 5 ай бұрын
@@VirajChandra Done, all test cases passed.
@sanjusabu5488
@sanjusabu5488 5 ай бұрын
@@001_abhijeetkumar7 faced the same problem what the issue?
@rachakondaeshwar4129
@rachakondaeshwar4129 5 ай бұрын
F is an easy binary search on the answer . Missed it...
@gigachad2419
@gigachad2419 5 ай бұрын
Mine got hacked anyways
@ramanujangunturu4996
@ramanujangunturu4996 5 ай бұрын
I did try like that but it didn't work for me though
@geethakarnati
@geethakarnati 5 ай бұрын
Could anyone tell that test case where binary search getting wrong
@Idk-qg7hb
@Idk-qg7hb 5 ай бұрын
@@geethakarnatikyu mc?
@Idk-qg7hb
@Idk-qg7hb 5 ай бұрын
@@geethakarnatihack karega?
@AyaGamal2010
@AyaGamal2010 5 ай бұрын
Thanks!
@gnanaprakash-ravi
@gnanaprakash-ravi 5 ай бұрын
Hi Viraj sir. Your vs code sectioning looks awesome. Please teach us how to set it up. Thanks!!
@VirajChandra
@VirajChandra 5 ай бұрын
Sure, I'll try to cover a video on it.
@kevinjoythomas6528
@kevinjoythomas6528 5 ай бұрын
good explaination
@yashupadhyay8909
@yashupadhyay8909 5 ай бұрын
how are you able to submit a solution at 5: 38 pm ??
@VirajChandra
@VirajChandra 5 ай бұрын
Which one?
@akshitpanwar6505
@akshitpanwar6505 5 ай бұрын
5:38 pm is according to Moscow time
@selvaarumugam370
@selvaarumugam370 5 ай бұрын
F will also work on priority queue it passed for me
@vanshrana7807
@vanshrana7807 5 ай бұрын
+1
@VirajChandra
@VirajChandra 5 ай бұрын
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.
@gigachad2419
@gigachad2419 5 ай бұрын
Plz share Submission and Approach
@gigachad2419
@gigachad2419 5 ай бұрын
@@VirajChandra Sir can you please share the approach with priority queues
@vanshrana7807
@vanshrana7807 5 ай бұрын
@@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-qk7pj
@MDHabibur-qk7pj 5 ай бұрын
r=10^18 dosen't work. use 10^12 instead of 10^18. it works prefect
@VirajChandra
@VirajChandra 5 ай бұрын
Hi! Yes, you are correct. I have cleared this out in the other comments and also attached the correct submission link.
@Phoenix-dd3kb
@Phoenix-dd3kb 5 ай бұрын
How can I change my c++14 compiler to c++17 I have the required gcc version....Anyone please help
@TusharKumar-ty8kh
@TusharKumar-ty8kh 5 ай бұрын
download from mingw
@darshanrajpattanaik2154
@darshanrajpattanaik2154 5 ай бұрын
Use compiler flag `-std=c++17` while compiling your c++ file without backticks
@VirajChandra
@VirajChandra 5 ай бұрын
Are you using some extension?
@samsingh43
@samsingh43 5 ай бұрын
use c++20 and precompile. If u want I can give complete setup (my github repo)
@Phoenix-dd3kb
@Phoenix-dd3kb 5 ай бұрын
@@samsingh43 yes please
@YashDabhade-cr5my
@YashDabhade-cr5my 5 ай бұрын
Sir, why your solution of F got hacked
@VirajChandra
@VirajChandra 5 ай бұрын
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.
@YashDabhade-cr5my
@YashDabhade-cr5my 5 ай бұрын
@@VirajChandra got it
Leetcode Biweekly Contest 144 | Video Solutions - A to D | by Viraj Chandra | TLE Eliminators
1:42:08
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 16 МЛН
Одну кружечку 😂❤️
00:12
Денис Кукояка
Рет қаралды 1,2 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 36 МЛН
Codeforces Round 952 | Final Boss | Problem F
22:52
FunCoding
Рет қаралды 242
G. D-Function | Codeforces Round 952 (Div. 4)
10:09
Mukto Academy
Рет қаралды 242
Leetcode Weekly Contest 426 | Video Solutions - A to D | by Jay Shirgupe | TLE Eliminators
1:15:49
Codeforces Round 989 (Div 1 + 2) | Video Solutions - A to D | by Abhinav Kumar | TLE Eliminators
1:37:48
💥ФЕЙГІН повернувся із СУДЖИ і шокував заявою
36:27
Телеканал Прямий
Рет қаралды 271 М.
[Solutions A - H2] #Codeforces Round 952 Div 4 Solution Discussion (with Shayan)
1:30:07
Competitive Programming with Shayan
Рет қаралды 4,7 М.
Codeforces Round 953 (Div 2) | Video Solutions - A to E | by Abhinav Kumar | TLE Eliminators
1:48:23