일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- RTK Query
- Promise
- app router
- 공변성
- webpack
- Jest
- tailwind
- TS
- recoil
- async/await
- 태그된 유니온
- ESlint
- dfs
- map
- 무한 스크롤
- SSR
- 이분 검색
- 인터섹션
- CI/CD
- 결정 알고리즘
- Cypress
- 리터럴 타입
- 호이스팅
- 반공변성
- React
- CORS
- 타입 좁히기
- 투포인터
- autosize
- useAppDispatch
- Today
- Total
목록전체 글 (510)
짧은코딩
https://www.acmicpc.net/problem/1302 1302번: 베스트셀러 첫째 줄에 오늘 하루 동안 팔린 책의 개수 N이 주어진다. 이 값은 1,000보다 작거나 같은 자연수이다. 둘째부터 N개의 줄에 책의 제목이 입력으로 들어온다. 책의 제목의 길이는 50보다 작거나 같고 www.acmicpc.net 내 풀이(맞음) n = int(input()) dic = {} for i in range(n): x = input() if x in dic: dic[x] += 1 else: dic[x] = 1 ary = sorted(dic.items(), key = lambda x:x[1], reverse = True) t = ary[0][1] rst = [ary[0][0]] for i in range(1..
https://www.acmicpc.net/problem/11652 11652번: 카드 준규는 숫자 카드 N장을 가지고 있다. 숫자 카드에는 정수가 하나 적혀있는데, 적혀있는 수는 -262보다 크거나 같고, 262보다 작거나 같다. 준규가 가지고 있는 카드가 주어졌을 때, 가장 많이 가지 www.acmicpc.net 내 풀이(맞음) n = int(input()) dic = {} for i in range(n): x = int(input()) if x in dic: dic[x] += 1 else: dic[x] = 1 ary = sorted(dic.items(), key=lambda x: x[1], reverse = True) t = ary[0][1] rst = [ary[0][0]] for i in rang..
https://www.acmicpc.net/problem/1021 1021번: 회전하는 큐 첫째 줄에 큐의 크기 N과 뽑아내려고 하는 수의 개수 M이 주어진다. N은 50보다 작거나 같은 자연수이고, M은 N보다 작거나 같은 자연수이다. 둘째 줄에는 지민이가 뽑아내려고 하는 수의 위치가 www.acmicpc.net 내 풀이(맞음) from collections import deque n, m = map(int, input().split()) ary = list(map(int, input().split())) num = deque() for i in range(n): num.append(i+1) l = 0 id = 0 count = 0 while(True): if ary[l] == num[0]: num.p..
https://www.acmicpc.net/problem/17413 17413번: 단어 뒤집기 2 문자열 S가 주어졌을 때, 이 문자열에서 단어만 뒤집으려고 한다. 먼저, 문자열 S는 아래와과 같은 규칙을 지킨다. 알파벳 소문자('a'-'z'), 숫자('0'-'9'), 공백(' '), 특수 문자('')로만 이루어져 www.acmicpc.net 내 풀이(맞음) x = input() ary = '' rst = '' for i in range(len(x)): if x[i] == '
https://www.acmicpc.net/problem/9375 9375번: 패션왕 신해빈 첫 번째 테스트 케이스는 headgear에 해당하는 의상이 hat, turban이며 eyewear에 해당하는 의상이 sunglasses이므로 (hat), (turban), (sunglasses), (hat,sunglasses), (turban,sunglasses)로 총 5가지 이다. www.acmicpc.net 내 풀이(구글링해서 힌트보고 맞춤) t = int(input()) rst = [] for i in range(t): n = int(input()) ary = [] for j in range(n): x = input().split() for k in range(len(ary)): if ary[k][0] ==..
https://www.acmicpc.net/problem/11286 11286번: 절댓값 힙 첫째 줄에 연산의 개수 N(1≤N≤100,000)이 주어진다. 다음 N개의 줄에는 연산에 대한 정보를 나타내는 정수 x가 주어진다. 만약 x가 0이 아니라면 배열에 x라는 값을 넣는(추가하는) 연산이고, x가 0 www.acmicpc.net 내 풀이(잘모르겠어서 구글링했지만 생각보다 단순해서 허무) import heapq heap = [] rst = [] n = int(input()) for i in range(n): x = int(input()) if x != 0: heapq.heappush(heap, (abs(x), x)) elif len(heap) == 0: rst.append(0) else: t = hea..
https://www.acmicpc.net/problem/1874 1874번: 스택 수열 1부터 n까지에 수에 대해 차례로 [push, push, push, push, pop, pop, push, push, pop, push, push, pop, pop, pop, pop, pop] 연산을 수행하면 수열 [4, 3, 6, 8, 7, 5, 2, 1]을 얻을 수 있다. www.acmicpc.net 내 풀이(맞음) n = int(input()) ary = [] for i in range(n): x = int(input()) ary.append(x) lst = [] rst = [] i = 0#ary j = 1#rst while(True): if lst and lst[-1] == ary[i]: rst.append(..
https://www.acmicpc.net/problem/1764 1764번: 듣보잡 첫째 줄에 듣도 못한 사람의 수 N, 보도 못한 사람의 수 M이 주어진다. 이어서 둘째 줄부터 N개의 줄에 걸쳐 듣도 못한 사람의 이름과, N+2째 줄부터 보도 못한 사람의 이름이 순서대로 주어진다. www.acmicpc.net 내 풀이(맞음) n, m = map(int, input().split()) dic = {} count = 0 for i in range(n+m): x = input() if i < n: dic[x] = 0 else: if x in dic: dic[x] = 1 count += 1 print(count) rst = [] for i in dic: if dic[i] == 1: rst.append(i) ..
https://www.acmicpc.net/problem/10799 10799번: 쇠막대기 여러 개의 쇠막대기를 레이저로 절단하려고 한다. 효율적인 작업을 위해서 쇠막대기를 아래에서 위로 겹쳐 놓고, 레이저를 위에서 수직으로 발사하여 쇠막대기들을 자른다. 쇠막대기와 레이저 www.acmicpc.net 내 풀이(맞음) x = input() x = x.replace('()', '1') ary = [] sum = 0 for i in range(len(x)): if x[i] == '1' and len(ary) == 0: continue elif x[i] == '1': for j in range(len(ary)): ary[j] += 1 elif x[i] == '(': ary.append(0) elif x[i] =..
https://www.acmicpc.net/problem/1966 1966번: 프린터 큐 여러분도 알다시피 여러분의 프린터 기기는 여러분이 인쇄하고자 하는 문서를 인쇄 명령을 받은 ‘순서대로’, 즉 먼저 요청된 것을 먼저 인쇄한다. 여러 개의 문서가 쌓인다면 Queue 자료구조에 www.acmicpc.net 내 풀이(맞음) from collections import deque t = int(input()) rst = [] for i in range(t): ary = deque() n, m = map(int, input().split()) x = input().split() for j in range(n): ary.append([]) ary[j].append(int(x[j])) ary[j].append(j..