![]() |
|
[HFCC] The Hack Forums Coding Contest - Week 4 - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [HFCC] The Hack Forums Coding Contest - Week 4 (/showthread.php?tid=5580122) |
[HFCC] The Hack Forums Coding Contest - Week 4 - Haxalot - Mar 20, 2017 About
What's the Point?
Leaderboard
I'm always open to hearing feedback if members here have any thoughts on the difficulty or number of the challenges presented, the length of the contest, or the starting times. * - Haxalot - Mar 24, 2017 This contest starts today (~5hrs time) for the interested. * - vaiperboy - Mar 24, 2017 sad to see that not much are interested, anyways, just registered :) looking forward for the challenges :p * - Nachfolger - Mar 24, 2017 I was very interested until I had to sign up with my "actual" info. I can't be bothered to do that nonsense. But gl! * - vaiperboy - Mar 24, 2017 (Mar 24, 2017 05:33 AM)Nachfolger Wrote: I was very interested until I had to sign up with my "actual" info. I can't be bothered to do that nonsense.just fake the name n w/e * - Haxalot - Mar 24, 2017 (Mar 24, 2017 05:33 AM)Nachfolger Wrote: I was very interested until I had to sign up with my "actual" info. I can't be bothered to do that nonsense. As vaiperboy said, you can simply use a fake name if you're concerned about privacy. Personally though, if you do want to get into solving programming challenges, then I'd use your actual name. There have been many cases where recruiters have (unsolicitedly) reached out to programmers who do well at problem solving on sites like this. Every programmer should have a GitHub account, so you can simply sign up using that to make things easier. * - kutabe - Mar 24, 2017 I win. Changing Bits was hard enough. First I did it with Golang, math/big,but some cases didn't pass 'coz it was too slow. [edit] : With a little bit of investigation I found weak spot in my code and it was kinda surprising. So, I was confused and upset when my code in Go took 30+ seconds in case #4. I did some benchmarks and, gosh, it was so unexpected. I fixed few lines and now this same test case perceed in 1.5s. Don't use fmt.Scan when dealing with stdio, guys. Use fmt.Fscan and readers instead. Wish you many years and prosperity. [edit]: Thread seems dead. * - Haxalot - Mar 25, 2017 Congrats, you solved them all pretty quickly. And the thread's not dead - there's just not much to talk about whilst other's are still solving the challenges. * - Haxalot - Mar 27, 2017 This contest is now over. Feel free to post and/or discuss solutions to the challenges here. * - kutabe - Mar 27, 2017 HERE is my solution to BitCh issue, if you interested. * - Haxalot - Mar 27, 2017 (Mar 27, 2017 12:16 PM)kutabe Wrote: HERE is my solution to BitCh issue, if you interested. Nice. Go made the problem seem trivial, actually. I was using C and only managed to get 7/10 of the test cases to pass. I initially tried the eager approach of updating the array C whenever a bit was changed in either array A or array B: Code #include <stdio.h>This meant that the lookup time for array C was a constant time operation, but if there were a lot of bits changing without much access to array C, then it would end up being quite expensive. I then tried the lazy approach where I only computed part of array C when it was accessed. This yielded better performance overall, and made the updating of the arrays A and B constant time: Code #include <stdio.h>But it was still too slow for test cases #1, #4, and #5 though. I ran some benchmarks locally, where I had 100k lengths for arrays A and B, and 3 million queries (6 times the max on Hackerrank), which yielded execution times of below 1 second. The solution was just slow on Hackerrank... More thought is needed on this one, I think. |