2554/01/22

Facebook hacker cup : Round 1a had been finished

After I scan all 3 problems. I choose problem 1 : "Wine tasting" because this problem statement is shortest LOL. Anyway the problem is quite confuse for me. So I spent a long time to understand. certainly I 'm not in time to solve this problem but I still submit code and output and pray LOL.

May I need to read  this book to prepare a problem like this before second sub round. :)

I demonstrate my understand for this problem like this

For example 4,2
Given 4 glasses of wine (G) A, B, C, and D
and given C a number of minimum number( of right guess( fb not provide me :(  )) to win
so the way to win is like this

                           A B C D
                           A B D C
                           A D C B
                           A C B D
                           D B C A
                           C B A D
                           B A C D

There are 7 ways to win

Why 7 ?  7 = C (4,2) + C(4,4)
                =   6 + 1

Where is C(4,3)  ?    if you guess right for 3 there 's no way to miss last choice (problem state that "They will always guess a different type of wine for each glass") so C(4,3) is like C(4,4)

But for example 13, 10 and 14, 1. I still don't know how to solve this. May anyone suggest me :)

7 ความคิดเห็น:

  1. For 13, 10 :
    C(13,10)*(number or cases he can guess the other 3 wine bottles wrong) + C(13,11) + C(13, 13)

    Here ma ruby code:
    def answer(m, n)
    ans = 1
    (n.to_i..m.to_i).each do |y|
    ans = ans + binomial_coef(m.to_i, y) * (factorial(m.to_i - y) - answer(m.to_i - y, 1)) if m.to_i - y - 1 > 0
    end
    ans
    end

    I didn't pass the round though. The ruby code didn't get me the result within the 6 mins.

    ตอบลบ
  2. @Anoop.J.S May you store your Factorial value in memory for 1..100 first you can get this precalculate value faster than realtime compute

    May this help you improve your time :)

    ตอบลบ
  3. Hello. Are you in need of a Hacker .I recommend (Worldcyberhackers@gmail.com) via Email. I have used them and they are the best. They render services such as:

    -Facebook hack
    -Gmail hack
    -Twitter hack
    -WhatsApp hack
    -Mobile phone hack
    -Database Hack
    -Retrival of lost files
    -Viber hack
    -Untraceable IP
    -University grades changing
    -Bank account hack
    -Bypassing of Icloud
    -Verified Paypal account.

    They are reliable, contact them via Email(WORLDCYBERHACKERS@GMAIL.COM)

    ตอบลบ
  4. My husband was so smooth at hiding his infidelity and I had no proof for months, I saw a recommendation about a Private investigator and decided to give him a try.. the result was incredible because all my cheating husbands text messages, whatsapp, facebook and his iphone conversations was sent directly to my Personal computer. Mr James helped me put a round-the-clock monitoring on him and I got concrete evidence and gave it to my lawyer..I say no to infidelity if your husband is an expert at hiding his cheating adventures contact him through Gmail he will help you(Worldcyberhackers) or WhatsApp : +12678773020

    ตอบลบ
  5. ARE YOU WILLING TO HIRE THE REAL HACKERS TO GET YOUR CYBER PROBLEMS FIXED WITH SWIFT RESPONSE?
    AND ARE YOU A VICTIM OF THE BINARY OPTION SCAM?
    Solving a problem for which you know there’s an answer is like climbing a mountain with a guide, along a trail someone else has laid.
    This post is actually for those who are willing to turn their lives around for the better, either financial-wise or relationship-wise or businesses.
    Our primary reason for this development is to ensure that those in need of help don’t get ripped off by forgeries.
    This is a global idea that navigates a newbie to a prominent encounter ( Fully immersed to a degree that the subject in question Is a disorienting worthwhile experience on merits).
    Who are the GlobalHackers?
    We are group of skilled professional hackers driven by passion to make the internet a safer place and render proficient services to those having cyber problems.
    Globalhackers has grown and expanded since it formation over the years due to the experience and professionalism of our management and technical staff. Our strength is based on our ability to bring together active cyber security professionals who individually has acquired enormous exposure in the world of HACKING
    As part of our corporate goals, providing value added services to meet our client needs and requirements has been our sustaining impetus.
    The new development on the Globalhackers platform is to assign to you the right HACKER to deal with your Particular kind of cyber issues depending on the kind of cyber problems you are willing to get fixed.
    Here, you would be refer to a legit professional hacker known for massive skills and security abilities.
    Skilled and trained on
    ▪Social media hacks (facebook, twitter, instagram,snapchat)
    ▪Email hacks
    ▪phone hacks
    ▪bitcoin hacks.
    ▪verified PayPal account hacks
    ▪database hacks
    ▪credit card top up
    ▪university score upgrade
    ▪money transfer
    ▪binary option funds recovery. ( recovered $4,372,063 million)
    The binary option scam is another problem facing the internet today.
    How do you avoid binary option scam and what do you do if you are a victim of the scam.
    Be wary of adverts on the internet and mostly on social media promising high returns from binary options trading. The binary option is one of the highly recorded scam on the internet.This are a form of fixed-odds betting.
    People investor their hard earned funds in the scammers website and at the end, they wouldn't be able to take their profit plus their investment too. The Globalhacks are breeding effort to put an end to these unbearable swindle scheme taking over the intenet and taking a solid step forward to render solution to those affected by the fleece… we have striven to make tenacious effort to relief those who were victims off their traumatic feeling of loss. ( We Are Here To Help Recover Your Stolen Funds).
    Here would be our cybersecurity techniques to retrieving back the victims stolen funds.
    ●The binary broker website would be traced down using a game over peer to peer network via a bug attack,
    The bug network secure an SQL trace on a hiding server, decentralizing it and redirecting the server to a soft plus network. A soft plus network enable varieties of unique web coding languages, Through that process reveals thier hidden networking source, displaying the changed web page made default.
    This unveil the hiding information traceable to track down the scammers and their embezzled central fund reserve system.
    HOW DO YOU STAY AWAY FROM FALSE BUSINESSES ONLINE?
    * Making enquiries for their firm reference number (FRN)
    * Contact details and barter their calls on the switchboard number and also
    * Never make use of the link in a website or an email from the firm propitiating you for an investment.
    For more enquiries and help, contact:
    Info.globalhacks (at) gmail. com
    globalhacktech (at) protonmail. com
    HackerOne©️LLC 2030.

    ตอบลบ
  6. need hackers for hire? need to keep an eye on your spouse by gaining access to their emails?, want to know what your kids do on social networks? Whatever it is, Ranging from Bank Jobs, Flipping cash,Taxes. We can get the job done.are you looking for help hacking into social media? change of grades?help with project management hacking,social media hacking- (onlineghosthacker247@gmail.com)

    ตอบลบ
  7. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time.

    Contact him and thank me later.

    ตอบลบ