Problem 22

Back to Problem Solutions forum

MAE_S_TRO     2021-03-22 21:56:48

I wrote a code, which works in a WinStudio. But it doesn't work correctly in the site's window. If I'm waiting for 16 answers, it gives me 10 answers. Or 11, if I'm waiting for 19 answers. Or 13... I know about rules, I cannot post my code, but I don't know, how I can solve this task.

Rodion (admin)     2021-03-22 22:35:27
User avatar

I cannot post my code

Not that it is strictly forbidden, but simply not needed - your code is visible for everyone who solved this task, accessible from your profile page:

here

However, it would be much easier if you give an example of input data along with expected answer and your answer, otherwise it is bit hard to tell which input these 16 or 10 are about.

By the way, your code is printing every answer on separate line. Problem checker expects them simply to be delimited with spaces.

Rodion (admin)     2021-03-22 22:56:07
User avatar

P.S. I think I got what you meant. Your code gives less answers than you expect simply because it times out.

Your solution is quite slow (sorry) because it subtracts every "second" while printers are working.

If you want you can calculate result in your WinStudio and copy-paste it into the answer to submit. However, of course, you may prefer to find faster (more proper) solution :)

MAE_S_TRO     2021-03-28 10:39:29

Thank you. I'll try to change my solution.

Please login and solve 5 problems to be able to post at forum