본문 바로가기
알고리즘

[BAEKJOON] 31450 Everyone is a winner

by mAlfred 2025. 8. 20.
반응형

문제

Your friend is a kindergarten teacher. Since the Olympic Games in Paris are approaching, he wants to teach the kids about different aspects of sports competitions. As part of this idea, he plans to have one day when kids receive medals for their behaviour in kindergarten. For example, he would give out a medal for the kid who shares their toys the most, or for the kid who encourages their playmates most creatively. To ensure kids are not offended at the end of the day, the teacher wants no kid to get fewer medals than another. The teacher tells you the number of medals he prepared and the number of kids, and he asks you to say whether it is possible to give out all of these medals to the kids so that they each get the same number of medals.

입력

The input consists of one line. This line contains two space-separated integers  and :  is the number of medals and  is the number of kids.

출력

The output should contain a single line, consisting of a word: the word Yes if it is possible to give out all  medals to the  kids so that each kid gets the same number of medals, or the word No otherwise.

제한

예제 입력 1 

6 3

예제 출력 1 

Yes

예제 입력 2 

5 3

예제 출력 2 

No

그냥 나머지 연산

 

문제 컨셉이 그냥 전체 다 갯수 동일하게 나눠 줄 수 있는지 물어보는 문제였음

영어라 먼 소린가 했다..

 

나머지 연산자, 삼항 연산자 사용

 

m, k = map(int, input().split())

print("Yes" if m % k == 0 else "No")
반응형

'알고리즘' 카테고리의 다른 글

[BAEKJOON] 28691 정보보호학부 동아리 소개  (1) 2025.08.28
[BAEKJOON] 32905 RACI  (0) 2025.08.23
[BAEKJOON] 27855 Cornhole  (0) 2025.07.22
[BAEKJOON] 14935 FA  (0) 2025.07.16
[BAEKJOON] 2839 설탕 배달  (1) 2025.07.12