Hi Sir! really good tutorial, we are hoping for more gems like that. I have a request to make the tutorial on CodeChef starter 65, especially the last four problems.
Suppose n=10 and m=10, so if we donot remove 0 we will make pair of factor 5 in n with 2 and make pair of factor 2 in n with 5. So, k=2*k=10 and n*k=100. Instead if we donot consider 0 remaining n=1. Now we will multiply it with k=10. So answer = 10*10 =100. Both will be same only but if there are 0 in n initially they are already paired up 5*2, so we are not making new pair with help of factors from k.
@@codingcommunitynewtonschoo8582 couldnot get it sir! you said both will be same but the code with out the first step (removing tailing zeros) resulting in "wrong answer for 2nd test case"
Hi Rajat ! I dont remember the question. It's a bit old😅 No worries... You tell me a specific test case, and let me know what output it is showing and what should be the actual output. Then we will discuss further..
It will not make a difference. Suppose n=10, and you pair up factor 5 of n with factor 2 of k and factor 2 of n with factor 5 of k. So n*k=100. Else if you dont consider tailing 0, then n=1. Now there is no factor 5 or 2 in it. So you take k=10. In this case also n*k=100. (Remember 0 is ignored, it is not removed so answer will be 100). So just to simplify we removed tailing 0s. I hope you got the point.
We need not remove trailing zeroes, See my code where I have done it without removing trailing zeroes. #include #include #define ll long long int using namespace std; int main() { ll t; cin >> t; while (t--) { ll n, m; cin >> n >> m; ll ans = n; ll k = 1; // Compensating for the 2's in n while (n % 2 == 0) { if (k * 5
maana padega bhaiya kya samajhte hai aak dum mast
if explaining is a art then you are the artist great explaination
(Subscribe for more such videos)
Code :
#include
using namespace std;
#define ll long long
int main()
{
ll t, n, m, k, i, j, ans, mul;
cin>>t;
for(;t--;)
{
cin>>n>>m;
k=1;ans=n;
while((n%10)==0){
n/=10;
}
while((n%5)==0){
n=n/5;
if((k*2
awesome explanation!
Problem E please!
Sir can you explain the case of n = 25 and m = 10
Wow i did till the k part, but i didn't do (m/k)*k, nice one
Please make the video on Devu and Perfume 🥲
Hi Sir! really good tutorial, we are hoping for more gems like that. I have a request to make the tutorial on CodeChef starter 65, especially the last four problems.
Yes sir
Expected rating?
1500-1700
really great tutorial sir but i am not able to understand just one thing that why did we remove 0 in the beginning
Suppose n=10 and m=10, so if we donot remove 0 we will make pair of factor 5 in n with 2 and make pair of factor 2 in n with 5. So, k=2*k=10 and n*k=100. Instead if we donot consider 0 remaining n=1. Now we will multiply it with k=10. So answer = 10*10 =100. Both will be same only but if there are 0 in n initially they are already paired up 5*2, so we are not making new pair with help of factors from k.
@@codingcommunitynewtonschoo8582 got it sir thank you very much
@@codingcommunitynewtonschoo8582 couldnot get it sir! you said both will be same but the code with out the first step (removing tailing zeros) resulting in "wrong answer for 2nd test case"
Hi sir codechef ka bhi solution dalo na plz sir
Make soln of E
Problem F ka explanation chahiye
🛐
sir it is showing wrong answer when we take the trailing zeros? Help please
Hi Rajat ! I dont remember the question. It's a bit old😅 No worries...
You tell me a specific test case, and let me know what output it is showing and what should be the actual output. Then we will discuss further..
why we are removing the tailing zeros? can someone please explain it clearly. i am from kerala. i merely understand hindi
It will not make a difference. Suppose n=10, and you pair up factor 5 of n with factor 2 of k and factor 2 of n with factor 5 of k. So n*k=100. Else if you dont consider tailing 0, then n=1. Now there is no factor 5 or 2 in it. So you take k=10. In this case also n*k=100. (Remember 0 is ignored, it is not removed so answer will be 100). So just to simplify we removed tailing 0s. I hope you got the point.
We need not remove trailing zeroes, See my code where I have done it without removing trailing zeroes.
#include
#include
#define ll long long int
using namespace std;
int main()
{
ll t;
cin >> t;
while (t--)
{
ll n, m;
cin >> n >> m;
ll ans = n;
ll k = 1;
// Compensating for the 2's in n
while (n % 2 == 0)
{
if (k * 5
@@hikunal jhut bolte ho sharam ni aati