One simulation problem. The statement is very long, and I spent most of my time reading the spec.
Implement a CPU core temperature simulation system: tick(t) advances time, and set_core_load(...) sets the load (it only takes effect on the next tick, last write wins). On each tick: first advance the temperature using the state from the previous interval (you can compute it in closed form, no need to simulate second by second), then apply the pending load, then run the active cooling cascade (the more cores that are enabled, the bigger the vibration penalty), then handle shutdown and restart (a core shuts down above 80°C and can only restart below 50°C). Cores that have been shut down still get passive cooling. The output is a status string like "coreA=cooling" for each core, sorted by core_id (statuses are idle/cooling/shutdown), and only cores whose status changed are printed.
Tips: definitely work through the examples tick by tick by hand. A lot of the ambiguous parts are answered by the examples.
Discussion
Loading comments…