전체 글

공부와 경험의 기록!
·Algorithm (PS)
https://programmers.co.kr/learn/courses/30/lessons/42576 코딩테스트 연습 - 완주하지 못한 선수 수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수 programmers.co.kr 오랜만에 해시 유형을 풀어보았다 !! 오랜만이라서 딕셔너리 쓰는 방법을 까먹었다,,, i ) key 로 value 가져오기 : get() Python 에서 key를 이용하여 딕셔너리의 value를 가져오려면 get() 함수를 사용하면 된다. 그런데 아주 편리한 점은, get(key값, default값) 현재 key 가 딕셔너리에 없으면 def..
·Algorithm (PS)
https://www.acmicpc.net/problem/2448 2448번: 별 찍기 - 11 첫째 줄에 N이 주어진다. N은 항상 3×2k 수이다. (3, 6, 12, 24, 48, ...) (0 ≤ k ≤ 10, k는 정수) www.acmicpc.net 1. 우선 graph의 원소들을 초기화 한다 ! 2. 나는 n ==3 이면 가장 기본 모양의 삼각형이므로, n==3 이면 별 모양을 넣어주는 걸로 풀었다 n==3일때의 삼각형 모양이 반복되어 만들어지기 때문이다 !! 3. n==3 일때 별을 찍고, 이 모양이 반복되므로, x좌표와 y좌표값을 찾아서 반복해 주면 되는데, 그것이 star 함수를 재귀 호출 한 부분이다 왼쪽 아래 부분, 오른쪽 아래 부분, 그리고 현재 x,y 부분을 나눠서 별을 찍는다고 ..
·Algorithm (PS)
data = list(map(int, input())) data.sort(reverse=True) print("".join(map(str, data))) 그냥 쉬어가는 차원에서 풀어봄
What is the OOP ? : OOP is the creation of objects that has both data and functions. What is the principle of OOP ? : Abstraction, Encapsulation, Inheritance and Polymorphism. What is an Object ? Objects has data and instructions to act on that data. What is class ? : Class is like a template. Blueprint for an object. It is a user-defined data type, which holds its own data members and member fu..
editer(source code) -> source file --(compiler)--> object file ---(linker)--> execute file ---> RUN source code : high level language what compiler's do ? - preprocess : #define variables save , ignores comments - compile : preprocessed code to assembly code - assembler : assembly code to binary code (= machine code that hardware can understand) what linker's do? - link library and object file -..
·Algorithm (PS)
https://www.acmicpc.net/problem/2225 2225번: 합분해 첫째 줄에 답을 1,000,000,000으로 나눈 나머지를 출력한다. www.acmicpc.net 짜잔 이렇게 dp 테이블을 그려서 dp[i][j] = dp[i-1][j] + dp[i][j-1] 라는 점화식을 도출해내면 끝이다 단 i -1 > 0, j -1> 0 이어야 하므로 i, j 는 각각 2이상이어야 한다 !! 그러기 위해서는 dp[?][1] 은 n (자기자신) 값으로 초기화 해주어야 하고 dp[1][?] 는 1로 초기화해주어야 한다 # 2225 합분해 n, k = map(int, input().split()) dp = [[0] * 201 for _ in range(201)] for i in range(1, 201..
·Algorithm (PS)
BFS로 최단거리를 구하면 되는 문제이다. https://www.acmicpc.net/problem/2178 2178번: 미로 탐색 첫째 줄에 두 정수 N, M(2 ≤ N, M ≤ 100)이 주어진다. 다음 N개의 줄에는 M개의 정수로 미로가 주어진다. 각각의 수들은 붙어서 입력으로 주어진다. www.acmicpc.net 부수면서 이동하기 문제의 쉬운 버전이다 ㅎㅎ 이제 이런 간단한 그래프 문제는 한번 시도만에 바로 맞다니 ㅠㅠ 감격스러운걸...! from collections import deque n, m = map(int, input().split()) graph = [] for i in range(n): graph.append(list(map(int, input()))) dx = [-1, 1, 0..
1. Compiled Languages Example : C, C++, Swift, Go Compiled on OS directly. => They needed to be compiled to transform the source code to Machine code that CPU can execute. After the compilation, we need to build compiled file like EXE type to execute the source code. Good Point : Very fast -> They are good to deal with the data Bad Point : They need different compiler by each OS (Swift is compil..
minjiwoo
MJ workspace