You are not logged in. Please login at to post your questions!


Invitation to CodeChef July Long Challenge 2018!

Hello CodeChef Community! We’re excited to invite you for the July Long Challenge 2018 sponsored by ShareChat. Join us for ten intense days of coding challenges! Joining me on the problem setting panel are:

I hope you will enjoy solving them. Please give your feedback on the problem set in the comments below, after the contest.

Contest Details:

Time: 6th July 2018 (1500 hrs) to 16th July 2018 (1500 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

Contest link:

Registration: You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.

Prizes: Top 10 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here:
(For those who have not yet got their previous winning, please send an email to

Good Luck!
Hope to see you participating!!

This question is marked "community wiki".

asked 06 Jul, 03:55

mgch's gravatar image

accept rate: 21%

edited 06 Jul, 12:54

l_returns's gravatar image


hoping my name in list of authors someday :(
Haven't got reply on my request of joining problem setting (before one month)..

(06 Jul, 12:46) l_returns4★

"Top 10 performers get laddus". Did Codechef update their rules? I hope it's just a typo :/

(06 Jul, 14:05) abdullah7686★

yeah I also think so because contest page shows different prizes according to division..

(06 Jul, 14:57) l_returns4★

123next »

Can someone from Problem setting panel explain the sample test case of Reach Equilibrium as it seems a little unclear...
Please provide P and Q instead of the final answer for better understanding if possible...


answered 07 Jul, 19:25

l_returns's gravatar image

accept rate: 28%

edited 07 Jul, 19:29

PS: I commented on question 17 hours ago but haven't got a reply still... Many other people also commented about it....

(07 Jul, 19:28) l_returns4★

also maybe I think @mention is not working in comments on problem page....

(07 Jul, 22:53) l_returns4★

Do the magnitudes need to be integers in this problem, or they can be any real numbers. (According to the question it seems that they can be any real values but I doubt that.)

(08 Jul, 07:21) pshishod26455★

I am not having any faith in codechef anymore. Like no reply in 48 hours? No explanation of sample test case...And forget that even @admin is not worried to look at the announcement post once in a day. Seriously why??

(08 Jul, 15:04) pshishod26455★

explaining or disclosing P Q will be a spoiler maybe... and hence codechef is not replying... though I feel they should reply that "we can't do that now" ...

(08 Jul, 19:04) l_returns4★

We(teja349 and me) decided to don't add explanation for this problem, I'll explain why after the contest. Anyways, we added P and Q now.

(08 Jul, 20:49) mgch6★

@pshishod2645 sorry for the delay, I'm a bit busy with my university. Yes, magnitudes can be any real numbers(it's written in the statement)

(08 Jul, 20:50) mgch6★

Thanks @mgch atleast you replied with "You can't provide explanation, as it may be a spoiler",. Btw I myself found the value of P and Q by just running a loop of i, and j and checking i/j mod (10^9 + 7), :P

(08 Jul, 23:13) pshishod26455★
showing 5 of 8 show all

I'm having problem in reading input in challenge problem. The input follows test case 1 interaction 1 test case 2 interaction 2 .... scheme right? and not all testcases first and then interaction. Because my code is doing fine for first test case but it doesn't seem to be getting inputs for successive test cases.


answered 08 Jul, 23:04

praveenkumar12's gravatar image

accept rate: 8%


Same doubt. Asked 2 days before by commenting on the question, but got no reply. The admin and setting panel is horrible. I don't think they even look at this discussion page or question. Though problems are ok, but there is no clarifications for our doubts. I asked a doubt in gears as well but got no reply yet. I was asked 6 days ago, though I tried both cases as in doubt and somehow solved the problem. Also, test case for it is weak (I am sure of this, I will provide one after the contest)

(11 Jul, 11:20) error_503_4045★

m curious to know weak test case :D

(yesterday) l_returns4★

Pardon for inconvenience @praveenkumar12
Your comment got missed by me while answering other comments.

@error_503_404, your comment i couldn't have answered without being unfair to other users. So i didn't answer.

(yesterday) taran_14075★

@taran_1407 - for cases where you cant comment, simply give a comment denied at least. Every comment must be replied to- even if its a simple 'No, we cant answer that." It was something I made sure to highlight among setters whenever I was among the panel :)

(yesterday) vijju123 ♦5★

@taran_1407, what is the way to take input for multiple test cases? It is still not clear as highlighted in @praveenkumar12 comments. I still can't get it. Is it "testcases{1, 2, 3, 4, 5}, interaction{1, 2, 3, 4, 5}" or "testcase{1}, interaction{1}, testcase{2}, interaction{2} and so on".

(yesterday) error_503_4045★

atleast @taran_1407, you should have replied in this thread seeing the doubt raised by @praveenkumar12, your negligence to replying to comments and questions is horrible. See @mgch replied that he can't explain "Reach equilibrium".

(yesterday) error_503_4045★

@vijju123 who do we have to report to in case of such negligence from such authors?

(yesterday) error_503_4045★

Interaction is done as follows.

Read T
Input 1, interaction 1
Input 2, interaction 2 and so on

(yesterday) taran_14075★

Just to clarify @error_503_404 ,there isn't just one round like A moves ,the B moves

there are N/(A+B) rounds,(A moves ,B moves),(A moves,B moves),..N/(A+B) times

and as far as the ordering of test cases were concerned u could have tried both ways,it wouldn't take much time :)

But i agree with @vijju123 point

And i hope there isn't any rule for saying what is written in the question to others :),if there is ,do tell me,i wouldn't do so.

(yesterday) vivek_19982996★

Procedure: You print a pairs, judge print b pairs.

Above repeats until all robots are destroyed.

Say A+B = D

Then you have to repeact prodecure N/D times.

Read line in statement, "This continues until all robots are destroyed".

(yesterday) taran_14075★

@error_503_404 - The interaction is same as any standard interaction question. You have to give your output and flush it in order to receive next input.

@vijju123 who do we have to report to in case of such negligence from such authors?

Only @mgch . But I feel its not a case of negligence. I feel he might have rejected that comment - for which I suggested him to convey via "comment denied" response - but other than that, @taran_1407 is a very responsible guy in my opinion. I feel you are misinterpretting his actions.

(yesterday) vijju123 ♦5★

Yeah I also didn't knew about there are N/D rounds first.. I got a lot of wrong answers... but afterwards I noticed that $N is divisible by A+B$ and just thought why it should be divisible and hence got to know that there are more number of rounds...

(22 hours ago) l_returns4★


"This continues until all robots are destroyed."

I can't find the line you are talking about in problem statement... can you please help me to find it ?
What I found is only is lines

"It happens in N turns;"


"N is divisible by A+B"

which gives hint about having multiple turns...

(22 hours ago) l_returns4★

@taran_1407, @l_returns, @vijjus_123 so this explains horrible statement.

(21 hours ago) error_503_4045★

I think question is nice and it's also good that @taran_1407 replied...
I liked the question...

(18 hours ago) l_returns4★

@l_returns, I don't say that question is not nice. It is just that statement is horrible and also the scoring function as many people are receiving 95+ points once getting a naive idea and thus can't separate people much. Hence, not a good scoring pattern for challenge problem.

(7 hours ago) error_503_4045★

I understand that problem statement was not as clear as i would have liked.

I will try to make problem statements more clear and with better scoring function if ever i write another challenge problem.

(5 hours ago) taran_14075★

I got 42 by random outputs in challenge question xD
Thanks to my luck :D

(5 hours ago) l_returns4★

all matches I decided were random + all robots taken were also random :D

(5 hours ago) l_returns4★
showing 5 of 19 show all

How many problems?


answered 06 Jul, 14:56

asadullo's gravatar image

accept rate: 0%

Can someone tell about notification "You are not allowed to check this content." in July long 2018 contest... Thanks.....

This answer is marked "community wiki".

answered 08 Jul, 15:28

hardik_95's gravatar image

accept rate: 0%

Please share Screenshot.

(08 Jul, 18:17) aryanc4033★

Commented on Magic Set problem but no reply in 10 hours.

This answer is marked "community wiki".

answered 08 Jul, 16:04

tendibee's gravatar image

accept rate: 0%

wikified 08 Jul, 16:05

Commented on Magic Set problem no reply from day contest started plz setter look to it.


answered 09 Jul, 14:07

code_man's gravatar image

accept rate: 11%

hehe I remember your name... "code_man" XD
reminds me of MMASS question we discussed..
I remember due to username :) and our long discussions..

(10 Jul, 13:24) l_returns4★

Haahaa hu pan nai bhulu MMASS and ur help for that:)

