Algorithm/etc111 [파이썬] 백준 - 실랜디 [파이썬] 백준 - 실랜디 매일 조금씩 풀기 하다보니까 부족한 유형 푸는중.. 소수 (1312) - 실버5 A,B,N = map(int,input().split()) p,q = divmod(A,B) for i in range(N): p,q = divmod(q*10,B) print(p) 조건 보고 overflow 발생하는지도 고려해야할듯.. 특히 나누기 or DP 무지성 나누기 후에 접근하는게 아니라 나누는 과정에서 접근하는게 포인트 1 만들기 (1463) - 실버3 n = int(input()) count = [0 for i in range(n)] num = [i for i in range(1,n+1)] temp = dict(zip(num,count)) temp[2]=1; temp[3]=1 for i i.. 2023. 4. 20. [파이썬] 백준 - 18단계 심화2 [파이썬] 백준 - 18단계 심화2 약수 (1037) N = int(input()) a = list(map(int,input().split())) a.sort() print(a[0]*a[-1]) 인사성 밝은 곰곰이 (25192) N = int(input()) count = 0 table = {'ENTER':0} for i in range(N): a = input() if a == 'ENTER': table = {'ENTER':0} else : if a not in table : table[a] = 1 if table[a] == 1 : table[a] += 1 count += 1 print(count) 집합도 시간복잡도가 O(1)이네요. 집합으로 푸는게 좀 더 깔끔했을듯 붙임성 좋은 총총이 (26069) .. 2023. 4. 19. [파이썬] 백준 - 17단계 조합론 [파이썬] 백준 - 17단계 조합론 베라의 패션 (15439) N = int(input()) print(N*(N-1)) 녹색거탑 (24723) N = int(input()) print(2**N) 팩토리얼 (10872) N = int(input()) n = 1 if 0 2023. 4. 19. [파이썬] 백준 - 14단계 집합과 맵 [파이썬] 백준 - 14단계 집합과 맵 숫자카드 (10815) N = int(input()) card = set(map(int,input().split())) M = int(input()) compare = list(map(int,input().split())) for i in compare: if i in card: print(1,end=' ') else: print(0,end=' ') 문자열 집합 (11425) N,M = map(int,input().split()) count = 0 table = {} for i in range(N): S = input() table[S] = 0 for i in range(M): check = input() if check in table : table[check] .. 2023. 4. 18. 이전 1 ··· 23 24 25 26 27 28 다음