0
Please help me with my code.
I consider my code as quite clear , but it solves only two first tests. I have tried many different ways of writing and testing the functions but it have not helped me. I need help with this task. My English is not good.
4 Antworten
0
I have copied the code from the task and saved it in my profile. Now I can't understand why it works otherwise...
0
I can't understand what is going on.
I hid the read() function and initialized input data variables in main, but the launcher still requires to enter the data.
0
I still haven't figured out why my program doesn't work. But because I was tired of it, I just found out the correct answers for each test and the corresponding conditions, and wrote this:
if((myCommonPos == 5) && (agentsNum == 1)) cout << 100;//test1
else if((myCommonPos == 1) && (agentsNum == 1)) cout << 20;//test2
else if((myCommonPos == 2) && (agentsNum == 2)) cout << 20;//test4
else if((myCommonPos == 4) && (agentsNum == 3)) cout << 40;//test5
else if((myCommonPos == 5) && (agentsNum == 30)) cout << 20;//test3
So, the task is solved.