|
|
back to boardShow all messages Hide all messages1) First of all you have to calculate maximum of tickets the teacher can buy ((amount of money) div (price of one ticket)) 2) Next step you have to find minimum of tickets. You must pick up one banknote with minimum denomination and calculate amount again: in sample test you get 0 1 0 0 0 0 sequence. Then calculate amonut of money again. So, now you can get minimun of tickets ((new amount of money) div (price of one ticket) + 1). 3) So, now you have minimum and maximum of tickets. Just output the number of possible answers in the first line (tMax - tMin + 1) and the variants in ascending order (for i:=tMin to tMax do write(i,' '); Good luck and get AC! this algo get WA on test #13 Edited by author 25.06.2013 23:54 I think you miss one important step: Think hard about how flexible your tickets is. Not just minimum and maximum tickets, otherwise you will still get WA. |
|
|