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

Автор dyps, 11 лет назад, По-английски

Hello Coders,

The December edition of 101 Hack is here. This time we have 5 interesting challenges lined up for you.
The contest commences on 18th Dec 2014 at 16:30 UTC, and will run for 2 hours. You can sign up for the contest here.

The problem statements will be available in English, Russian and Chinese.

Top 10 on leaderboard get cool HackerRank T Shirts

Problem Setter
Shaka Shadows EMINAYAR

Problem Testers
dyps
wanbo

Please try all problems, Editorials will be available at the end of contest.

GL&HF

Update

The contest has begun!!

Update 2

Editorials are live!

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

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

Starting in 20 minutes.

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

There is one more problemsetter : EMINAYAR :D

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

If you're going to let people race to squeeze partial points out of the last problem, it would probably be better if you actually gave some info so that we don't have to blindly code stuff hoping for points.

Something similar to:

  • In a set of test cases worth 10.43 points, max(NQ, N2) ≤ 107.
  • In a set of test cases worth 20.62 points, gcd(P, 10) = 1.

Or just remove partial scoring entirely. I don't like coding wrong stuff on purpose :/

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

The editorials solution for the 4th question is needlessly complicated. Here is a simpler approach.

Let f(a)=2^(2^a). Then, f(a)=f(a-1)*f(a-1)

Since, a was reasonably small for a linear approach just do a linear scan from 1 to a and get the answer. My solution

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

can u provide the link to the editorials .. not able to find it

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

Superpowers of 2: I thought this won't pass, so didn't even try using it during the contest.

Python solution:

a,b=map(int,raw_input().split())
print pow(2,2**a,b)

Can someone tell me how Python's pow(a,b,c) works exactly? I thought it won't work in cases where gcd(2a, b) ≠ 1.

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

akulsareen already mentioned it.

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

The gradient of the problem-set was not good. 4 easy problem and 1 hard problem. All the easy problems were very standard. The play with words problem was derived from this post on geeksforgeeks. The example test case included the subs-sequence "geeksforgeeks" too.(It may be a coincidence, but such standard problems should not be used in international contests)

Seeing the editorial of "a superpower of 2" , it looks like that testers did not check the constraints of the test cases. They seem to forget about the linear time solution :P