https://www.acmicpc.net/problem/25304
const fs = require('fs');
const input = fs.readFileSync('/dev/stdin').toString().split('\n');
const total = Number(input[0]);
const number = Number(input[1]);
let add = 0;
for(let i = 0 ; i < number; i++) {
const [price, n] = input[i+2].split(" ");
add += Number(price) * Number(n);
}
if(add === total) console.log('Yes');
else console.log("No");
728x90
'Algorithm&CodingTest > Baekjoon' 카테고리의 다른 글
[Baekjoon] [4344] 평균은 넘겠지 (0) | 2023.02.09 |
---|---|
[Baekjoon] [2941] 크로아티아 알파벳 (0) | 2023.02.09 |
[Baekjoon] [10926] ??! (0) | 2023.02.09 |
[Baekjoon] [18108] 1998년생인 내가 태국에서는 2541년생?! (0) | 2023.02.09 |
[Baekjoon] [1110] 더하기 사이클 (0) | 2023.02.09 |