-
알고리즘 & 자료구조 스터디(10조) 4일차알고리즘 2023. 5. 25. 20:59
Q. 14916
while문 안의 n 에 주목해야 할 점이 있었으며 지역변수 전역변수 개념과 헷갈린 부분도 있어서 개념이 약한 부분을 알 수 있었다 그리디문제의 대표적 유형이라고 생각하고 기억해 놓으면 좋을 것 같다
n = int(input()) coin = [5, 2] count = 0 while n % coin[0] != 0: n -= coin[1] count += 1 if n < 0: break if n < 0: print(-1) else: count = count + n // coin[0] print(count)
Q. 1436 영화감독
생각하고 풀어보니 꽤나 쉬운문제로 in 을 통해서 판별하니깐 잘 나옴
n = int(input()) i = 0 list_2 = [] while len(list_2) < n: if '666' in str(i): list_2.append(i) i += 1 print(list_2[-1])
강의 2주차 듣는 중
해시테이블과 힙에 대한 구현을 꾸준히 해봐야 할 것 같다. 그래프는 인스타그램의 팔로우 개념을 생각하고 dnf와 bnf는 좀 더 알아보아야 할 것 같다.
level 0 8 level 1 6 3 # 1부터시작이여서 0번째에는 None level 2 4 2 1 9 #[None, 8, 6, 3, 4, 2, 1, 9]
'알고리즘' 카테고리의 다른 글
알고리즘 & 자료구조 스터디(10조) 6일차 (0) 2023.05.27 알고리즘 & 자료구조 스터디(10조) 5일차 (0) 2023.05.26 알고리즘 & 자료구조 스터디(10조) 3일차 (0) 2023.05.24 알고리즘 & 자료구조 스터디(10조) 2일차 (0) 2023.05.23 알고리즘 & 자료구조 스터디(10조) 1일차 (0) 2023.05.23