"I want to ask a question" - Ask them all here!

Ask this at comment section of problem. If its not violating rules, problem setter oughts to reply. Admin says that problem shouldnt be discussed on discuss while contest is live…

The editorials for snackdown should be available soon. If they dont come up after 24 hours from now, i will upgrade it into a question :slight_smile:

@ani_1107

No it is not allowed as it is an ongoing contest.

Discussing of problems of a live contests are against the rules. So, Nope :frowning:

This seems more like a feedback. Minor glitches during contest arent uncommon. Nevertheless, its upgraded to a question to allow anyone else with similar issue vent out his grievance there (which will strengthen your point).

Please provide the exact link to the question.

Its best if you move this to the question related to snackdown editorial.

Probably because when they made the mirror, everyone was able to see the solutions and some people used it for cheating, so they denied access and forgot to revoke that. And true :frowning: editorials are taking long. There is a post regarding that issue already here: Pleases upload Snackdown Elimination Round Editorials! - general - CodeChef Discuss

1 Like

If you have a specific problem you want solution of, you can request the fellow members of discuss to help you.

Firstly, dont spam discuss by asking same thing multiple times. Then, N varies from 1-10^9. For 10^9, you will exhaust the maximum recursion depth and hence get a SIGSEV. Your function has a limit upto which it can undergo recursion.

sorry for asking multiple times.what changes i have to do in my code?can u please tell me?

The changes are simple. First thing is, that the function repeats after every 6th number. Meaning-

F(1)=F(7), F(2)=F(8) and so on...

All you have to do is to compute the first 6 values of function (do some maths on paper!). Then, do N%6 and arr[N%6-1] is the answer. (To understand this, i repeat, DO it on paper, find out values of F(1), F(2)…F(8) in terms of A and B, and then it will make perfect sense!)

Thanks @vijju.:slight_smile:

In case you get stuck on implementation, you can view my code here-

https://www.codechef.com/viewsolution/13783648

Please give a link to the question, as well as your solution. Because without seeing your code, its not possible to pin-point the exact reason behind the error.

Hi,

Thanks for the reply. I would want to rectify the error myself at least till I give up… :slight_smile:

I am more keen in understanding, where in this website can I find the output the code is generating? I am just seeing a NZEC in the MySubmissions page; but not clear of what exception the code is throwing.

Regards,
Lalitha

NZEC error most commonly happens when you access an array out of bounds, especially in JAVA. I will suggest you go through any nested loop and make sure its of type-

for(i=0;i<n-1;i++)
   for(j=i+1;j<n;j++)

Which language are you using? If its C++, then long and int have same memory. Use long long int instead of long or int.

Data overflow usually gives WA.

I am using Java

Then it must be a logical error on your part. Make sure to read the Q carefully and check comments (if any).