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

Автор eatmore, 12 лет назад, По-русски

Ровно через неделю после раунда 2 — 1 февраля, в полночь по Москве — состоится третий раунд Facebook Hacker Cup 2015. Продолжительность раунда — 3 часа. 25 лучших участников выиграют поездку в Менло-Парк для участия в финальном раунде, который пройдёт в офисе Facebook 6 марта.

Участники смогут зайти в раунд по этой ссылке, а по этой ссылке всем желающим будет доступна таблица результатов.

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

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

Round 3 problem statements are available on the Hacker Cup page: https://www.facebook.com/hackercup/posts/907649815933874

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

Here are my inputs and answers.

UPD: they're wrong for 35 and 40 problems.

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

Problem 35 was clearly Dilworth's theorem. Isn't it too classical to be in qualification round?

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

Zonk. I find it pretty bizzarre that strong redcoders don't know Dilworth's theorem xd. Here you have beatiful problem where it can be applied (or rather, need to be :P) http://main.edu.pl/en/archive/oi/9/nar

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

    Since this comment is on top-level, I'm not 100% sure if this was meant to be a reply to my original question. It really looks like it is, so I'll go ahead and answer it, even though I don't consider myself a strong redcoder.

    So, you are finding pretty bizarre that there is a possibility that strong redcoder doesn't know that theorem. In fact, the theorem itself doesn't even matter. Let's consider the possible ways of how can one learn it:

    1. Was taught it in some kind of school/camp/etc.
    2. Read about it or tried solving a problem which required the knowledge of it.

    I believe that's pretty much is it in general terms. So let's consider what is required for these ways to occur.

    For the first way, not everyone have that privilege, which requires an infrastructure and coaches at schools and universities, willing to devote their valuable time on coaching. Please, do no take that for granted. Even if everything is in place, it's not guaranteed that you will learn it from this way.

    As for the second way, there are two scenarios around it. One is to invest a lot of time in training, which is usually expressed in solving problems from various online and onsite competitions on your own. I do not think it's bizarre that some people simply do not have enough free time to be willing to do this. For me personally, competitive programming is pretty much a hobby rather than the thing I seriously devote myself to ever since I changed university in late 2012. And I'm not alone at my University. It is ridiculously hard to organize anything regular here (I have tried, trust me, and still am), since no one has lots of free time available and pretty much everyone has his own schedule. And I'm not even talking about people having a full-time job — even less time is available there.

    Second scenario is to participate in competitions and encounter a problem on the topic there. Which, again, with the same reasoning of limited time available, I don't find that bizarre that for some, like me, this particular contest might have been the first time they've encountered a problem on this topic, since, again, not enough time to participate in every contest available.

    So, with this, the way I understand your statement is that you find bizarre that strong redcoders might not have the privilege to be coached or enough free time willing to invest in heavy training. Well, I don't. One likely needs to invest a lot of his time to become a strong redcoder, I'm not arguing with that. However one also likely needs to continuously invest even more time to continue learning new to them algorithms, data structures, approaches, types of tasks etc. And a vast majority of people after some point in life can't afford that anymore.

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

      Huh, that's a pretty exhaustive answer to my a bit stupid statement xD. I already saw problem like "You're given a grid with positive integers inside it, how many paths from lower-left to upper-right corner (going up and right) do you need in order to obtain an arrangement such that at least a[i][j] paths passes through cell (i, j)?" on ejudge and vast majority of teams got this problem accepted in a short period of time and that is a classical application of that theorem, so I assumed that among univeristy students it is widely known.

      Though I understand that not everybody is obliged to know all theorems on the world and that's of course understandable.

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

Наконец-то топ-25! :D Видимо, надо пару лет не тренироваться и всё будет норм.

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

My solution for problem 35: Gentrification:

ls = {0,1,2,...,components-1}
sol=1
do
	shuffle(ls)
	curSol=0
	// from left to right, if possible, mark the component and add it's size to curSol.
	sol=max(sol,curSol)
	// same from right to left
repeat for 8 seconds
  • »
    »
    12 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +8 Проголосовать: не нравится

    I did DP for <= 25 components. And random_shuffle for > 25.

    There were 5 tests > 25 (28, 161, 191, 500, 500) Half of the tests were with 1 component. (these are the components after you build the graph with edge u->v if there is a path from u to v.

    I suppose their tests are weak.

    A case that can beat the random: a -> b <- c (b = 3, a = 1, c = 1) you need to choose b.

    Have lots of these. Less likely you choose b over all of these.

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

In problem 40, are there precision issues with the naive solution (Gauss over each four vertices)?

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

    I haven't found any. I've tried double, long double and eps from 1e-8 to 1e-15 and all solutions gave same answers.

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

    I think so. Or at least their checker is wrong. I tested Gleb's accepted solution against mine on my testcase, and there were 41 differences, where each was 1e-6 differences of the two numbers in the output. So if his solution was correct I assumed mine would be also. But it failed.

    I also checked yours on my test case, and it gave exactly the same result as Gleb's. But yours failed as well. So I think there is something fishy with the way they tested this problem.

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

Now available in gym: 2015 Facebook Hacker Cup, Round 3. Used my test data and GlebsHP's solutions to generate answers.