Codeforces Round 834 Div 3 | Problem D : Make It Round Solution | Newton School

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

ความคิดเห็น • 26

  • @ugthesep5706
    @ugthesep5706 หลายเดือนก่อน

    maana padega bhaiya kya samajhte hai aak dum mast

  • @oshopandey4760
    @oshopandey4760 2 ปีที่แล้ว +1

    if explaining is a art then you are the artist great explaination

  • @KaranMashru
    @KaranMashru 2 ปีที่แล้ว +6

    (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

  • @judgebot7353
    @judgebot7353 ปีที่แล้ว

    awesome explanation!

  • @amancuber5235
    @amancuber5235 2 ปีที่แล้ว +2

    Problem E please!

  • @neelchatterjee.1368
    @neelchatterjee.1368 ปีที่แล้ว

    Sir can you explain the case of n = 25 and m = 10

  • @millionaires1
    @millionaires1 2 ปีที่แล้ว

    Wow i did till the k part, but i didn't do (m/k)*k, nice one

  • @ganeshlokhande6061
    @ganeshlokhande6061 2 ปีที่แล้ว

    Please make the video on Devu and Perfume 🥲

  • @chalijutt3478
    @chalijutt3478 2 ปีที่แล้ว +1

    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.

  • @samarthtrivedi8812
    @samarthtrivedi8812 2 ปีที่แล้ว +1

    Expected rating?

  • @swrserwerwr9137
    @swrserwerwr9137 2 ปีที่แล้ว

    really great tutorial sir but i am not able to understand just one thing that why did we remove 0 in the beginning

    • @codingcommunitynewtonschoo8582
      @codingcommunitynewtonschoo8582  2 ปีที่แล้ว +2

      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.

    • @swrserwerwr9137
      @swrserwerwr9137 2 ปีที่แล้ว

      @@codingcommunitynewtonschoo8582 got it sir thank you very much

    • @NBK_TDP_NTR
      @NBK_TDP_NTR 2 ปีที่แล้ว

      @@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"

  • @yashpatel8931
    @yashpatel8931 2 ปีที่แล้ว

    Hi sir codechef ka bhi solution dalo na plz sir

  • @mrboon8856
    @mrboon8856 2 ปีที่แล้ว

    Make soln of E

  • @nideeshn6293
    @nideeshn6293 2 ปีที่แล้ว

    Problem F ka explanation chahiye

  • @nikhilkumarv2577
    @nikhilkumarv2577 2 ปีที่แล้ว

    🛐

  • @Rajat_maurya
    @Rajat_maurya ปีที่แล้ว

    sir it is showing wrong answer when we take the trailing zeros? Help please

    • @codingcommunitynewtonschoo8582
      @codingcommunitynewtonschoo8582  ปีที่แล้ว

      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..

  • @NBK_TDP_NTR
    @NBK_TDP_NTR 2 ปีที่แล้ว

    why we are removing the tailing zeros? can someone please explain it clearly. i am from kerala. i merely understand hindi

    • @codingcommunitynewtonschoo8582
      @codingcommunitynewtonschoo8582  2 ปีที่แล้ว +1

      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.

    • @hikunal
      @hikunal 2 ปีที่แล้ว

      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

    • @Rajat_maurya
      @Rajat_maurya ปีที่แล้ว

      @@hikunal jhut bolte ho sharam ni aati