https://www.acmicpc.net/problem/1076

 

1076번: 저항

첫째 줄에 첫 번째 색, 둘째 줄에 두 번째 색, 셋째 줄에 세 번째 색이 주어진다. 위의 표에 있는 색만 입력으로 주어진다.

www.acmicpc.net

def main():
    colors: list[str] = ["black", "brown", "red", "orange",
                         "yellow", "green", "blue", "violet", "grey", "white"]

    input_colors: list[str] = []
    for _ in range(3):
        input_colors.append(input())

    value1: int = colors.index(input_colors[0])
    value2: int = colors.index(input_colors[1])

    mul: int = 10 ** colors.index(input_colors[2])
    result = int(f'{value1}{value2}') * mul
    print(result)


if __name__ == "__main__":
    main()

+ Recent posts