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?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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?
Название |
---|
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.