sm 기술 블로그

174. 25304(영수증) - 파이썬 본문

문제/백준_파이썬

174. 25304(영수증) - 파이썬

sm_hope 2022. 8. 13. 13:56
import sys
input = sys.stdin.readline

X = int(input())
N = int(input())

result = 0

for i in range(N):
    a, b = map(int, input().split())
    result += a * b

if result == X:
    print("Yes")
else:
    print("No")

문제요약

영수증이 맞는지 확인하라

설명

매우 간단한 문제이다.

각 항목의 곱한 값에서 더한 값이 영수증 값과 같으면 Yes  아니면 NO 이다.

Comments