Блог пользователя MaRos

Автор MaRos, история, 10 лет назад, По-английски

The first online round of the 2017 Facebook Hacker Cup. Open to all. All participatns who answer at least one problem correctly will advance to Round 1. The contest will be going 72 hours, from January 6, 2017 4pm PST till January 9, 2017 4pm PST.

Good luck and have fun in first great competition on 2017!)

To register, visit https://www.facebook.com/hackercup/register.

More information on https://www.facebook.com/hackercup/.

UPD Registration page was updated.

UPD2 Link to the contest: https://www.facebook.com/hackercup/round/1760504744276109/

UPD3 The contest finished, results is here. Congratulations for qualified to the Round 1.

  • Проголосовать: нравится
  • +63
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +28 Проголосовать: не нравится

"Good luck and have fun in first great competition on 2017!)" — let me disagree. First great contest will be Snarknews New Year Prime Contest (I hope it will be held as usual) :p.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

What the hell... It's been almost a week and the registration page still says it's for the 2016 cup.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

This is the first time I hear of facebook hacker cup...

What are the problems like...Is there anywhere that I can see the problem set of an older year ?

:)

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Just for remind.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why not it's being started yet ?

Please help us providing a link when you get :)

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Where is the link to the Facebook Hacker Cup 2017 contest page ?

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +42 Проголосовать: не нравится

Bump. Contest has started.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Are outputs of the form "0.4553223e-08" in the third problem acceptable?

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

The reader and writer don't matter, right? I just uploaded an output file(made with fstream) and after that I switched the reader and writer to iostream, and I uploaded the code. Is it correct? The output file had a random name.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What's the need of source code when we submit the output?

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

There is a "Download Input" button, clicking on which you'll get a file of the input .We have to generate output and submit it along with our code in 6 minutes. If you fail to do this in 6 minutes than you won't be able to submit the code for the problem. So click on "Download Input " only when you are ready.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится -36 Проголосовать: не нравится
Spoiler
»
10 лет назад, скрыть # |
 
Проголосовать: нравится -63 Проголосовать: не нравится

On the "Progress Pie" problem, is the given point considered black if it lies on the circumference of the pie?

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +53 Проголосовать: не нравится

After submitting, I can theoretically download my output and source to check that everything went as planned. The output can be downloaded alright. However, when I try downloading the source, it gives me a page with the following message:

Sorry, something went wrong.
We're working on getting this fixed as soon as we can.

Now I wonder whether the system actually stored my source.

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +50 Проголосовать: не нравится

    I experienced the same thing and asked clarification.

    Answer: "We apologize for the inconvenience, we're working on fixing the issue with downloading source code files. Your source code has been successfully submitted."

    So, most probably your source is stored as well.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When and where can we get to know the result of Qualification round and check if our program passed on the system test?

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +51 Проголосовать: не нравится

to wjomlex and other Facebookers

There were several improvements that were suggested last year such as

Could you share any news on this features (e.g what is done, what is planned and what is not planned) or any other FBHC updates?

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Ad statements for non-competitors: I saw the statements without being registered, if that's what you mean (seeing them without being logged in is probably a feature of FB). Dunno if it will be different in other rounds.

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +62 Проголосовать: не нравится

    Mobile version: You can view the page on mobile, but it's definitely not optimized for mobile. This is a low priority since you basically need to be using a desktop/laptop to be competitive.

    Test distribution: Every problem has a set of tests that you're guaranteed to get, and this includes ones that test edge cases.

    Samples: The samples are always included in your input file, though not as the first K cases. So we don't really have that sort of pre-testing. However, the logic for presentation errors has been made more lenient, and you get a warning if you try to upload something that has the wrong number of lines, or bad "Case #x:" formatting. I talked about this last year: http://codeforces.me/blog/entry/15981?#comment-274649

    Giving encrypted files: We've been trying to avoid this problem by simply not having problems that have large input or output (our goal is to constrain both to about 3MB, and generally smaller than that). At onsite finals we relax this restriction since we can guarantee that everybody is on the same quality connection.

    Downloading output: You can do this now.

    Past rounds page: You can find it here: https://www.intern.facebook.com/hackercup/past_rounds/1760504744276109/

    Statements for non-competitors: The problems are now viewable by anybody, even if they're not logged into Facebook.

    We made the scoreboard show immediately upon round completion this year, since our previous approach required about a 10-minute delay.

    Also, we'll be rolling out a new clarification system, ideally for the next round, which'll make it easier for us to respond to clarifications, and let you view your clarifications in the Hacker Cup UI rather than having to go to your email.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

