실험실
  • [백준] 18691번: Pokemon Buddy - 파이썬
    2024년 11월 27일 18시 57분 08초에 업로드 된 글입니다.
    작성자: B1NK
    728x90
    • 백준 링크: 18691번: Pokemon Buddy
    • solved.ac 난이도: 브론즈 IV
    • 시간 제한: 2 초
    • 메모리 제한: 512 MB

    문제

    Pokemon Go just released the Buddy update. It lets you select a Pokemon to appear alongside your trainer’s avatar on your profile screen. As you walk with your buddy, it will find candy that can be used to evolve the Pokemon.

    입력

    Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100).

    출력

    For each test case, print a single line containing the number of Kilometers of walking required to Evolve the Pokemon.

    코드

    for _ in range(int(input())) :
        G, C, E = map(int, input().split())
        cnt = (E - C) * [1, 3, 5][G - 1]
        print([cnt, 0][cnt <= 0])
    728x90
    댓글