+ 2

Output showing timeout C++ [SOLVED]

Here is my C++ code which is displaying a timeout error. I don't know why but it is doing this. I don't know what does it mean by saying timeout. Pleaee help me in debugging my code. https://code.sololearn.com/crZT1Zc3Lt3x/?ref=app

13th Apr 2020, 6:37 PM
Sarthak Gupta
Sarthak Gupta - avatar
2 odpowiedzi
+ 3
It's because in lines 18 and 22, you are trying to divide diff by a variable that is declared as 0. player1lead = player1lead * (bool)(player1lead/diff) + diff * (bool)(diff/player1lead); This part It's the same with line 22.
13th Apr 2020, 6:45 PM
CeePlusPlus
CeePlusPlus - avatar
+ 2
CeePlusPlus Thanks a lot, I got mistake, now the code is working correctly.☺️
13th Apr 2020, 7:19 PM
Sarthak Gupta
Sarthak Gupta - avatar