From the Progress Pie statement: "Envision your screen as a square on the plane with its bottom-left corner at (0, 0), and its upper-right corner at (100, 100)." Does it mean that the circle diameter is 100 or 101? Surely there are 101 pixels between 0 and 100 :) In the editorial solution the center of the circle is (50;50) with the radius=50. Why not (50,5;50,5) and radius=50,5?

ProgressPieCenter

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +23 Проголосовать: не нравится

    Don't think about pixels. I was confused by this at first too, but in fact the problem statement does not mention pixels at all. Simply think of the points on the plane (0,0) and (100,100).

    • »
      »
      »
      10 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Since the problem statement started with the description of progress bars and then mentioned the screen and "Every point on the screen is either white or black." I somehow assumed we are not talking about points on the geometry 2D plane, but about the actual screen with the points being the alias for pixels.

      In the context of "a screen" I would be more inclined to read the expression (100, 100) as a pixel coordinate (ie. integer) than a real numbers coordinate.

      Anyway, I have read the problem statement once more and when I forget about the screen metaphor (ie. completely ignore visualizing the progress bar, "There are no pixels." etc.), then your explanation makes perfect sense. Thanks.

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +29 Проголосовать: не нравится

    The top right point in your pic is (5, 5), not (4, 4).

    • »
      »
      »
      10 лет назад, скрыть # ^ |
      ← Rev. 2  
      Проголосовать: нравится 0 Проголосовать: не нравится

      It really depends on whether you're talking 2D plane geometry or pixels on the screen, on which the progressbar is drawn.

      "While you wait for the progress pie to fill in, you find yourself thinking about whether certain points would be white or black at different amounts of progress."

      I mean, while you are waiting are you thinking about the abstract 2D plane or about the pixels you are looking at? It probably depends on whether you're a math geek or a computer geek:)

      My mistake was focusing too much on the "screen" part of the story and not enough on the "abstract 2D plane" part.

      • »
        »
        »
        »
        10 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +10 Проголосовать: не нравится

        I fully agree: the statement had poor legend which could misdirect some participants (as it did with me). Strictly speaking, the "abstract 2d plane" interpretation is the only one that makes sense if we think that jury has provided all necessary details, but you never can be sure.

        1. If we talk about "screen" and "pixels screen", then it's natural to assume that all pixels are discrete, as they are in real screens. So, I did exactly that and assumed that we have a square grid.
        2. Next question: are the coordinates given of grid points or grid cells? I believe that's the question raised by tafit3 in their first comment. As there were no mention, I've started suspecting something.
        3. Next question: if everything is discrete, we cannot draw a perfect pie. So, some rasterization should be performed. It also depends on the previous question: are we talking about grid points (this case is pretty much obvious) or grid cells (and we probably should apply Bresenham's algorithm)?
        4. Next question: if the world is discrete, what is the sense of talking about answer being same in 10 - 6-ball around the point asked? At this point I finally decided to mostly ignore the statement and solve the problem on continuous 2d plane. Ranging it as the simplest problem of the round helped me to conclude that the solution should be simple and definitely won't include any fuzz with rasterization.
»
10 лет назад, скрыть # |
 
Проголосовать: нравится +48 Проголосовать: не нравится

In the first problem (Progress Pie), corner cases would be 0 50 51 and 100 50 51. The point 50 51 is on the axis corresponding to 0% or 100% progress. For the first one, the entire board is still white. For the second one, the point and its surroundings are all black.

However, there were no cases with substring 0 50 at all in my input. Were they intentionally avoided by the jury? Or maybe I misinterpreted the problem somehow, and they are not in fact corner cases?

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    "Whenever a point (X, Y) is queried, it's guaranteed that all points within a distance of 10-6 of (X, Y) are the same color as (X, Y)."

    This is not true for the point (0, 50), thus it does not exist in the input.

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +31 Проголосовать: не нравится

    (50, 51) is a nice hacking case, however (50, 50) for p=0 and 100 are also nice hacking cases. All of them are absent in my input.

    • »
      »
      »
      10 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Yeah, the point 50 50 is basically the same deal as 50 51. It could have also appeared only at 0% and 100%, and the answers would be also white and black, respectively.

    • »
      »
      »
      10 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +25 Проголосовать: не нравится

      I was expecting to have those edge cases, but my input also doesn't have them.

    • »
      »
      »
      10 лет назад, скрыть # ^ |
       
      Проголосовать: нравится -33 Проголосовать: не нравится

      As Gassa says, those points can only appear with P = 0 or P = 100, so they're not actually very interesting, with the constraints as given.

      • »
        »
        »
        »
        10 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +10 Проголосовать: не нравится

        By far the most common error I saw was using raw atan2() output (0 degrees to the right, 90 degrees up) and not transforming it to match how the progress pie actually fills in (0 degrees up, 90 degrees to the right).

      • »
        »
        »
        »
        10 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +58 Проголосовать: не нравится

        Why aren't they interesting? They are valid and they should fail some solutions, right?

        Or maybe they aren't valid? I think that all input constraints are satisfied for p = 0, x = 50, y = 60 and my accepted program doesn't solve this input correctly.

      • »
        »
        »
        »
        10 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +25 Проголосовать: не нравится

        They are completely valid and I am sure they will cause some solutions to fail (my solutions works on them, but it is just a lucky coincidence, because they didn't come to my mind when I was coding it). They are so called corner cases and even if it is simple to deal with them one has to be aware of their existence and handle them with appropriate care. And it is organizers duty to do their best in order to accept only those solutions which give correct answers on all valid data. Working on real software should teach one that corner cases and error handling are crucial part of creating good software.

      • »
        »
        »
        »
        10 лет назад, скрыть # ^ |
         
        Проголосовать: нравится -34 Проголосовать: не нравится

        Yeah, those cases are valid, I just didn't consider them to be as particularly interesting as some of the other hardcoded corner cases, since the problem is pretty trivial when P = 0 or 100.

        As I read the clarifications for this round though, it became clear that a lot of people were missing the line where I state explicitly that all the points are white when P = 0, so I could have been more thorough about stress testing people on it.

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

What mistake I have with my code (Second Problem)? Problem with file?

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +39 Проголосовать: не нравится

In problem C, a simple way in C++ to read the input (with optional Z) was

  int H, S, X, Y, Z;
  char dummy;
  string spell;
  cin >> H >> S;
  while (S--) {
    cin >> spell;
    stringstream ss(spell + "+0");
    ss >> X >> dummy >> Y >> Z;

Adding "+0" or just " 0" makes sure that Z = 0 when it is absent in the input.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When the next round starts? I checked the official page but I didn't find anything about that.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When can we upsolve?

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Out of the 12804 participants, 1750 got the perfect (100) score.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone please tell me where I made a mistake in my code for first problem.

»
10 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -20 Проголосовать: не нравится

I downloaded progresspie.in from Dropbox (link is in the editorial). It contains T=2005 tests. While in the problem it is stated that T <= 1000. And the progress_pie.txt I got during quals contains 1000 tests.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How does everyone decide that their solution will work within six minutes. What is the bound on the number of calculations for this 10^6 or 10^7 or 10^8 .. ?

  • »
    »
    10 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +18 Проголосовать: не нравится

    Depends on your machine. A safe estimate would be 108 per second. And typically you only need a few seconds to solve the problem. The 6 minutes is just to make sure everyone has time to fiddle with files and uploading etc.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I passed Elemination Round. Now i want particpate 1 round. When I want log in to facebook,site asked ID from.Then i sended Photo of my Passport.Then this message comed.
We'll get in touch with you at the email address you provided after we've reviewed your ID. You will now be logged out of Facebook.
What can i do,to participate this round quick as possible?