Applied exactly same approach on q3 but instead of running loop 2 times for second smallest i was using a variable chance for maintaining the chance of alias and bob
For no. 3, If v[i] is present 2 or more times,mex.push_back(v[i]); Else if v[i] is present 1 time ,take the min of them. After that insert it into mex vector and sort it and find from 0 to infinity that which element is not present in the mex array
@@AbhinavAwasthi sir am in one confusion that , am in 2nd yr 2nd sem , I started cp 1 month ago , can I go with it or to start web . Which is right time to start development as am in 2-2, please reply sir 🙂
Can anyone help me by sharing important properties of XOR that generally used in the problem solving. Like,x^x=0,x^0=0.But what else xor properties needed?
if u are using hashing based approach, try to hash them with two prime numbers and store result as a pair.By doing this , it will prevent hash collisions.
Sir I am not able to solve Div2B problems on codeforces which rating problms should I focus on and practice so that I can solve Div2B consistently and are ther any specfic topics i should study?
instead of removing the last number you inserted using pop back in problem B what you could have done is that first you should add the numbers which occur twice and then just normally add those who occur once, in that case this case of checking wont be required
but then there might be possiblity that in ans1 element of freq 2 is added and on ans2 only element with freq 1 is pushed so xor will not be equal a,=m i right?
Yeah, locking means final submission of your question, you can't submit more, and if you locked a question, you can try hacking codes of others for that question
Let's suppose, if there will be test case : n= 1; arr= [0]; Then for above test case your code will not going to print any thing, because you are running the for loop till
I was also able to do 3 problems (in 1 hour). This contest felt like codechef 😍(Bitwise and game theory), loved it
Amazing 🙌🏻
Applied exactly same approach on q3 but instead of running loop 2 times for second smallest i was using a variable chance for maintaining the chance of alias and bob
Your video is really helpful . Nice explanation . Take love from Bangladesh ❤❤❤❤.
Thanks
For no. 3,
If v[i] is present 2 or more times,mex.push_back(v[i]);
Else if v[i] is present 1 time ,take the min of them.
After that insert it into mex vector and sort it and find from 0 to infinity that which element is not present in the mex array
Yes
Nice explanation for every contest sir 🙌🫶....(denominator 😂..✌️)
😂😂😂😂
Thanks 😂
@@AbhinavAwasthi sir am in one confusion that , am in 2nd yr 2nd sem , I started cp 1 month ago , can I go with it or to start web . Which is right time to start development as am in 2-2, please reply sir 🙂
@@Rlxn5Hii ! I m too in 4th semester. Have you completed DSA??
@@priyanshkumar17 yeah am following strivers sheet . completed upto BS
Thanks a lot for your approach on C :) !!
Welcome
Can anyone help me by sharing important properties of XOR that generally used in the problem solving. Like,x^x=0,x^0=0.But what else xor properties needed?
Check some articles of gfg and practice problems
Nice explanation !! Keep up the good work !!! Sir, maine D ka code likha toh TLE aagya !!!..Please uska solution bhi dedo
if u are using hashing based approach, try to hash them with two prime numbers and store result as a pair.By doing this , it will prevent hash collisions.
Thanks, sure I will try to upload it
@@thisismr900No, I was using brute force that's why got tle
@@priyanshkumar17 yes, brute gives tle definitely
Sir I am not able to solve Div2B problems on codeforces which rating problms should I focus on and practice so that I can solve Div2B consistently and are ther any specfic topics i should study?
Practice problems of rating 1100-1300
instead of removing the last number you inserted using pop back in problem B what you could have done is that first you should add the numbers which occur twice and then just normally add those who occur once, in that case this case of checking wont be required
but then there might be possiblity that in ans1 element of freq 2 is added and on ans2 only element with freq 1 is pushed so xor will not be equal a,=m i right?
Helpful
Thanks
Great editorials 🎉
Thanks
verey very heplful
Thanks a lot
NICE
Thanks
I Just wanted to ask this question that in 2nd question if we Apply sliding window is there a case in which we might not get the required answer
How will you apply sliding window, can you send code?
please explain D also
❤❤❤❤❤
❤️❤️
Same here sir
Phele 3 ke baad Mai bhi adhe ghante phele utha gya
Ho hi nhi rha tha
Koi nhi, hota hai
Keep trying 🙌🏻
if array a has the same elements twice then array b has 0 times that of elements ten why k-=2 from array b. please explain this.. thank you
Array a has 0 times, but b has 2
the contest is rated or unrated
Rated
sir how can you do contest before time, your submission is on 18:02 but contest is started at 20:05
How bro 😅🙆🏻♂️, where you see this?
@@AbhinavAwasthi time stamp 11:39 last submission ke niche time me
@@dharamvirsingh6422 It's UTC time, not IST, check your also
@@AbhinavAwasthi thank very much sir 🙏😙
Simple crisp code for C : (no need of map/array other than freq. array)
int n;
cin>>n;
vector cnt(n+1);
for(int i=0; i>x;
cnt[x] += 1;
}
int mex = 0, ok = 0;
for(int i=0; i
Great code man 🙌🏻🚀
@@AbhinavAwasthi thanks sir
sir why in second question both array xor are equal
Because for repeating elements xor will become zero and remaining are same in both side
❤🧡🧡💛💛
Today's contest was way too difficult .whatever.
Can you tell in one sentence what is locking a solution
Yeah, locking means final submission of your question, you can't submit more, and if you locked a question, you can try hacking codes of others for that question
sir i couldn't solved the second and third
....
feeling sad
It happens sometimes, even today's contest was relatively tough
No need to be demotivated, keep trying, all the best 🙌🏻
I can do only 1 problem😢😢😢😢 evertime what must i do
us bruh
what is wrong with this solution?
void solve(){
int n;
cin>>n;
vector v(n),hash(n,0);
for(int i=0;i>v[i];
hash[v[i]]++;
}
int ans=0;
int k=2;
for(int i=0;i
Let's suppose, if there will be test case :
n= 1;
arr= [0];
Then for above test case your code will not going to print any thing, because you are running the for loop till
thank you so much @@pretestpassed157
Yes, well explained, thanks
Helpful
Thanks