분류 전체보기439 python machine learning chapter2 2018. 9. 27. 백준 11050번 파이썬 a,b = map(int, input().split())sum=1for i in range(b): sum = sum*a a -= 1for i in range(2,b+1): sum = sum // iprint(sum) 2018. 9. 24. 백준 1003번 파이썬 def fibonacci(n): count_0=[1,0,1] count_1=[0,1,1] if n==0 or n==1: print(count_0[n],count_1[n]) else: for i in range(3,n+1): count_0.append(count_0[i-1]+count_0[i-2]) count_1.append(count_1[i-1]+count_1[i-2]) print(count_0[n],count_1[n])for i in range(int(input())): fibonacci(int(input())) 2018. 9. 24. 백준 2749 파이썬 mod = 1000000p = mod//10*15num = int(input())list = [0,1]for i in range(2,p): list.append(list[i-1]+list[i-2]) list[i] = list[i]%modprint(list[num%p]) 2018. 9. 24. 이전 1 ··· 96 97 98 99 100 101 102 ··· 110 다음