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

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

Hello Codeforces Community,

I am glad to share HackerRank's University Codesprint 4 starting on 23rd February 2018. The contest duration is 48 hours.

The winners of the contest will win up to 1000USD cash prizes. The top 100 will also win awesome hoodies. (The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint.)

The contest will be rated. If two person gets the same score, the person who reached the score first will be ranked higher. There will be a separate ranklists for schools.

There will be 7 algorithmic challenges in this contest.

The problems were prepared by Alladdin, prateekg, niyaznigmatul, BishalG, anuj95, wanbo, svanidz1, kevinsogo, xennygrimmato, geek_geek, Wild_Hamster, shashank21j.

Good luck and Happy Coding!

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

»
6 лет назад, # |
  Проголосовать: нравится +47 Проголосовать: не нравится

What happened to the prizes from World Codesprint 12

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

I think codesprints should be 5h only (unless there are approximate problems). 48h favours to people that have more free time, also since each university is like a team, there is more time for the spread of solutions among members of the same university (or even country, I know cases about this).

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

    There are universities from all over the world, 5h only is unfair to those whose contest starts at 12am.

    At least make it 1 day long.

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

      yes, the current start time is not appropriate. Maybe atcoder usual time is not too late or early for most time zones?

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

"The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint" I also read that on the site and thought that it is worth asking: if I'm currently enrolled in a high school (not a university), there is no way I could officially take part in the contest (and, thus, be considered for prizes as well), right?

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

    Yes. If you are not in university, you will not be eligible for prizes, but you can still participate.

»
6 лет назад, # |
  Проголосовать: нравится +84 Проголосовать: не нравится

Wtf is going on with these weird "you need to implement function X an function Y" in statements which makes an impression that this is an "interactive" problem and then showing standard input and output? That's a significant difference.

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

    It's because you're given template C++ (but not C++14) codes which handle I/O for you.

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

      I didn't see any functions in my templates. I checked them but there was only a standard hello world or something. And I think that requiring coding persistent tree instead of typical one for the profit of not handling I/O is a pretty bad tradeoff.

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

        Template code for language C++ for the first task:

        Imgur

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

          Funny, for me it was "hello world" everywhere. But either way, firstly describing these functions and then describing input and output was confusing. I was already wondering where can I copy some persistent tree from in E because I thought this is whole point of existence of these functions.

»
6 лет назад, # |
  Проголосовать: нравится +47 Проголосовать: не нравится

There's something wrong with G's checker.You don't check whether the sum of columns and rows the participant's program chooses equals to the answer the participant's program gives. I can work out the answer and simply choose all the rows and columns to get it accepted.

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

"The winners will be required to give proof that they are currently enrolled in the university they represented during University CodeSprint."

If not all of the participants in top 100 are currently enrolled in university than will hoodies get passed to participants whose rank is above 100?

  • »
    »
    6 лет назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    Can someone confirm this? :P My rank on the student leaderboard is 102 and I found 2 people above me who are in one of the countries where prizes aren't allowed due to legal restrictions.

»
6 лет назад, # |
  Проголосовать: нравится +66 Проголосовать: не нравится

Ehm, I might sound a bit rude, but problem C aka Two Kings is absolutely disgusting. Was that supposed to be funny or sth?

»
6 лет назад, # |
  Проголосовать: нравится +40 Проголосовать: не нравится

Who else feels like crying after seeing a chess problem on HackerRank ?

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

It seems that the issues with G's checker haven't been fixed till now.Do you really want to leave the issue till the end of the contest? I'm sure some accepted submissions will fail after you fix the checker(my first submission as an example).

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

    lol what do you expect of hackerrank? there are bad checkers, lazy editorialists, and tedious problems.

    if they continue giving chess problems then HR will go bankrupt

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

In two king's problem i believe there is an issue with the checker. The sample output differs from the expected output, well i tried to submit either ways:first describing the positions of the black pieces and second i only printed the minimum no of black pieces and not the positions. Both the ways sample test case is showing wrong answer. Please help if anybody else was facing the same problem !

»
6 лет назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

Finishing 101 feels like an absolute win :D

