๋ฐ์ํ
import java.util.Scanner;
// 25304 ์์์ฆ
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum = sc.nextInt();
int num = sc.nextInt();
int itemPrice = 0;
for (int i=0; i < num; i++) {
int price = sc.nextInt();
int item = sc.nextInt();
itemPrice += price*item;
}
sc.close();
System.out.print(sum == itemPrice ? "Yes" : "No");
}
}
๋ฐ์ํ
'๐ธ Algorithm > ๐ธ ๋ฐฑ์ค BaekJoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][java][15552][๋น ๋ฅธ A+B] (1) | 2023.10.08 |
---|---|
[๋ฐฑ์ค][java][25314][์ฝ๋ฉ์ ์ฒด์ก๊ณผ๋ชฉ ์ ๋๋ค] (0) | 2023.10.03 |
[๋ฐฑ์ค][java][8393][ํฉ] (0) | 2023.10.03 |
[๋ฐฑ์ค][java][10950][A+B - 3] (0) | 2023.10.01 |
[๋ฐฑ์ค][java][2739][๊ตฌ๊ตฌ๋จ] (0) | 2023.10.01 |