일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 프로그래머스
- leetcode
- 코딩테스트 준비
- 항해99
- til
- 스택
- dfs
- 큐
- softeer
- 해시
- 코딩테스트준비
- 파이썬
- 혁펜하임
- Python
- 활성화 함수
- 백준 2309
- BOJ
- 구현
- 99클럽
- boj 2309
- 기능개발
- 개발자취업
- 딥러닝
- 99항해
- 개발자 취업
- 알고리즘
- easy 딥러닝
- python 2309
- BFS
- 백준
- Today
- Total
목록코딩테스트준비 (16)
동까의 코딩
https://www.acmicpc.net/problem/17609 from sys import stdininput = stdin.readlinenum = int(input())for _ in range(num): st = input().strip() front, back = 0, len(st) - 1 check = 0 for _ in range(len(st)): if front >= back: break if st[front] == st[back]: front += 1 back -= 1 continue if st[front] == st[back-1]: ..
https://www.acmicpc.net/problem/11404 import sysINF = int(1e9)n = int(sys.stdin.readline()) m = int(sys.stdin.readline()) graph = [[INF] * (n + 1) for _ in range(n + 1)] for i in range(1, n + 1): for j in range(1, n + 1): if i == j: graph[i][j] = 0for _ in range(m): a, b, c = map(int, sys.stdin.readline().split()) graph[a][b] = min(c, graph[a][b]) for k in range(..
https://school.programmers.co.kr/learn/courses/30/lessons/92344 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(board, skill): n, m, cnt = len(board), len(board[0]), 0 accumulate_sum = [[0 for _ in range(m + 1)] for __ in range(n + 1)] for attak_type, y1, x1, y2, x2, degree in skill: val = -degree if attak_type == 1 else degree ..
https://www.acmicpc.net/problem/2151 from collections import dequeimport sysinput = sys.stdin.readlinedx = [0, 1, 0, -1]dy = [1, 0, -1, 0]def bfs(x, y, dir): q.append([x, y, dir]) c[x][y][dir] = 1 ans = [] while q: x, y, dir = q.popleft() nx = x + dx[dir] ny = y + dy[dir] if 0 c[x][y][dir]: if a[nx][ny] != '*': c[nx][ny][..
https://www.acmicpc.net/problem/2169 로봇은 아래,오른쪽,왼쪽으로만 움직이며 한번 지나친 곳은 지나가지 못함해당 row에서 한번 왼쪽으로 움직으면 왼쪽으로만, 오른쪽으로 움직이면 오른쪽으로만 움직임왼쪽으로 움직였을 경우와 오른쪽으로 움직였을 경우 두가지로 나누어 계산하면 모든 경우의 수 계산이 가능해짐r,c 지점에서의 최대 값은 윗층(r-1,c)에서 내려온 값, 왼쪽(r,c-1)에서 온 값, 오른쪽(r,c+1)에서 온 값 세가지로 분류 가능왼쪽, 오른쪽으로만 움직일 경우로 분리하고 각각의 경우에 최대값을 찾은 후 병합 import sysinput = sys.stdin.readlinedef solution(R,C,arr): for c in range(1,C): ..
https://school.programmers.co.kr/learn/courses/30/lessons/64064 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr itertools의 permutations를 사용해서 모든 경우의 수를 만들어주면서 풀이하였습니다. def solution(user_id, banned_id): answer=0 import re from itertools import permutations answers = [] for p in permutations(user_id, len(banned_id)): cnt = 0 for i in..
https://www.acmicpc.net/problem/1738 벨만포드 알고리즘에 대해 더 깊게 이해해야될 것 같다.....아직도 모르는 게 많은 것 같다. import sysINF= sys.maxsizedef bellman(start): global n distance = [-INF]*(n+1) distance[start]=0 route= [0]*(n+1) result=[] for i in range(n): for cur_node in range(1, n+1): if distance[cur_node]==-INF: continue for next_node, next_cost in graph[cur_node]: if distance[next..
https://www.acmicpc.net/problem/1022 달팽이판 구현을 위한 구글링을 하고 관련 기법에 대해 배우게 되었습니다. r1, c1, r2, c2 = map(int, input().split())arr = [[0] * (c2 - c1 + 1) for _ in range(r2 - r1 + 1)]max_num = 0def cal(r, c): bor = max(abs(r), abs(c)) default = (bor * 2 - 1) ** 2 + 1 if r == bor: return default + bor * 7 + c - 1 if c == -bor: return default + bor * 5 + r - 1 if r == -bor: ..