LoneFox's blog

By LoneFox, history, 5 years ago, In English

The Qualification Round of the 2019 Facebook Hacker Cup is less than 48 hours away!

The round will begin on June 14th, 2019 at 10am PDT and will last for 72 hours (3 days). You can check the start time in your local timezone here.

The contest will be available here shortly before the round begins.

Everyone who solves at least one problem correctly will advance to Round 1, which will take place on June 29th. Please note that all submission judgments will only be revealed after the round ends. More details about rules and other information can be found here.

Registration will remain open until the end of the Qualification Round, so make sure to register if you haven't already, or confirm that your information is up to date if you have.

We wish you the best of luck, and hope that you enjoy the contest!

The corresponding Facebook post can be found here.

Update: The round has ended, and solutions have been posted here. Thanks for participating!

  • Vote: I like it
  • +151
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +147 Vote: I do not like it

Here we go again, that would be nice if you had sent an email regarding the start of registration/upcoming qualification beforehand.

Anyway thanks for posting this here, at least now I know there is something I shouldn't miss this weekend.

»
5 years ago, # |
  Vote: I like it +34 Vote: I do not like it

Is there a way to collapse the top bar of the Facebook interface that shows the search bar and notifications for friend requests, Messenger, and posts in your feed? It would be nice to not have social media alerts directly next to the contest environment.

GLHF!

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    I guess you could probably Adblock/Ublock it somehow. (I think there's some functionality to block webpage elements given their ID or class.) Of course, you'd have to unblock the bar after the round, so it's a pretty rough solution.

    AFAIK, there's never been any way to disable the notifications. And then imagine receiving a message from your friend that's like "um, you aren't doing well on the contest right now :(".

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    lol imagine waving to your friend while he's doing fhc

»
5 years ago, # |
  Vote: I like it +53 Vote: I do not like it

I deleted my facebook account last year and have been trying to make a new account so that I can participate for the past week. However, my efforts mostly seem to be wasted, I've tried different birthdays, different emails, different names (after failing with my default details). I keep getting a suspicious activity error, following which I give my Phone number and Photo (I've tried changing this too), however, I never heard back after this.

