ajinkya1p3's blog

By ajinkya1p3, history, 9 years ago, In English

Clique is back!! And this time, it is going to be bigger, better, and much more exciting!! Get ready to experience the thrill once again as we bring for you 3 hours of non-stop coding, and fun!

Web Enthusiasts' Club, National Institute of Technology Karnataka, Surathkal has brought for you the second edition of the online programming contest series — Clique.

Date: 12th March 2016, Saturday

Time: 9.30pm to 12.30am IST (Check your timezone here)

Register At: http://www.hackerrank.com/clique2

Problem Setters: vishalkarve15, vadi, ajinkya1p3, lazyCoding, asteri

Testers: rednivrug15, vishalkarve15, InnocentFool

RULES:

1.This is an individual contest.

2.There are FIVE problems of varying difficulty levels.

3.You will receive one point for solving a problem (passing all test cases — no partial credit), regardless of the level of difficulty of that problem.

4.The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the first accepted run plus 20 penalty minutes for every previously rejected run for that problem. There is no time consumed for a problem that is not solved.

5.Languages allowed — C, C++, JAVA, Python.

We have tried our best to prepare an interesting problemset, and the difficulty level is roughly the same as a Codeforces Div2 round. Here's a link to our previous contest : clique 1.0

Hope you'll have an amazing time!! Happy Coding!!!

UPD 1: The contest begins in about an hour! Register NOW, if you haven't done it yet! :D

UPD 2: The contest has ended successfully. Thank you for participating. We hope you had a great time! :)

Here are the overall winners :

  1. fernandoshao
  2. Golovanov399
  3. Elise

And here is the link to the editorials. (You can also find them under the 'Editorial' tab for each of the questions.) :

Editorials

See you in the next edition.. :)

  • Vote: I like it
  • +26
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Best of luck guys!

»
9 years ago, # |
  Vote: I like it +7 Vote: I do not like it

All the best everyone!!

»
9 years ago, # |
  Vote: I like it +6 Vote: I do not like it

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

»
9 years ago, # |
  Vote: I like it +18 Vote: I do not like it

Nice contest ! I promised feedback after round :)

The tasks are interesting. It is really bad because you didn't have more than 150 participants. For me this round deserve much more contestans. I'll give my best to talk with friends from HackerRank allow you it for some further rounds ;)

About task:

Fist task nice and easy. My advice for futre: you put black letters for type A and for type B, for my opinion that isn't important. You should have put black letters (bold letters) for sentence where is written that durantion of swaping is 0 minutes.

Second task is harder than it should be. I like it, but many coders couldn't solve anything after 20 minutes.

Third task is very interesting. Nice example of dfs. I solved it very fast ( between second and third task I showered :P ), but I am sure that I couldn't do it before half year for example.

I didn't solve fourth task on the round, ie. I solved it but I saw low rate of successful submission and I didn't decide for coding it. Obviously that is dp problem. My approache looks pretty standard and correct, and it works in complexity O(n^3). Dp[i][j] number of valid arrays of length i where a[i]=j. . How to do it? With simple iterating over all position for previous occurrence of that element and multiplying by the corresponding number of ways for putting different numbers between it ( this case is pretty tricky and possible we need another dp for solving it). At the and we should notice that Dp[i][j]=Dp[i][k] for 1<=j,k<=n. So we can multiply each time answer by n instead to calculate all conditions. Taks is a lot tricky and I am sure I will look codes of best contestants.

I can not solve the task, but it looks good for me :)

See you :)

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Thanks a lot for the feedback allllekssssa. :) We're happy you liked it and we'll definitely try to improve the next time!! :)

»
9 years ago, # |
  Vote: I like it +2 Vote: I do not like it

How to solve "Subarray and Magic" (prob B) ?

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    Notice that after you choose one start number num[i], the number at indice i, there may be only one valid subarray ending at the (k+1)th ocurrence of num[i] after i.

    Also notice that by changing one number to num[i] you add at most one, maybe zero, valid subarray starting with num[i].

    So, just use all your changes to transform the number with low frequency into the number with highest frequency and calculate the number of valid subarrays.

»
9 years ago, # |
  Vote: I like it +9 Vote: I do not like it

Thanks for the awesome contest I could solve A and B.

»
9 years ago, # |
  Vote: I like it +13 Vote: I do not like it

Thanks for the editorials, usually college contests on HR don't give editorials and that makes them completely worthless.