본문 바로가기
python-algorithm

백준 25304 영수증

by 무적김두칠 2022. 11. 7.

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

 

25304번: 영수증

준원이는 저번 주에 살면서 처음으로 코스트코를 가 봤다. 정말 멋졌다. 그런데, 몇 개 담지도 않았는데 수상하게 높은 금액이 나오는 것이다! 준원이는 영수증을 보면서 정확하게 계산된 것

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
x=int(input())
n=int(input())
total_price = 0
for i in range(n):
    a, b =map(int, input().split())
    total_price+= a*b
if x == total_price:
    print("Yes")
else:
    print("No")
cs

단순 계산

Just calculate , Use for loop

반응형

'python-algorithm' 카테고리의 다른 글

백준 14582 오늘도 졌다  (0) 2022.11.08
백준 8760 Schronisko  (0) 2022.11.08
백준 3733 Shares  (0) 2022.11.06
백준 1855 암호  (0) 2022.11.03
백준 24937 SciComLove (2022)  (0) 2022.11.02

댓글