Is there a way I could participate without a Facebook Account?

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Everybody must have a Facebook account to participate. Unfortunately, we're unable to expedite your request to open one — sorry!

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +62 Vote: I do not like it

      following which I give my Phone number and Photo (I've tried changing this too), however, I never heard back after this

      This looks like something Facebook can and should help with.

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +24 Vote: I do not like it

        Facebook has standard processes around account creation, which I'm afraid we're unable to personally circumvent.

        • »
          »
          »
          »
          »
          5 years ago, # ^ |
            Vote: I like it +74 Vote: I do not like it

          Having your new account locked by FB is a standard process of account creation at FB? Good to know.

          • »
            »
            »
            »
            »
            »
            5 years ago, # ^ |
              Vote: I like it -14 Vote: I do not like it

            Hopefully you can believe that Facebook isn't trying to decrease its own user count for no particular reason.

            • »
              »
              »
              »
              »
              »
              »
              5 years ago, # ^ |
              Rev. 2   Vote: I like it +59 Vote: I do not like it

              >for no particular reason

              No, just the opposite. I believe FB wants only users that actively interact with the cashcow: marketing, or bring other users that will. Accounts created solely for the purpose of competing once a year, with no indication of engaging in regular social media activity (or even worse, with adblocks) don't fit there, so they're promptly autoblocked as "suspected bots".

              Getting people to give FB extra private info to sell is just a bonus.

              • »
                »
                »
                »
                »
                »
                »
                »
                5 years ago, # ^ |
                  Vote: I like it +46 Vote: I do not like it

                I have my Facebook account solely to participate in Hacker Cup. I don't use it to engage in any social media activity (no friends, posts, messages, likes, or even an avatar). And I use an ad blocker. But I'm still not banned. What am I doing wrong?

                By the way, I've heard that Petr creates a new account before each year's Hacker Cup, and deletes it afterwards.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  5 years ago, # ^ |
                    Vote: I like it +11 Vote: I do not like it

                  Haha, I obviously didn't mean "you will 100% be banned if", but that FB doesn't really need people like you who don't generate revenue, so there's a decent chance to end up b& and appeals will be met with "lol too bad". That doesn't mean there's a hunt for such accounts. There are plenty of false positives (and false negatives, it's possible to run a bot campaign if you know what to avoid).

                  I've experienced both — making new fake accounts to compete without trouble and getting new accounts blocked because... something. We also have multiple examples in this thread showing that it's a lottery even with accounts made for a legit purpose (competing).

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +27 Vote: I do not like it

    I've never had a Facebook account (I think), but it still asks me for this. No way they manage to get me an account before the first round starts.

    I didn't participate last year since I didn't want to create a Facebook account. It seems this year I cannot even if I want to :/

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it -16 Vote: I do not like it

      wow you're so cool

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +17 Vote: I do not like it

      why not create an account just to do FBHC, that's what I did. And all my friends are people who do CP so it wont be detected as a fake profile

  • »
    »
    5 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Here’s an idea:

    1. set up virtual machine and use facebook through there (copy paste files back and forth)
    2. get residential proxy to your friend’s house or similar (NOT VPN!)
    3. all connection from VM goes thru residential proxy so your real ip doesn’t get leaked

    Then fb can’t use things like evercookie, browser fingerprint, ip address etc. to identify you as a bot/previously identified as bot user. Don’t use vpn or you’re probably flagged instantly for bot/hacker-like behavior. Also you probably shouldn’t submit real name and photos if they already have you in their blacklist of “bots”. Facebook will most likely think you’re a new user and you’ll be good to go!

»
5 years ago, # |
  Vote: I like it +24 Vote: I do not like it

During the contest, are the subs judged on pretests, or just sample?

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    From the rules

    When will I know whether my answers were right?

    We will judge the submissions after the round has ended.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    The only live of evaluation of submissions is of their overall format — that is, if your submitted output file contains the wrong number of cases or if the required "Case #:" format itself isn't satisfied, you'll immediately receive a warning that it's formatted incorrectly.

»
5 years ago, # |
  Vote: I like it +17 Vote: I do not like it

What will it happen if my code is correct but my output is not correct (because I had copy pasted the input into vim and then all spaces were ignored and i didn't realise that in 6 minutes) ?

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +106 Vote: I do not like it

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    I'm afraid that submission correctness is based on the submitted output file, so please be careful to upload the correct output file within the time limit!

    • »
      »
      »
      5 years ago, # ^ |
      Rev. 2   Vote: I like it +8 Vote: I do not like it

      Does this mean that you won't actually try and run the code file.

      I ask this because I also did a silly mistake, and submitted code with file I/O ( with ONLINE_JUDGE flag ) and some cerr statement, which usually work fine, atleast on Codeforces. I also read in rules, that it's ok to do file I/O. So, I just wanted to confirm with you. Thanks a lot.

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +9 Vote: I do not like it

        Yes, that's fine!

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        So is it fine if your code does I/O from the file as long as the Output file is correct? I too forgot to remove the file statements :(

        • »
          »
          »
          »
          »
          5 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Oh, read the reply after posting. Thanks for clearing the doubt.

»
5 years ago, # |
Rev. 2   Vote: I like it -8 Vote: I do not like it

Why does the first problem have 2 outputs (and are 2 outputs for all others)? I mean when I pressed "download input", I had 2 buttons for output. I tried to put in one code and in the other output and also in one sample output and in the other big output. But, although my output is formatted "Case #x: Y/N", I got "formatting error".

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    One is for your source code

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The first one or the second one? I tried actually only the first source code and the second output. But didn't help. The output I wrote like the following (the answers are random):

      Case #5: N
      Case #6: Y
      Case #7: N
      

      Might it be that they want windows' line endings?

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The first one is output, the second is code. When I submitted, they had labels saying what they are for.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    First button is for the output (i.e. a txt file), second button is for your source code (i.e. a cpp file)

»
5 years ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

Is there a polynomial solution for Trees as a Service? (I did a backtracking worked in 0.1)

»
5 years ago, # |
  Vote: I like it +27 Vote: I do not like it

My nightmare of Mr. X xD I had three two's in my output.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    That's because you change only variables. You can also change operators.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Oh wow

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      You can even change parentheses to variable or anything to anything.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you give an example of a case where the answer is two if we are allowed to change only the variable names?

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        My solution says ((x&x)|(x&x)) is one of them.

        • »
          »
          »
          »
          »
          5 years ago, # ^ |
            Vote: I like it +3 Vote: I do not like it

          So you change the '|' operator to '^' operator. Wonderful. I didn't notice this, I just took some examples and noticed that the answer is always 0 or 1 and I trusted my gut, and went ahead with this logic. Had I seen this example, I might have coded a dp solution with some 2s in it.

          Thank you very much.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by LoneFox (previous revision, new revision, compare).

»
5 years ago, # |
Rev. 2   Vote: I like it +13 Vote: I do not like it

Mr. X problem:

Am I only one who wrote dp solution, and only after seeing the output of code, get the answer only 1 or 0.

»
5 years ago, # |
  Vote: I like it +48 Vote: I do not like it
  • »
    »
    5 years ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    I got confused by your comment. You meant 2019 right?

»
5 years ago, # |
  Vote: I like it +10 Vote: I do not like it

In the last problem, the solution posted here mentions that

If any of its subtrees fail to be constructed due to future constraints, however, we should terminate rather than backtracking and considering more possible roots r, as any other choice of root would not yield a meaningfully different partition of subtrees which would avoid violating those same future constraints — the same combination of conflicting constraints present together in that invalid subtree would still end up being present together at some point in the construction process.

Can anyone clarify why this is correct? Thanks in advance.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    For example, you are trying to choose root $$$r$$$ from the set of vertices $$$A$$$ and suddenly found such set $$$B \subseteq A$$$ that you can't build correct tree for $$$B$$$. (Correct = all conditions with $$$x,y,z \in B$$$ are true). Condition from set of vertices $$$V$$$ is such $$$(x,y,z)$$$ that $$$x,y,z\in V$$$.

    So, you want to prove that you can't build correct tree $$$T_A$$$ for $$$A$$$. Imagine you can. Consider $$$T_B'$$$ as the smallest subtree in a rooted tree $$$T_A$$$ which contains all vertices from $$$B$$$. First of all, root of $$$T_B'$$$ is one of $$$B$$$ vertices: imagine it is wrong. So, when we were building tree with root $$$root(T_B')$$$, we somehow split $$$B$$$ into two (or more) disjoint sets of vertices such that there is no condition from $$$B$$$ that contains vertices from different subsets of $$$B$$$. It means that we can split $$$B$$$ into same subsets right now, but we didn't do it. This contradiction means that $$$root(T_B') \in B$$$.

    Now let's build tree $$$T_B$$$: $$$root(T_B):=root(T_B')$$$ and for every $$$v \in B$$$, except $$$root(T_B')$$$, find it's first parent in $$$T_B'$$$ which is a vertex from $$$B$$$ (let it be $$$p_v$$$). It always exists (it is root($$$T_B'$$$) in the worst case). And now just say that $$$v$$$'s parent in $$$T_B$$$ is $$$p_v$$$. We only have to prove that if all conditions from $$$B$$$ were true in $$$T_B'$$$ then they remain true in $$$T_B$$$. But if $$$lca(x,y)=z$$$ in $$$T_B'$$$ for $$$x,y,z \in B$$$ then this is still true in $$$T_B$$$. We build $$$T_B$$$ but we couldn't do it. Again, it is contradiction and now it means that $$$T_A$$$ doesn't exist.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thank You for providing this formal argument! It makes things quite clear.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    For anyone interested, here's a solution based on the editorial: https://ideone.com/wc0Spl

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

hey, I score 15pts after the end of Qualification round but now in the scoreboard it will reflect 0pts any reason for this...are they check the source code for other test cases....Please Help!!

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Apologies for the issue, you have advanced to Round 1 and this will be reflected in the scoreboard shortly. For users who submitted exactly the same source code to multiple problems (as you did for Leapfrog Ch. 1 and 2), we intended to only send a warning that this indicates that you didn't provide your actual source code for one of those problems. However, we had inadvertently disqualified some of these submissions in the scoreboard, and are in the process of reversing that.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      So you are not do compile/run on codes but you do some crazy checks? Why?

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        We perform a number of best-effort checks to help reduce cheating — we recognize that they're not thorough, as is the case in any online contest, but have found them to be helpful regardless.