5

Task 22 - Two Printers

 1 year ago
source link: https://www.codeabbey.com/index/forum_topic/0168cb823b799bb5e3921c8038c6d5ec
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Task 22 - Two Printers

Back to General discussions forum

pkrohg     2023-03-21 20:19:10

Like others who have posted about this task, my results match the expected results most of the time, with a few random ones that do not. In looking at why, it turns out that in EVERY case when we don't match it is because the expected result sent partial pages to the printers. This doesn't make sense to me - i.e. you don't send 2.24689 pages to a printer, you send 3. And in every case, the difference between the expected answer and mine is the difference in time for a full page, and the partial. Here are a couple of actual test cases that illustrate the problem:

334 488 1940685 (Expected answer: 384812888 - 1,152,134.395209580... pages; Mine: 384813090 - 1,152,135 pages) 12949 8873 63714 (Expected answer: 335469743 - 37,807.92775836... pages; Mine: 335470384 - 37,808 pages)

Am I missing something? Thanks!

pkrohg     2023-03-25 21:50:53

The problem is, 384812888 / 334 does NOT = 1152134 pages, it equals 1152134.39520958... pages.

If you sent 1152134 pages to the first printer then the time to print that should be 1152134 * 334 = 384812756. Which is also not the expected answer. The difference, 132, is the partial page (the extra .39520958... * 334) assigned to the first printer in the expected answer. I still think the first printer should have been assigned 1152135 pages and not 1152134.39520958...

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

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK