### kingofnumbers's blog

By kingofnumbers, 6 years ago,

Hello problem solvers!

I'm glad to invite you to participate in HackerEarth September Easy Challenge. it will start on September , 1st at 16:00 UTC, link of the contest: September Easy Challenge

There will be 6 algorithmic problems of varying difficulties (from easy to medium) and you will be given 3 hours to solve them, each problem is worth 100 points and partial points is allowed (you will be given points of each test case you pass). Top 5 beginners will receive HackerEarth T-shirts.

Problems are set by subway, Tested by Me kingofnumbers and the editorialist is ikbal

we did our best to prepare the contest so we hope you enjoy it and benefit from it.

looking forward to see you on the contest , Good luck!

• +24

 » 6 years ago, # |   0 Is the contest individual or team participation ?
•  » » 6 years ago, # ^ |   +7 it is individual contest.
 » 6 years ago, # |   0 Is there penalty for time?
•  » » 6 years ago, # ^ |   +5 Yes, ties are broken by time penalty
 » 6 years ago, # |   0 Is the number of tests the same for all problems?
•  » » 6 years ago, # ^ |   +5 I don't think that it is necessary.
 » 6 years ago, # |   0 Congratulations to the winners! https://www.hackerearth.com/september-easy-15/hof/ Also, the editorials are out. :)
 » 6 years ago, # |   0 I was trying the last problem from the contest -- heremy documented solution here I would be glad if someone can look into the solution and figure out the anomaly in it. Thanks.
•  » » 6 years ago, # ^ |   0 You are calling function dfs(i, j) from top left to right down which is very wrong. Instead call it in the increasing order of cell values i.e. from (i, j) such that a[i][j] = 1 to (k, l) such that a[k][l] = 100.
•  » » » 6 years ago, # ^ |   0 I thought over what you suggested but I still can't figure out how positions of launching dfs will affect the result. it would be great if you could give a small counter test case , that would make things clear ,and thanks for your time.
•  » » 6 years ago, # ^ |   +5 Error is in your dfs function inside the loop, in the nested if statement it should be:if(!vis[x+adj[0][i]][y+adj[1][i]])instead of:if(!vis[x+adj[0][i]][x+adj[0][i]])And use long long for storing ans, just to be safe.Here is the working code
•  » » » 6 years ago, # ^ |   0 thanks a lot shubham for taking out the time and looking into the code. btw pathetic mistake on my part :(.
 » 6 years ago, # |   +9 Oh, by the way, if anyone is interested in setting / testing, or writing editorials for the future Easy contests, they can drop me a message.