Google Code Jam 2019 Round 1B - Draupnir

Draupnir - Click Here



  Odin has some magical rings which produce copies of themselves. Each “X-day ring” produces one more X-day ring every X days after the day it came into existence. These rings come in six possible varieties: 1-day, 2-day, …, all the way up to 6-day.

  For example, a 3-day ring that came into existence on day 0 would do nothing until day 3, when it would produce another 3-day ring. Then, on day 6, each of those two rings would produce another 3-day ring, and so on.

  You know that Odin had no rings before day 0. On day 0, some rings came into existence. At the end of day 0, Odin had Ri i-day rings, for each $1 \leq i \leq 6$. You know that $0 \leq R_i \leq 100$, for all $i$, and at least one of the $R_i$ values is positive.

  Fortunately, you also have access to the secret well of knowledge. Each time you use it, you can find out the total number of rings that Odin had at the end of a particular day between day 1 and day 500, inclusive. The well will give you the answer modulo $2^{63}$, because even it can only hold so much information! Moreover, you can only use the well up to W times.

  Your goal is to determine how many rings of each type Odin had at the end of day 0 — that is, you must find each of the $R_i$ values.

  Test set 1: W = 6

  Test set 2: W = 2
















CODE - Click Here

本站总访问量次 | 本站访客数人次

Powered by Hexo | Designed by iTimeTraveler | Refined by CSHwang