문제접근![](data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
놓쳤던 부분![](data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
코드![](data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
2020 KB
0 ms
#include <iostream>
using namespace std;
int main(void)
{
int price;
int n;
int a, b;
int total = 0;
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> price >> n;
for (int i = 0; i < n; i++)
{
cin >> a >> b;
total += (a * b);
}
if (price == total)
cout << "Yes";
else
cout << "No";
return (0);
}
C++
복사