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

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

Throughout the year, Google Code Jam hosts online Kickstart rounds to give participants the opportunity to develop their coding skills, get acquainted with Code Jam’s competition arena, and get a glimpse into the programming skills needed for a technical career at Google.

Each Kickstart round gives participants 3 hours to solve challenging, algorithmic problems developed by Google engineers. Participating is a fun way to grow your coding skills—and potentially explore opportunities at Google.

Inviting you to solve some fun and interesting problems on Sunday, August 26, 2018 05:00 UTC.

Dashboard can be accessed here during the contest. Problem analysis will be published soon after the contest.

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

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

Starts in 15 mins

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

WTF did just happen? I saw the first problem. Coded it. Went to submit it. And now it says the contest begins in 7 minutes?

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

The contest has been delayed by 15 mins due to some technical issues.

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

    Why did you hide the problem statements? It is unfair that some lucky contestant can read problems during 5:00-5:15.

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

Participants who read all of the problems just after the contest start win.

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

Is there a reason all problems have the same scoring? I don't think they are the same level of difficulty.

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

How to solve 2nd subtask of problem B?

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

    Do greedy and find minimum configuration. If it is not prohibited take it. Else try changing all possible bits(change bit x and then recurse and change some-other bit and so on). If u get a non-prohibited solution u can stop else u can keep on changing the bits. Since m<=100 u won't exceed memory

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

      But how will I make sure that cnt is minimum?

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

        Since we arer initially doing greedy solution when we terminate at a solution it is optimal because changing any other bits will lead to a sub optimal solution. In all possible changes for 1st change of bits are seen only a few will be prohibited. For those we change a second bit and then third bit if necessary and so on

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

    Always take the maximum frequency for each bit. There are two cases:

    1. If p is small, then simply run a bitmask solution for each bit and sort all the obtained costs storing the obtained strings alongside. Start from the smallest cost obtained until you find a permitted string.

    2. If p is big, note that since m is small, the final string will differ in at most 2 bits from the minimum cost string. Just iterate over p^2 possible different strings, mainaining the costs of the string. Again start from the smallest cost obtained until you find a permitted string.

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

      Maybe this is wrong because if the absolute difference between no. 0's and no. of 1's at position i forms array

      1 1 1 n n n n n n n n n n n n. (n is maximum diff we know). then this maynot work.

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

        Oh missed that. That would have failed my solution. Seems like the testcases were weak.

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

          I'm crying like hell, even I thought of too many greedy solutions, but I realised that all were wrong. and didn't even try........ I didn't expect such weak test cases :(

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

    Do DP with (index , forbidden string indexes that match the prefix built yet) as state. https://www.ideone.com/HfxR4M

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

How to solve a problem B with large input ?

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

    I tried using Greedy + Dijkstra.

    Starting with simple assumption M=0 (no forbidden tea)

    Now, using greedy find to target binary string( T0 ) which have minimal cost. ( Binary indexes are independent in this case)

    However M can be more than 0, but it has to be less-eq than 100.

    Considering a graph whose states(nodes) is represented by a binary string.

    We can start exploring states using Dijkstra with start state as T0. And from each state, we can jump to adjacent states which are at Hamming distance 1 from current state binary string with the proper edge cost.

    Terminate the search when the first binary string which is not present in forbidden tea is found. ( Our solution )

    And, the max number of states explored should be bounded by M * P

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

When will the results be out? Today ranklist wasn't working properly during the contest either :(

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

Was B (large) DP with bitmask Problem ?

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

My solution to B large: https://pastebin.com/v1yEZSVz

DpWays[X] counts the ways we can get X complains. If we are at the ith position and we use want to use 0 then we look at position i-1 and we will add how many complains we will get in ith position if we use 0(so we will add the number of ones of all strings in that position). So if at ith position using 0 we get A complains then at ith position if we will use 0 and we want to count the ways we can get X complains(until position i) we will calculate it as dpWays[X][i] += dp[X — A][i — 1]. Similar with the 1.

After that we just delete the complains we will get if we use strings from the forbidden set.

Answer will be the smallest X that has at least one way to happen.

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

How to solve C ?

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

    I had a solution with 2-D sparse BIT (Binary Indexed Tree). Basically first calculate number of permutations such that Bahu at least 2 values greater than the corresponding values for Bala. It can be done simply by using a BIT. Then subtract 2 times the number of permutations where all three values of Bahu are greater than Bala. This can be done using 2-D sparse bit. Any solution easier than this?

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

    Let Ai (Bi) be the sum of Bahu's (Bala's) cards in the i-th battlefield. If we fix A1 & B1, the rest part can be calculated by two pointers. Complexity is comb(3n,n)^2 comb(2n,n) and this is a bit larger, so I had to implement carefully(e.g. It is ok to assume a1 is always in the 1st battlefield. It is trivial when A1<=B1 && A2+A3<B2+b3+2 or A1>B1 && A2+A3>B2+B3.)

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

Is there some problem with the scoreboard?

All Scores shows different rank whereas friends shows different rank.

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

Upto which rank does google call for internships in kickstart?

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

Today morning around 10 mins before contest start I had this feeling that Kickstart is happening very properly compared to last year wrt glitches in website, leaderboard, reminder emails and all.

Then today's contest happened.

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

    Yeah, true.

    Analysis isn't out yet, so probably they're fixing up the things for now. The scoreboard and dashboard shows different statistics as well.

    Do you have any clue why all questions carried equal scoring? And round was only for 60 pts instead of 100. So, other than technical glitches they were some other issues too?

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

I solved B large by first constructing the best solution by looking at each ingredient.Then flipped bits corresponding to each subset in ascending order of cost of flipping, where cost of flipping is change in the cost before and after flipping. Since the number of disallowed configurations is almost M, this is feasible.Ranking the subsets wrt cost can be done by maintaining a min heap and updating with next largest element.

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

Serious scoreboard glitch- When I access the scoreboard from my account, then it shows that I have attained 22nd position when the one right below me has less penalty, and moreover, there are two people in 22 position from my account!

What's more surprising is, when the scoreboard is accessed from incognito mode or some other account, my username/rank doesn't show up at all, like I haven't even participated in the contest! And not just me, I've definitely found some other accounts with the same problem.

Even all scores and closest competitors show different results from my side.

I think this issue is serious, and must be fixed. I definitely do want a job at Google, and hope this does not hamper it in any way :(

EDIT-Resolved :D

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

    I met the same issue. Could anyone take a look at this issue?

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

    It seems something is broken very badly there. Notice 30th place penalty is 1:22:36, and 31th place penalty is 2:29:42 — there is a huge gap, which seems very weird because results of other contestants are very close. The same pattern is observed for other pages too, for example results of 90th and 91th places — huge gap again. Looks like lots if people are missed from the common scoreboard.

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

      Exactly-I think a whole page is missing between 30th and 31st place, and I am in that page maybe.

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

From what I am seeing, half of the participants are missing from the standings-that is, contestants who have obtained which would have been in even pages had the standings been complete. Another way of wording is it-pages 2, 4, 6, etc are missing from standings.

When will this issue be resolved?

Edit-Resolved :)

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

Scoreboard is fixed now. Really apologize for all the inconvenience. Hope you enjoyed the problems atleast (amidst all the frustration). I assure all of you folks that such kind of experience will not repeat in the future.

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

My rank is 250. Any chance to land an interview ?