### LoneFox's blog

By LoneFox, history, 4 months ago, ,

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!

• +151

 » 4 months ago, # |   +147 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.
 » 4 months ago, # |   +34 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!
•  » » 4 months ago, # ^ |   +20 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 :(".
•  » » » 4 months ago, # ^ | ← Rev. 3 →   +52 Me IRL
•  » » 4 months ago, # ^ |   +15 lol imagine waving to your friend while he's doing fhc
 » 4 months ago, # |   +53 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?
•  » » 4 months ago, # ^ |   +1 Everybody must have a Facebook account to participate. Unfortunately, we're unable to expedite your request to open one — sorry!
•  » » » 4 months ago, # ^ |   +62 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.
•  » » » » 4 months ago, # ^ |   +24 Facebook has standard processes around account creation, which I'm afraid we're unable to personally circumvent.
•  » » » » » 4 months ago, # ^ |   +74 Having your new account locked by FB is a standard process of account creation at FB? Good to know.
•  » » » » » » 4 months ago, # ^ |   -14 Hopefully you can believe that Facebook isn't trying to decrease its own user count for no particular reason.
•  » » » » » » » 4 months ago, # ^ | ← Rev. 2 →   +59 >for no particular reasonNo, 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.
•  » » » » » » » » 4 months ago, # ^ |   +46 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.
•  » » » » » » » » » 4 months ago, # ^ |   +11 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).
•  » » 4 months ago, # ^ |   +27 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 :/
•  » » » 4 months ago, # ^ |   -16 wow you're so cool
•  » » » 4 months ago, # ^ |   +17 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
•  » » 4 months ago, # ^ | ← Rev. 2 →   0 Here’s an idea: set up virtual machine and use facebook through there (copy paste files back and forth) get residential proxy to your friend’s house or similar (NOT VPN!) 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!
 » 4 months ago, # |   +24 During the contest, are the subs judged on pretests, or just sample?
•  » » 4 months ago, # ^ |   +8 From the rulesWhen will I know whether my answers were right?We will judge the submissions after the round has ended.
•  » » » 4 months ago, # ^ |   +25 Wait wow not even sample... XD
•  » » » » 4 months ago, # ^ |   +5 There are samples, but no pretests.
•  » » 4 months ago, # ^ |   +5 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.
 » 4 months ago, # |   +17 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) ?
•  » » 4 months ago, # ^ |   +106
•  » » 4 months ago, # ^ |   +9 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!
•  » » » 4 months ago, # ^ | ← Rev. 2 →   +8 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.
•  » » » » 4 months ago, # ^ |   +9 Yes, that's fine!
•  » » » » 4 months ago, # ^ |   0 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 :(
•  » » » » » 4 months ago, # ^ |   0 Oh, read the reply after posting. Thanks for clearing the doubt.
 » 4 months ago, # |   0 I forgot to remove the file I/O statements will I be able to submit again, coz it's such a silly mistake everything else is correct.
•  » » 4 months ago, # ^ |   0 It got clarified : We don't run your code. Your solution is judged correct or incorrect based on the output file you've uploaded. Thanks, The Facebook Hacker Cup Team
 » 4 months ago, # | ← Rev. 2 →   -8 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".
•  » » 4 months ago, # ^ |   0 One is for your source code
•  » » » 4 months ago, # ^ |   0 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?
•  » » » » 4 months ago, # ^ |   0 The first one is output, the second is code. When I submitted, they had labels saying what they are for.
•  » » 4 months ago, # ^ |   +8 First button is for the output (i.e. a txt file), second button is for your source code (i.e. a cpp file)
 » 4 months ago, # | ← Rev. 2 →   +10 Is there a polynomial solution for Trees as a Service? (I did a backtracking worked in 0.1)
•  » » 4 months ago, # ^ |   0
•  » » 4 months ago, # ^ |   0 did this round have time limits ? they only check output and not source code.
•  » » » 4 months ago, # ^ |   0 You have a 6 minute time limit after you download the input. So you can't run it for more than that.
•  » » » » 4 months ago, # ^ |   0 not that time limit, I meant constraints.There were no constraints, so you could have any time complexity as long as you got the output right.
•  » » » » » 4 months ago, # ^ |   0 Right, but if your code has terrible complexity, you won't be able to get the output in six minutes.
•  » » » » » » 4 months ago, # ^ |   0 true, but I can imagine some guy who has terrible time complexity and his PC is running it like its trying to crack the Enigma code.
 » 4 months ago, # |   +27 My nightmare of Mr. X xD I had three two's in my output.
•  » » 4 months ago, # ^ |   +8 That's because you change only variables. You can also change operators.
•  » » » 4 months ago, # ^ |   0 Oh wow
•  » » » 4 months ago, # ^ |   0 You can even change parentheses to variable or anything to anything.
•  » » » 4 months ago, # ^ |   0 Can you give an example of a case where the answer is two if we are allowed to change only the variable names?
•  » » » » 4 months ago, # ^ |   +4 My solution says ((x&x)|(x&x)) is one of them.
•  » » » » » 4 months ago, # ^ |   +3 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.
 » 4 months ago, # |   0 Auto comment: topic has been updated by LoneFox (previous revision, new revision, compare).
 » 4 months ago, # | ← Rev. 2 →   +13 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.
•  » » 4 months ago, # ^ |   +4 I wrote dp solution, ran my code, saw three '2' answers, understood my mistake and submitted min(ans, 1)
•  » » 4 months ago, # ^ |   0 You're not alone.
 » 4 months ago, # |   +48
•  » » 4 months ago, # ^ |   +14 I got confused by your comment. You meant 2019 right?
 » 4 months ago, # |   +10 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.
•  » » 4 months ago, # ^ |   +14 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.
•  » » » 4 months ago, # ^ |   0 Thank You for providing this formal argument! It makes things quite clear.
•  » » 4 months ago, # ^ |   +5 For anyone interested, here's a solution based on the editorial: https://ideone.com/wc0Spl
 » 4 months ago, # |   0 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!!
•  » » 4 months ago, # ^ |   0 Note: I got the green tick after the contest on 1st one.....
•  » » 4 months ago, # ^ |   +10 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.
•  » » » 4 months ago, # ^ |   0 ok...I actually submit the same code in Ch 2 by mistake ....I have the correct solution It was just my stupidity
•  » » » 4 months ago, # ^ |   +11 So you are not do compile/run on codes but you do some crazy checks? Why?
•  » » » » 4 months ago, # ^ |   0 I do everything but when submitting the solution for 2nd one I mistakely upload the wrong file which belong to the 1st one....And when I realize the 6min timer shuts
•  » » » » 4 months ago, # ^ |   +10 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.