Resistance
InterviewTime limit2sMemory limit128 MB
Given three color names, map each to its digit or multiplier using a fixed table and print the resulting resistance value.
- Level
Easy1 of 10
- Topics
- Hash map, Implementation
- Solved
- No attempts yet
Problem
Electronic devices contain resistors. A resistor is marked with three colors, and those colors determine its resistance in ohms. The first two colors form a two-digit value, and the third color gives the multiplier. Use the following table to interpret each color.
Input
The first line contains the first color, the second line contains the second color, and the third line contains the third color. Every input color appears in the table above.
Output
Print the resistance value calculated from the three given colors.