https://www.acmicpc.net/workbook/view/14613

https://swexpertacademy.com/main/code/problem/problemDetail.do

D1

2072. 홀수만 더하기

n = int(input())
a = [[] for _ in range(n)]
for i in range(n):
    a[i] = list(map(int,input().split()))
idx = 1
for i in a:
    r = 0
    for j in i:
        if j % 2 != 0:
            r += j
    print(f'#{idx} {r}')
    idx += 1

D2

1859. 백만 장자 프로젝트

t = int(input())
for idx in range(1,t+1):
    n = int(input())
    p = list(map(int, input().split()))
    cost = 0
    while p:
        mx = p.index(max(p))
        for i in p[:mx]:
            cost += p[mx] - i
        p = p[mx+1:]
    print(f'#{idx} {cost}')

1954. 달팽이 숫자 ⭐

t = int(input())
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
for idx in range(1,t+1):
    n = int(input())
    sn = [[0]*n for _ in range(n)]
    x, y, cnt, d = 0, 0, 1, 0
    for _ in range(n*n):
        sn[x][y] = cnt
        nx, ny = x+dx[d], y+dy[d]
        if 0<=nx<n and 0<=ny<n and sn[nx][ny] == 0: #좌표 안, 방문x
           x, y = nx, ny
        else:
            d = (d+1)%4
            x,y = x+dx[d], y+dy[d]
        cnt += 1
    print(f'#{idx}')
    for r in sn:
        print(" ".join(map(str, r)))

D3

D4

1210. Ladder1

1210. Ladder1

1249. 보급로