(10 Jul, 23:31) code_man2★

Hey how u know Gujarati bro ??

(11 Jul, 07:08) l_returns4★

Ala bhai hu gujrati chu ....:)_/_

(11 Jul, 23:38) code_man2★

nice man :D

(12 Jul, 02:27) l_returns4★

I commented on the Magic Set problem but still no reply.


answered 10 Jul, 05:31

spafindoople's gravatar image

accept rate: 0%

Is there anyone who got reply from problem setting panel for MGCSET ?? Can anyone (from problem setting panel) add better explanation for test cases of MGCSET?? I'm waiting for reply from 2 days.

And a suggestion for problem setting panel - Make some comments public.


answered 10 Jul, 11:13

aryanc403's gravatar image

accept rate: 16%

edited 10 Jul, 14:49

@vijju123 @mgch I strongly feel problem statement of MGCSET has been altered in past 2 days. And why is no announcement made after this change?

(10 Jul, 19:56) aryanc4033★

Commented on Gears but I am not getting any reply. I am waiting for more than two days.


answered 10 Jul, 12:02

vipin1407's gravatar image

accept rate: 0%

Can anyone tell me how to flush the output after every line in Chef and war question.

What I have been using is cout.flush() but it doesn't seen to work.


answered 10 Jul, 17:48

hrishabh15's gravatar image

accept rate: 37%


C++ use the fflush(stdout) function
Java — call System.out.flush()
Python — sys.stdout.flush()
Pascal — flush(output)

(10 Jul, 19:48) brijesh_19985★

cout << endl;
works for c++... use it whenever u wanna flush..

(2 days ago) l_returns4★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 06 Jul, 03:55

question was seen: 2,302 times

last updated: 3 hours ago