Virtual Verification
Time limit3sMemory limit1024 MB
Store a 14-digit password in 48 clocks that may be shuffled at random and shifted by magnetic fields, then recover the password from the hour hands.
- Level
Medium7 of 10
- Topics
- Math, Implementation, Combinatorics
- Solved
- No attempts yet
Problem
Hyundai AutoEver develops a virtual verification platform that virtualizes in-vehicle controllers, systems, and vehicles and builds a virtual driving environment, so it can run integrated simulations of a vehicle. Applying the platform to vehicle software development lets engineers develop and verify software before any vehicle or controller hardware is built. This shortens the development period for vehicle software and makes it possible to build vehicles with higher stability.
Kim, an engineer at Hyundai AutoEver, is developing new vehicle software. The last step left is to use the virtual verification platform to check that the software works correctly. Virtual verification revealed a serious defect, however. The software starts only after a 14-digit password made of digits is entered, and in some environments the password information is lost. While looking for a fix, Kim noticed the clock inside the vehicle.
The software can read or adjust 48 clocks in total. At first, the front 24 clocks are type 1 clocks, and the back 24 clocks are type 2 clocks. Each clock has only an hour hand, which points to hours 1 through 24 in clockwise order. When a new password is set, the software sets the hour hand of each clock. All clocks look the same, so clocks cannot be told apart within a type or across types.
During a drive, the vehicle can experience two kinds of events, and several of them can happen in one drive.
- The vehicle receives an impact. In this case, the order of the clocks is shuffled at random.
- The vehicle enters an environment with a magnetic field. When the field strength is , the hour hands of the type 1 clocks move clockwise by , and the hour hands of the type 2 clocks move clockwise by . If a clock points to 24 and its hour hand moves clockwise by 1, it points to 1.
The software does not know which changes were applied or how. When the password must be known, the software reads the hour hands of the clocks and restores the password.
Storing information in clocks is a good idea, but Kim does not yet see how to read the constantly changing clock states across these environments and recover the password. Write a program that stores the password in the clocks and recovers it.