import sys from collections import deque input = sys.stdin.readline T = int(input().rstrip()) for i in range(T): k = int(input().rstrip()) n = int(input().rstrip()) people = [i for i in range(1, n+1)] # 0์ธต # 1์ธต 3ํธ 6๋ช 2์ธต์ 3ํธ 10๋ช for j in range(k): apt = [] for l in range(n): apt.append(sum(people[:l+1])) people = apt.copy() print(people) print(people[-1])
import sys from collections import deque input = sys.stdin.readline N, K = map(int, input().rstrip().split()) P = list(input().rstrip().split()) visited = set("".join(P)) q = deque([["".join(P),0]]) ans = -1 while(q): word, cnt = q.popleft() # ๋จ์ด, ๋จ์ด๋ฅผ ๋ฐ๊พผ ํ์ tmpP = list(word) if tmpP == sorted(tmpP): ans = cnt break isFrist = False for i in range(N-K+1): newP = list(tmpP) targetP = newP[i:i+K] ta..
https://www.acmicpc.net/problem/1012 #DFS ํ์ด import sys from collections import deque sys.setrecursionlimit(1000000) def DFS(x, y): dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] for i in range(4): nowx = x + dx[i] nowy = y + dy[i] if (0
ํ๋ก๊ทธ๋๋จธ์ค ์ธ๊ณต์ง๋ฅ ๋ฐ๋ธ์ฝ์ค ์ฝํ def solution(seat): seat.sort() length = len(seat) dp = [0] * length target = None for i in range(length): if seat[i] != target: dp[i] = 1 target = seat[i] else: continue return sum(dp)
[WHERE] + ์กฐ๊ฑด๋ฌธ SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION != 'Aged' ๊ฐ์ ์กฐ๊ฑด๋ฌธ ๊ฒ์ฌ๋ == ๊ฐ ์๋ =๋ฅผ ์ด๋ค! SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION = 'Sick' [ORDER BY] ์ด๋ฆ๊ธฐ์ค ์ ๋ ฌ, ์ด๋ฆ์ด ๊ฐ์ ๊ฒฝ์ฐ ๋์ค์ ๋ณดํธํ ๊ธฐ๊ฐ ์ ๋๋ก ์ ๋ ฌ SELECT ANIMAL_ID, NAME, DATETIME FROM ANIMAL_INS ORDER BY NAME ASC, DATETIME DESC ์ญ์ ์ ๋ ฌํ๊ธฐ → DESC ์ฌ์ฉ SELECT NAME, DATETIME FROM ANIMAL_INS ORDER BY ANIMAL_ID DESC DATE..
์ฌ๊ท๋ฅผ ์ด์ฉํ DFS๋ก ํ์๋๋ฐ ํธ์ถ ๋ถ๋ถ์ด ์ดํด๊ฐ ์ ์๋จ ใ ๋ค์ ๋ด์ผ๊ฒ ์ import sys sys.setrecursionlimit(1000000) def solution(numbers, target): n = len(numbers) cnt = 0 def DFS(index, sum): if index == n: if sum == target: nonlocal cnt cnt+=1 return else: DFS(index+1, sum+numbers[index]) DFS(index+1, sum-numbers[index]) DFS(0,0) return cnt
from itertools import combinations def solution(nums): cnt = 0 arr = list(map(sum, combinations(nums, 3))) for i in arr: flag = 0 for j in range(2, int(i ** 0.5)+1): if i % j == 0: flag = 1 break if flag == 0: cnt += 1 return cnt
์ฌ๋ฐฉ๋ฉด์ ๊ฐ์ ์๊น ์๋์ง ๊ฒ์ฌ DFS ๊ทธ๋ฅ DFS ‘R’์ ‘G’๋ก ๋ฐ๊พธ๊ณ DFS ํ๋ฒ ๋ import sys from collections import deque sys.setrecursionlimit(1000000) input = sys.stdin.readline def DFS(x, y): dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] visited[y][x] = 1 for i in range(4): nowx, nowy = x+dx[i], y+dy[i] if 0
- 2606 ์ ์ญ๋ณ์๋ฅผ ์ฌ์ฉํด์ cnt๊ฐ์ ์ฒดํฌํ๋๋ผ ์ ๋จน์๋๋ฐ ๊ตณ์ด ๊ทธ๋ด ํ์๊ฐ ์์๋ค ์ด์ฐจํผ ๋ฐฉ๋ฌธํ ๊ฐ์ visited์ ์ ์ฅํ๊ธฐ ๋๋ฌธ์ sum(visited) -1 ํด์ฃผ๋ฉด ๋๋ ๊ฒ! *์๊ฐ์ ์ ํ ์๊ฐ์ ๋ฐ์!! import sys from collections import deque input = sys.stdin.readline N = int(input().rstrip()) M = int(input().rstrip()) graph = [[0]*(N+1) for i in range(N+1)] visited = [0]*(N+1) for i in range(M): n1, n2 = map(int, input().rstrip().split()) graph[n1][n2] = graph[n2][n1] = 1..
- Total
- Today
- Yesterday
- Aimers
- ์ปดํจํฐ๋น์
- 2d-gs
- Gaussian Splatting
- ๋ ผ๋ฌธ์ฝ๊ธฐ
- dreambooth
- SKTECHSUMMIT
- ํ์ด์ฌ์ฝํ
- ํ์ด์ฌ
- ํ๋ก๊ทธ๋๋จธ์ค
- ํ ํฌ์๋ฐ
- 3d-gs
- SQL
- CLOVAX
- gan
- AIRUSH2023
- C์ธ์ด
- lgaimers
- AI์ปจํผ๋ฐ์ค
- gs๋ ผ๋ฌธ
- ์ฝํ ์ค๋น
- Paper review
- ์ฝ๋ฉ์๋ฌ
- AIRUSH
- ๋ ผ๋ฌธ๋ฆฌ๋ทฐ
- ๋ ผ๋ฌธ
- MYSQL
- ๋๋ฆผ๋ถ์ค
- ์ฝ๋ฉ๊ณต๋ถ
- ์คํ ์ด๋ธ๋ํจ์
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |