최대 1 분 소요

1. 문제Permalink

[Bronze III] 0 = not cute / 1 = cute - 10886Permalink

문제 링크

성능 요약Permalink

메모리: 30840 KB, 시간: 68 ms

분류Permalink

사칙연산(arithmetic), 구현(implementation), 수학(math)

출처: 백준, https://https://www.acmicpc.net/

2. 해결방법 시간복잡도Permalink

  1. 단순 코딩 O(N)

3. 문제 해결 및 코드Permalink


import sys
T = int(sys.stdin.readline())
result = []
for _ in range(T):
result.append(str(input()))
if result.count("0") > result.count("1"):
print("Junhee is not cute!")
else:
print("Junhee is cute!")
view raw 10886.py hosted with ❤ by GitHub
  • 주석을 참고하면서 이해를 돕습니다.Permalink

4. 알고리즘 및 해설Permalink

  1. 준희의 귀여움을 판단하는 문제로 굉장히 중요하다.
  2. 반복문을 통해 해당 결과값에 문자열을 삽입한다.
  3. 이후 count() 함수를 통해 리스트내의 0과 1의 개수를 if문을 통해 경우에 따라 출력한다.

5. 짚고 넘어가기Permalink

  1. count() 함수를 통해 리스트의 문자열을 세는 것이 중요하다.