Recent Posts
Notice
No Rules Rules
영수증 (feat. 백준, 25304번) 본문
728x90
반응형
영수증
https://www.acmicpc.net/problem/25304
25304번: 영수증
준원이는 저번 주에 살면서 처음으로 코스트코를 가 봤다. 정말 멋졌다. 그런데, 몇 개 담지도 않았는데 수상하게 높은 금액이 나오는 것이다! 준원이는 영수증을 보면서 정확하게 계산된 것
www.acmicpc.net
반응형
// woohyeon.kim
// kim519620.tistory.com
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(NULL);
register int X, N, sum = 0;
cin >> X >> N;
for (register int n = 1, a, b; n <= N; ++n)
cin >> a >> b, sum += a * b;
if (X == sum)
cout << "Yes";
else
cout << "No";
return 0;
}
// *&)*@*
문제로 주어진 X와 a, b간 곱의 합이 같은지를 비교하는 문제입니다.
728x90
반응형
'생활 > 코테' 카테고리의 다른 글
A+B - 7 (feat. 백준, 11021번) (0) | 2022.08.10 |
---|---|
빠른 A+B (feat. 백준, 15552번) (0) | 2022.08.10 |
합 (feat. 백준, 8393번) (0) | 2022.08.09 |
A+B - 3 (feat. 백준, 10950번) (0) | 2022.08.09 |
구구단 (feat. 백준, 2739번) (0) | 2022.08.09 |
Comments