A. Nastia and nearly Good Numbers | Codeforces Round

  Рет қаралды 3,947

code Explainer

code Explainer

Күн бұрын

Пікірлер: 47
@maharajak6578
@maharajak6578 3 жыл бұрын
i was thinking of odd even property, gone in a very different track.. thanks also the problem statement was not very clear
@swayamsidhant2318
@swayamsidhant2318 3 жыл бұрын
Yeah got 7-8 WA and ended up getting just 150 points in this question😂😂
@codeExplainer
@codeExplainer 3 жыл бұрын
hahahah , true
@nayanmathur6064
@nayanmathur6064 3 жыл бұрын
The problem statement is absolutely correct. If it is written, the number is divisible by A then its your mistake to deduce that it is only divisible by A not B. Also, I watch streaming of LGM's on youtube, so I have a doubt why do you explain only A and B problems? Please also try to explain all the problems from a normal Div2 and Div3 rounds so that it could make sense from next time.
@praveshvajpayee3133
@praveshvajpayee3133 3 жыл бұрын
I agree he should first solve and then explain D AND E
@my_religion
@my_religion 3 жыл бұрын
Thanks alot!
@codeExplainer
@codeExplainer 3 жыл бұрын
You're welcome!
@atharvakulkarni2024
@atharvakulkarni2024 3 жыл бұрын
very true problem statement was wrong thats y i couldnt solve..Thanks for the video..:)
@sanskarkumar7984
@sanskarkumar7984 3 жыл бұрын
No bro it wasn't.
@codeExplainer
@codeExplainer 3 жыл бұрын
Glad it helped
@manimanidev738
@manimanidev738 3 жыл бұрын
If nearly good number divisible by both a&b then it is also divisible by a*b that is good.
@codeExplainer
@codeExplainer 3 жыл бұрын
no , if u read the problem statement , let a = 4 and b=6 , so 24 is good because it is multiple of a*b, but 12 is nearly good as it is divisible by a , and also b, but it is not divisible by a*b.
@sanskarkumar7984
@sanskarkumar7984 3 жыл бұрын
I got an AC before the problem statement was changed. Idk it was a fluke or my skills. 😅😅😅
@codeExplainer
@codeExplainer 3 жыл бұрын
ohhh nice ..
@questionpaper4272
@questionpaper4272 3 жыл бұрын
Bro, what do the column hack means with respect to this contest!?
@codenchill732
@codenchill732 3 жыл бұрын
how we can put x=1 , y=1 why?
@questionpaper4272
@questionpaper4272 3 жыл бұрын
Bro, we are not putting, like for example if x and y takes any other value, the number is surely going to be different and it can't take zero as the whole thing becomes zero. So, we take a special case of equal number to check the condition and choosing 1 makes calculation more easier!!?? Hope I have answered your question! If anything wrong do let me know
@pawanagrawal7653
@pawanagrawal7653 3 жыл бұрын
Their are no test cases on which the ans is no..??
@shitalkallole3056
@shitalkallole3056 3 жыл бұрын
A=any number, B=1 -> answer will always be "NO" because each number is divisible by (a*b) so each number is good .
@pawanagrawal7653
@pawanagrawal7653 3 жыл бұрын
@@shitalkallole3056 yhh..😀
@ImamulHasan717
@ImamulHasan717 3 жыл бұрын
why you use the extra function in the beginning of the code?
@codeExplainer
@codeExplainer 3 жыл бұрын
the extra function , are there for some modular arithmetic problems , they are of no use , just part of my template.
@rishabh2055
@rishabh2055 3 жыл бұрын
What should be the answer for A = 4, B = 2?
@Newbie0341
@Newbie0341 3 жыл бұрын
4 8 12
@rishabhmehrotra3887
@rishabhmehrotra3887 3 жыл бұрын
12 is not divisible by 8 (4*2), I guess this will not work
@sahilkommu1619
@sahilkommu1619 3 жыл бұрын
@@rishabhmehrotra3887 it will work becaus we only need one good number which is 8 and 4,12 are nearly good.
@ayushkishoremishra8141
@ayushkishoremishra8141 3 жыл бұрын
what should be the ans of A=95 and B=1 why it cant be 95 190 285
@vivekgoswami4262
@vivekgoswami4262 2 жыл бұрын
Same doubt if you understood please explain me too
@ganeshchowdhary3024
@ganeshchowdhary3024 2 жыл бұрын
It is because the problem statement says that "exactly one is good and other two are nearly good". So here 190, 95 and 285 are good which is a contradiction to the problem statement. Read the problem statement carefully to find the edge cases to be handled.
@anonymoussheriff1157
@anonymoussheriff1157 2 жыл бұрын
Got struck in the same test case lmao!
@owaiskorejo
@owaiskorejo Жыл бұрын
@@ganeshchowdhary3024 thanks man
@aadhikeaswar6974
@aadhikeaswar6974 3 жыл бұрын
if a%b==0 then we can not get nearly good numbers at all how does this solution work then?
@codeExplainer
@codeExplainer 3 жыл бұрын
i was also thinking that during the contest , but see the example , we can get nearly good number also , if a=4 and b=2 , then 8 is a nearly good number , as it is divisible by a , and that is the only condition.
@aadhikeaswar6974
@aadhikeaswar6974 3 жыл бұрын
@@codeExplainer thanks great video I found it very helpful!
@pushpaksambhe7405
@pushpaksambhe7405 3 жыл бұрын
I got stucked due to *different*
@codeExplainer
@codeExplainer 3 жыл бұрын
hahha
@narayanbansal4036
@narayanbansal4036 3 жыл бұрын
Same problem faced
@codeExplainer
@codeExplainer 3 жыл бұрын
ya it was a major problem..
B. Nastia and a Good Array | Codeforces Round #720 | CODEFORCES
11:08
code Explainer
Рет қаралды 3,3 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 27 МЛН
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 204 МЛН
Who's spending her birthday with Harley Quinn on halloween?#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 24 МЛН
A. K-divisible Sum | Educational Codeforces Round 103 | BITS PILANI
9:19
Winning Facebook (Meta) Hacker Cup Qual Round 2022?
53:55
Neal Wu
Рет қаралды 2,5 МЛН
B. Different Divisors | Codeforces Round #696 (Div. 2)
8:17
Hitesh Tripathi
Рет қаралды 4,6 М.
Google Coding Interview With A Competitive Programmer
54:17
Clément Mihailescu
Рет қаралды 2,5 МЛН
Codeforces Round 651 (Div 2) , Problem A. Maximum GCD
8:01
Aryan Mittal
Рет қаралды 3 М.
Codeforces Round #720 Div2 A  Nastia and nearly Good Numbers
6:06