일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Daemon
- ecole42
- 데이터중심애플리케이션설계
- Born2beroot #42
- 42
- pipex
- Spring-Boot
- 네스트JS
- Spring
- docker
- data-root
- django #ninja #django-ninja #장고
- nestjs
- 42Seoul
- dockerd
- Today
- Total
목록전체 글 (95)
혼자 정리
1장 깨끗한 코드 코드는 사라지지 않는다 시간이 갈수록 프로그래밍 언어에서 추상화 수준은 점차 높아질 것으로 예상. ex) DSL(Domain Specific Language) : 도메인 특화 언어로 특정 문제를 해결하기 위해 만든 프로그래밍 언어나 명세 언어 But, 기계에게 요구사항을 이해시키려면 어느 수준에서는 하나하나 상세한 요구사항을 알려줘야 한다. → 코드는 요구사항을 표현하는 언어, 기계를 원하는 목적으로 작동하게 하려면 어느 순간에는 상세한 요구사항(명확한 코드)이 필요 나쁜 코드 당장 돌아가는 코드를 짜는 것에 급급하면 나중에 프로그램 유지/보수에 분명 큰 어려움을 만들게 된다. "지금은 일단 돌아가게 하고 나중에 고치자.." → 지금 짠 코드를 나중에 고칠 시간은 오지 않는다. 코드를 ..

문제링크 C++ #include #include #include using namespace std; int T, k; int check[1000001]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> T; for (int i = 0; i > n; for (int i = 0; i > chartmp >> inttmp; if (chartmp == 'I'){ minval.push({inttmp, i});..

문제링크 C++ #include #include #include #include using namespace std; int N, M; unordered_map ladder, snake; queue Q; int dist[101]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; int tmp1, tmp2; for (int i = 0; i > tmp1 >> tmp2; ladder[tmp1] = tmp2; } for (int i = 0; i > tmp1 >> tmp2; snake[tmp1] = tmp2; } memset(dist, -1, sizeof(dist)); dist[1] = 0;..

어떤 문제를 해결하기 위해? 그래프의 한 정점에서 다른 모든 정점까지의 최단 경로를 구하는 문제(single source shortest path problem) cf) 그래프의 정점끼리 최단 경로 구하는 다른 문제는 다음과 같다. 하나의 정점에서 다른 하나의 정점까지의 최단 경로 구하는 문제(single source and single destination shortest path problem) 하나의 목적지로 가는 모든 최단 경로를 구하는 문제(single destination shortest path problem) 모든 최단 경로 구하는 문제(all pairs shortest path problem) 기본 전제 단 하나의 간선(정점과 정점을 잇는 선)이라도 가중치가 음수이면 안 된다. 음수이면 ..

문제링크 C++ #include #include using namespace std; int N; int matrix[101][101]; int ret[101][101]; int visited[101]; void dfs(int start, int nod){ if (visited[nod] == 1) return ; visited[nod] = 1; for (int i = 1; i > N; for (int i = 1; i matrix[i][j]; } } for (int i = 1; i

문제링크 C++(BFS) #include #include #include #include using namespace std; unsigned short N; unsigned int M; unsigned short u, v; vector adj_lst[1001]; char visited[1001]; queue Q; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for (int i = 0; i > u >> v; adj_lst[u].push_back(v); adj_lst[v].push_back(u); } int ret = 0; for (int t = 1; t > M; for (int i = 0; i < M; i+..

문제링크 C++ #include using namespace std; int T, M, N, x, y; int ret; int gcd(int a, int b){ while (b > 0){ int r = a % b; a = b; b = r; } return (a); } int lcm(int a, int b){ return (a * b / gcd(a, b)); } int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> T; for (int i = 0; i > M >> N >> x >> y; ret = -1; int tmp = x; int cnt = x; for (int j = 0; j < N; j++){ int yy; if (tmp %..

문제링크 C++ #include using namespace std; int memo[1001]; int n; void dp(int n); int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> n; dp(n); cout

문제링크 C++ #include using namespace std; int N, M; int arr[100001]; int sum[100001]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for (int i = 1; i > arr[i]; sum[i] = sum[i - 1] + arr[i]; } for (int idx = 1; idx > i >> j; cout

문제링크 C++ #include #include using namespace std; int T; unordered_map my_map; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin >> T; for (int i = 0; i > n; string tmp1, tmp2; my_map.clear(); for (int j = 0; j > tmp1 >> tmp2; if (my_map.count(tmp2) == 0) { my_map[tmp2] = 1; } else { my_map[tmp2]++; } } int ret = 1; for (auto i = my_map.begin(); i != my_..