This page is still under construction.

Parts of this page are still being built. What you see may change.

Resistance

Interview

Time limit2sMemory limit128 MB

Summary
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.

ColorValueMultiplier
black01
brown110
red2100
orange31,000
yellow410,000
green5100,000
blue61,000,000
violet710,000,000
grey8100,000,000
white91,000,000,000

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.

Examples3

  1. Example 1

    Input
    yellow
    violet
    red
    
    Expected output
    4700
    
  2. Example 2

    Input
    orange
    red
    blue
    
    Expected output
    32000000
    
  3. Example 3

    Input
    white
    white
    white
    
    Expected output
    99000000000