Seems like HackerRank is down. Anybody from Hackerrank knows what will happen to the live contests? I mean, should we wait for 5-10 mins for the site to come back or what?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
9 | awoo | 152 |
10 | luogu_official | 150 |
Seems like HackerRank is down. Anybody from Hackerrank knows what will happen to the live contests? I mean, should we wait for 5-10 mins for the site to come back or what?
Name |
---|
Yep, down for me too. Will Codeagon be extended or postponed or something?
Looks like it is back up!
Can't see problems yet though.
It is working now for me
I didn't see comment above...
Delays in the verdict caused me severe issues, I wasted a lot of time due to that and also in Counting Princess Presents,
if the input graph is surely a Tree changes the problem drastically! Did I miss some line or was it understood or something? If not that was bad!
In the question "Happiness of a Kingdom", in case of no special edges,the empty subset was included n (ie number of nodes) times in the answer.Any explanation for this?
n graphs that contain a single node and no edges... should have been clarified.
We had to find number of different subset of edges and not the number of different graphs.I guess the empty subset should only be included once.
How to solve C ?
I tried a DP approach where my state is
(idx , rem (remaining shops to visit))
. Mypos
array contains the indices of the shops which contain the item.Greedy. The chosen m shops should be contiguous from the list of shops that contain items.
Could you prove why taking consecutive shops work?
Prove it by contradiction. If some shop is skipped, you can replace it with some other shop and decrease the total cost.
But shouldn't the DP solution give the same answer . I was getting WA instead of TLEs and RTEs.
I tried DP and got a few test cases right.
Here
It gives segmentation fault for rest.
I tried a 2-D DP too ... It didn't pass memory and time.
f(i, j) be the minimum time to reach shop i having bought exactly j sweets.
if(bi = 0) f(i, j) = f(i — 1, j) + j*k else f(i, j) = min{f(i — 1, j) + j*k, f(i — 1, j — 1) + (j — 1)*k}
Base case — f(i, 0) = i
However, for memory it won't pass. I was able to get past the memory problem by storing a 1-D array f(i) ... and doing j passes on it and keeping track of previous f ... which will have f(i, j — 1).
It didn't pass the time limit because it is of complexity O(M*N) and both those numbers can be 1e5.
Here's the code. In case you're interested. An O(n) solution is expected.
Finally I found the problem . HackerRank doesn't report Runtime Exceptions , they are treated as WA . So I put my code in a try block and had a infinite loop in the catch part . All the test cases which gave WA earlier now became TLE . Hence DP works but its slow and memory inefficient .
Using two pointer method ? It also depends on the position of first shop in our chosen m shops
Was there some issue in the site in the middle of the contest as well (Somewhere around 2.5 hours into the contest)? The pages kept on loading for eternity. I tried on Firefox,Chrome, cleared the cache but only in the last few minutes the site functioned normally.