일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- bootstrap
- nav-tab
- Crawling
- raspberrypi
- HTML
- Python
- 13237
- springboot3.x
- 크롤링
- 2579
- MongoDB
- CSS
- 2909
- 16.04
- 라즈베리파이3b+
- 트리
- dynaminprogramming
- 라즈베리파이3
- 알고리즘
- node.js
- dp
- 라즈베리파이
- ubuntu
- baekjun
- 백준
- NAV
- Algorythm
- algotythm
- 파이썬
- 라즈비안
- Today
- Total
목록알고리즘 (23)
노트
n = int(input()) parent = [int(input()) for _ in range(n)] high = [0 for i in range(n)] for i in range(n): if parent[i]==-1: continue high[i]=high[parent[i]-1]+1 for i in range(n): print(high[i])
c, zero = map(int, input().split()) money = int(str(1)+ "0"*zero) m = c//money n = c % money if zero==0: print(c) else: if n >= money//2: price = money*(m+1) else: price = money*m print(price)
n = int(input()) li = dict() for i in range(n): a,b = input().split() if b =='enter': li[a]=b else: del li[a] li=sorted(li.keys(),reverse=True) for i in li: print(i)
n = int(input()) dasom = int(input()) vote = [] count = 0 for _ in range(n - 1): vote.append(int(input())) vote.sort(reverse=True) if n == 1: print(0) else: while vote[0] >= dasom: dasom += 1 vote[0] -= 1 count += 1 vote.sort(reverse=True) print(count)
n = int(input()) time = list(map(int,input().split())) time = sorted(time) for i in range(1,n): time[i] = time[i]+time[i-1] print(sum(time))
import sys sys.setrecursionlimit(10 ** 6) n,m = map(int,sys.stdin.readline().split()) array = [list(map(int,sys.stdin.readline().strip())) for _ in range(n)] visted = [[False]*m for _ in range(n)] d = [[1,0],[0,1],[-1,0],[0,-1]] def dfs(r,c): global flag if r>=n: flag=True if 0
n=int(input()) bot=[] cur=0 for i in range(n): a, b=map(int, input().split()) bot.append([a, b]) cur+=bot[0][1] i=1 while i=bot[i][1]: i+=1 else: cur+=(bot[i][1]-cur%(bot[i][0]+bot[i][1])-1) print(cur+1)