soominkim Study
article thumbnail
728x90

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int bil = sc.nextInt();
        int many = sc.nextInt();
        
        for(int i=0; i<many; i++){
            int price = sc.nextInt();
            int count = sc.nextInt();
            
            bil = bil -(price*count);
        }
        
        if(bil == 0 ) System.out.println("Yes");
        else System.out.println("No");
    }
}
728x90

'Coding Practice > BAEKJOON - Java' 카테고리의 다른 글

[BAEKJOON] 11022번  (1) 2023.03.25
[BAEKJOON] 25314번  (0) 2023.03.22
[BAEKJOON] 2480번  (0) 2023.03.20
[BAEKJOON] 2525번  (0) 2023.03.11
[BAEKJOON] 2884번  (0) 2023.03.10
profile

soominkim Study

@soominkim

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그