일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Algorythm
- 2579
- 크롤링
- 알고리즘
- NAV
- 라즈베리파이
- Python
- springboot3.x
- 라즈비안
- 2909
- algotythm
- raspberrypi
- MongoDB
- 라즈베리파이3
- HTML
- 백준
- 파이썬
- 16.04
- node.js
- ubuntu
- dynaminprogramming
- CSS
- dp
- baekjun
- 트리
- 라즈베리파이3b+
- bootstrap
- Crawling
- nav-tab
- 13237
- Today
- Total
목록백준 (24)
노트
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")
n = int(input()) answer = 0 for i in range(n): word = input() flag = 0 for j in range(len(word)-1): if word[j] != word[j+1]: nword = word[j+1:] if word[j] in nword: flag = 1 if flag ==0: answer +=1 print(answer)