Invitation to CodeChef August Long Challenge 2018 sponsored by ShareChat!

i am stuck on coordinate compression. passed all the given test cases expect last sub task (last test case-9).it’s very painful. i couldn’t find anything wrong in my code. checked so many test cases. but nothing happened. can anyone help me with it. :’( :’(

I feel that I’m making mistake in flushing the buffer in INTERACTIVE MATRIX
I’m doing it this way.

printf(“1 %d %d”, i, j);

fflush(stdout);

cin>>a[i][j];

is it the right way or I am doing something wrong

Yes, I believe it is correct. Just be careful I see you do not have “\n” in printf. I think it is needed.

1 Like

I believe WA -1 does NOT refer to using more than K operations as in one of my submissions some of the cases of Subtask 2 gave WA 0.0 and some in Subtask 3 gave WA -1.0 . Initially I was into the same confusion that -1 means more than K ops and I believedmy code was logically wrong somewhere in Subtask 2. Hence in my code I asserted everytime an operation was made and as soon as it used more than K operations it threw an exception. Using this ALL the cases which resulted in WA previously(-1 and 0) in Subtask 2 and Subtask 3 gave RTE. I suggest you do the same to verify yourself.

Is tc 31 something special in Interactive matrix question?

I got all correct except the tc 31… Can it be fault in mu algo or is it just some edge case? Please help all are correct except tc 31

Great problems. This was the first time I competed in Div 1 and it really was educational. Kudos to the setter and tester for making the problems challenging.

1 Like

@admin
I cannot open https://discuss.codechef.com/questions/133406/loncyc-editorial . Getting all sort of 500, 504 errors.

1 Like