일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 디피
- 메모이제이션
- 영어말하기
- 다이나믹프로그래밍
- 영어회화
- 오픽공부법
- 오픽점수잘받는방법
- stack 스택
- 안드로이드주석
- dp
- XML
- 주석
- 오픽
- 바텀업
- 오픽가격
- 오픽노잼
- 안드로이드
- English
- dynamicProgramming
- ㅂ
- 탑다운
- fibo
- 이진탐색 #나무 자르기
- opic
- 오픽노잼공부방법
- 이진탐색
- topdown
- 피보나치수열
- XML주석
목록분류 전체보기 (298)
RUBY
출처:: https://www.acmicpc.net/problem/1919 분류:: 문자열 1. 문제 이해 및 해결과정 - 공통 문자 이외를 지워야함 dared { 'a' : 1, , 'd' : 2, 'e' : 1, 'r' : 1} bread { 'a' : 1, ' b' : 1 , 'd' : 1, 'e' : 1, 'r' : 1} => 2 (b 와 d의 차이) 2. 풀이방법 1) python counter 함수 이용하기 import sys from collections import Counter a = input() b = input() countA = Counter(a) countB = Counter(b) ans1 = countA - countB ans2 = countB - countA ans = ans..
출처:: https://www.acmicpc.net/problem/1157 분류::문자열 1. 문제 이해 및 해결과정 2. 풀이방법 1) 아스키코드 이용, chr() alpha = [ 0 for i in range(26)] a = input() for i in a : alpha[ord(i.lower()) - 97] +=1 max = -1 maxindex = -1 maxcnt= 0 for i in range(26): if alpha[i] > max: max = alpha[i] maxindex = i for i in range(26): if alpha[i] == max: maxcnt += 1 if maxcnt > 1 : print("?") else : print(chr(maxindex+97).upper())..
출처:: https://www.acmicpc.net/problem/2744 분류::문자열 1. 문제 이해 및 해결과정 2. 풀이방법 1)python s = input() ans = "" for ch in s: if ch.isupper(): #대문자라면, 소문자로 ans += ch.lower() else : #소문자라면, 대문자로 ans += ch.upper() #ans += ch.lower() if ch.isupper() else ch.upper() print(ans) 2) python print(input().swapcase()) 3. 오답원인 4. 알게된 점 1) islower() : 소문자인지여부 2) upper() : 대문자로 변경 3) swapcase() : 대소문자 변경
출처:: https://school.programmers.co.kr/learn/courses/30/lessons/1844?language=python3 분류:: BFS 1. 문제 이해 및 해결과정 2. 풀이방법 1) python BFS from collections import deque def solution(maps): dh=[-1,0,1,0] #시계방향 dw=[0,1,0,-1] h=len(maps) w=len(maps[0]) Q=deque() Q.append((0,0)) while Q: cur=Q.popleft() for i in range(4): nh=cur[0]+dh[i] nw=cur[1]+dw[i] if 0
출처::https://www.acmicpc.net/problem/2178 1. 문제 이해 및 해결과정 -BFS 2. 풀이방법 1. pair 와 queue이용해서 푸는 것 -visited배열로 값을 바꾸면서 푸는 방법 #if 0 //미로탐색 //https://www.acmicpc.net/problem/2178 #include #include #include using namespace std; int N, M;//세로, 가로 int map[100 + 10][100 + 10]; int visited[100 + 10][100 + 10]; int dh[] = { -1,1,0,0 }; //상하좌우 int dw[] = { 0,0,-1,1 }; int BFS() { //1.초기화 queue q; //2.시작점 저장 ..
출처:: https://school.programmers.co.kr/learn/courses/30/lessons/86491 분류:: 완전탐색 1. 문제 이해 및 해결과정 1) 완전탐색 - 50 60, 30 70, 30 60 . 40 80 -> (x,y) xy: arr.append([y,x]) else: arr.append([x,y]) for x, y in arr: if x> maxx: maxx=x if y> maxy: maxy = y return maxx*maxy 3. 오답원인 4. 알게된 점
출처:: https://school.programmers.co.kr/learn/courses/30/lessons/42748 분류:: 정렬 1. 문제 이해 및 해결과정 2. 풀이방법 def solution(array, commands): answer = [] for i,j,k in commands : tmp = array[i-1:j] tmp.sort() answer.append(tmp[k-1]) return answer 3. 오답원인 4. 알게된 점
출처:: https://school.programmers.co.kr/learn/courses/30/lessons/42746 분류:: 정렬 1. 문제 이해 및 해결과정 숫자의 최댓값이 1000이기 때문에 숫자를 문자열로 보고 3배 늘리면 문자열 정렬을 통해 숫자의 크기를 쉽게 비교할 수 있다. ex) 3, 910, 10 -> (3배 문자열 늘림) 333, 910910910, 101010 -> (문자열 기준 정렬 시) 910 > 3 > 10 또한, 최종 결과는 str로만 출력하면 안된다. 만약, 0 0 0 이 있으면 문자열은 000으로 반환하기 때문에 int 로 변경 후 다시 str로 출력해야한다. 2. 풀이방법 def solution(numbers): numbers_str = list(map(str,num..