일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- HTML
- ubuntu
- 16.04
- Algorythm
- Crawling
- Python
- 트리
- 라즈비안
- bootstrap
- nav-tab
- baekjun
- 라즈베리파이3b+
- 파이썬
- 크롤링
- NAV
- raspberrypi
- 2579
- node.js
- dynaminprogramming
- algotythm
- springboot3.x
- dp
- 라즈베리파이
- 13237
- 알고리즘
- 라즈베리파이3
- 백준
- MongoDB
- CSS
- 2909
- Today
- Total
목록알고리즘 (33)
노트
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)
n=int(input()) s=[int(input()) for _ in range(n)] dp=[0]*n if len(s)
n = int(input()) tree = {} for _ in range(n): root, left, right = input().split() tree[root] = [left,right] def preorder(a): if a is not '.': print(a,end='') preorder(tree[a][0]) preorder(tree[a][1]) def inorder(a): if a is not '.': inorder(tree[a][0]) print(a,end='') inorder(tree[a][1]) def postorder(a): if a is not '.': postorder(tree[a][0]) postorder(tree[a][1]) print(a,end='') preorder('A') ..