2025/04/08 3

[백준][9단계 약수,배수와 소수] 9506번 /약수들의 합 (파이썬/Python)

1. 문제 설명2. 코드test_cases = [] while True:     n = int(input())     if n == -1:         break     test_cases.append(n) for n in test_cases:     divisors = []     for i in range(1,n):         if n % i == 0:             divisors.append(i)     if sum(divisors) == n:         print(f"{n} = {' + '.join(map(str, divisors))}")     else:         print(f"{n} is NOT perfect.")3. 풀이 과정test_cases에 테스트할 숫자들을 저장..

[노잼오픽 IM시리즈] 16. IM2 받았다고 기뻐하지 마세요

필러를 쓴 답변과 쓰지 않은 답변의 차이완벽하게 준비된 답변을 로봇처럼 쏟아내는 것보다는 즉석에서 생각난 답변을 말하는 것에 더 높은 점수를 준다.시작에는 생각을 하고 끝에서는 부드럽게 마무리하자답변의 시작 추천 표현It's quite a tough question.Thats tough.I didn't expect such a hard question.Thats not an easy question.+ Wow : 더 자연스러워짐Wow, It's quite a tough question.Wow,  Thats tough.Wow,  I didn't expect such a hard question.Wow,  Thats not an easy question.알아두면 좋은 필러You konw,어려운 단어를 어색하..

자격증/OPic 2025.04.08

[프로그래머스] [스택/큐] Lv.2 /프로세스 (파이썬/Python)

1. 문제 설명2. 코드 from collections import deque def solution(priorities, location):     queue = deque([(p, idx) for idx, p in enumerate(priorities)])     count = 0          while queue:         current = queue.popleft()         if any(x[0] > current[0] for x in queue):             queue.append(current)         else:             count += 1             if current[1] == location:                 return..