일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 라즈비안
- 13237
- MongoDB
- dynaminprogramming
- dp
- NAV
- nav-tab
- 2579
- Algorythm
- 라즈베리파이3b+
- algotythm
- 라즈베리파이
- 트리
- baekjun
- Crawling
- 라즈베리파이3
- 백준
- springboot3.x
- 알고리즘
- 2909
- HTML
- raspberrypi
- bootstrap
- CSS
- 크롤링
- ubuntu
- 16.04
- node.js
- Python
- 파이썬
- Today
- Total
목록분류 전체보기 (49)
노트
n = int(input()) a,b = map(int,input().split()) m = int(input()) relation = [[0]*101 for _ in range(101)] visited = [0]*101 q = [] for i in range(m): x,y = map(int,input().split()) relation[x][y]=relation[y][x]=1 def dfs(): visited[a]=1 q.append(a) while q: k = q.pop(0) if k==b: return for j in range(1,n+1): if relation[k][j]==1 and visited[j]==0: visited[j]=visited[k]+1 q.append(j) dfs() if vis..
n, k = map(int, input().split()) kit = list(map(int, input().split())) used = [0] * n ans = 0 def dfs(a, weight): global ans if weight = n: ans += 1 return for i in range(n): if used[i] == 0: used[i] = 1 dfs(a + 1, weight + kit[i] - k) used[i] = 0 dfs(0, 500) print(ans)
import sys sys.setrecursionlimit(10 ** 6) a,b = map(int,input().split()) boss = list(map(int,input().split())) gujo = [[] for _ in range(a)] my_boss = [0]*(a+1) ans = [0]*(a+1) for i in range(1,a): if boss[i]!=-1: gujo[boss[i]].append(i+1) my_boss[i+1]=boss[i] def tamsaek(k): ans[k] += ans[my_boss[k]] if k
n = int(input()) ans = 0 for _ in range(n): a = int(input()) ans+=a print(ans) 그냥 덧셈문제,,
n = int(input()) s = input() ans = 'NO' for i in range(1,n): a = s[:i] b = s[n-i:] cnt=0 for j in range(len(a)): if a[j]!=b[j]: cnt+=1 if cnt==1: ans='YES' break print(ans)
자꾸 시간초과가 나서 readline 추가 import sys input = sys.stdin.readline n = int(input()) hw = [] final_score = 0 idx = 0 for _ in range(n): line = list(map(int,input().split())) if line[0]==1: if line[2]-1==0: final_score += line[1] else: hw.append([line[1],line[2]-1]) idx += 1 else: if len(hw)>0: hw[idx-1][1] -= 1 if hw[idx-1][1]==0: score, time = hw.pop() final_score+=score idx -= 1 print(final_score)
word = input() alpha = ['c=','c-','dz=','d-','lj','nj','s=','z='] for j in alpha: word = word.replace(j, '@') print(len(word))
n = int(input()) line = list(map(int,input().split())) passed = [] stack = [] number = 1 while line: temp = line.pop(0) if temp==number: passed.append(temp) number+=1 else: stack.insert(0,temp) while stack: num = stack.pop(0) if len(stack)+1>=0 and num==number: passed.append(num) number+=1 else: stack.insert(0,num) break if not stack: print("Nice") else: print("Sad")