-
25304 합,곱코테 대비 python/백준 2023. 1. 30. 19:18
https://www.acmicpc.net/problem/25304
#총금액 x #구매한 물건의 종류의 수 n #각 물건의 가격 a와 개수 b 가 공백을 사이에 두고 주어짐 total = int(input()) n= int(input()) def multiple(a,b): c=a*b return c def check(t,d): if t==d: return print("Yes") else: return print("No") result =0 for _ in range(n): A,B = map(int,input().split()) result+=multiple(A,B) #result+=A*B check(total,result)
출력에 YES라고 해서 엄청 오래걸렸다..
꼼꼼하게 살피자
'코테 대비 python > 백준' 카테고리의 다른 글
11021 맨날까먹는 print안에 f사용법 (0) 2023.01.30 15552 import sys (0) 2023.01.30 8393 1~n 합 (0) 2023.01.30 10950 함수만들기 (0) 2023.01.30 21315 완전탐색 블루트포스 ==> 다시풀기 (0) 2023.01.27