My hate to chess kings has grown.

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

feedback:

A. Trivial

B. The c++ template that you provide (that reads input) doesn't work, it gives Abort Called.

C. Probably many people hated this problem. Also it was confusing that according to the checker the correct answer of the sample case is only 3 2 (without the positions of the queens). However I think it was not that bad (maybe I'm biased because I like chess :) ), but at least we have to guess/prove that knights are not necessary.

D. standard suffix array problem.

E. standard (and easier than D), actually is a simple variant of spoj DQUERY

F. nice data structure problem. Few people solved it during the first day, so I think it was ok.

G. another standard problem (and easier than F), I've seen it in codechef, some icpc regional and I think that even on hackerrank!

Regarding scoring: Partial score is unfair, shitty optimizations get some additional points. It should be full points for full subtasks.

TL;DR In general, the round looks more like an educational round. IMHO so far, the best round on hackerrank was the first world code sprint, ...now the frequency of contests and quality is decreasing.

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

    Could you please elaborate on F? I managed to get the partial solution for F where n ≤ 4000, but couldn't move any further.

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

      Yes, please elaborate the approach for F (Magic Value) because the editorial is not available for that problem. The explanation in the editorial section is actually for the previous problem.

    • »
      »
      »
      6 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      I will try to explain my idea.The main intuition behind my idea was convex hulls or may be convex hull trick (I appreciate if someone can give some direct solution using either of them as blackbox). Skipping easier parts the key problem is max (k-i)b[k].for each subarray starting at index k. sum over such things.
      lets denote val[i]=(i-k)*b[i].
      So some key observations:
      1. if k1 < k2 and val[k1] >val[k2] then there is no point in considering k2 in further queries.
      2. And also above property is transitive.

      So now we maintain data regarding cross overs of adjacent essential points and update them according based on the data. And to be noted is each update must remove one element from keynote list.

      To the updates part a seg tree will work with range overwrite operation.

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

    Did Mo's algorithm pass for E? I had to go offline.

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

    D can also be solved using rolling overflow hashing.

»
6 лет назад, # |
  Проголосовать: нравится +47 Проголосовать: не нравится

Wow, the tasks were so poor I can't even... Only F was kinda interesting, but seriously, does anyone think that E could be original? I've seen that so many times. G was a failure as well, so standard I couldn't believe my eyes when I read that this is supposedly the hardest problem. Ugly C as well. But won 500$, so at least I earned something for the cost of wasted time :p.

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

    Can you give me insight on how to construct the bipartite graph in G(I don't really understand from their editorial) or another editorial that explains a similar problem ? Thanks !

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

      Let the set of vertices on the left represent row, and the set of vertices on the right represent column. If there is a cell (x, y) that is painted, connect x on the left with y on the right. What we need to find now is the minimum vertex cover of the constructed bipartile graph above.

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +11 Проголосовать: не нравится

    For me both tasks were new, I know there is another similar on Internet , but still they were pretty easy. When I read 5th task, first I wrote Fenwick tree and then start solving task :D

    P.S. Will someone regrade last task ?

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

How to solve Unique Art?

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

Shall we still expect to receive hoodies?

»
6 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Have anyone received the hoodie yet?

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +57 Проголосовать: не нравится

I got 3rd rank, and I waited some message happily and excitedly (^_^).... and 3 months have passed (;_;). Can I get prize? (EDIT : This is my foolish mistake. Please ignore me.)

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

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

    That's interesting. I got second place and was contacted pretty quickly by a really responsive woman. Maybe that's the country that somehow makes the difference? Dunno.

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

      I recheck the my mailbox and found mail. I'm terribly sorry for hackerrank .... thanks swistakk

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

        I have got 65th place and still did not any e-mail or any answer about the champion hoodie. Can I get the hoodie? :)

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

I just want to ask: does contestant with rank in top 100 in student scoreboard (but rank > 100 in overall scoreboard) win a T-shirt? I was in top 100, but got no new regarding my hoodie.

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

My rank is 85 in the student leaderboard and 102 overall. Can I expect to get a hoodie? I have not received any email yet.

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

I want to say that I received my hoodie today! Thanks for it!