일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 5397
- 시간 복잡도
- 자료구조
- heap
- 백준
- 게리멘더링2
- 별 찍기 10
- 백준 17822
- 구현
- 백준 1406
- 백준 17779
- 백준 5397
- qorwns
- AVL 시간 복잡도
- 해시 구현
- Stack 이란
- 조세퍼스 순열
- 풀이
- 백준 1158
- 백준 2447
- 스택의 특징
- 백준 17471
- 버킷 정렬
- 해시구현
- ㅣ풀이
- C/C++ 구현
- c#
- 1764
- 원판 돌리기
- dfs
- Today
- Total
목록알고리즘 문제풀이/백준 (178)
홍시홍의 프로그래밍
#include #include #include //#include "Windows.h" #include #include #include #include using namespace std; struct go{ int x; int y; int z; }; int parent[200200]; vector dist; int n,m; int Find(int x){ if(parent[x]==x) return x; return parent[x]=Find(parent[x]); } void Union(int x, int y){ x= Find(x); y= Find(y); if(x!=y) parent[x]=y; } bool com(go a, go b){ if(a.z < b.z) return true; return fals..
분류 : 크루스칼 요구사항 기본적인 크루스칼 문제 풀이 최소 신장 트리의 합을 구하여 전체 합에서 빼준다 #include #include #include //#include "Windows.h" #include #include #include #include using namespace std; struct go{ int x; int y; int z; }; int parent[200200]; vector dist; int n,m; int Find(int x){ if(parent[x]==x) return x; return parent[x]=Find(parent[x]); } void Union(int x, int y){ x= Find(x); y= Find(y); if(x!=y) parent[x]=y; } b..
요구사항 x월 x일 이 몇일인지 출력하기 풀이 1월 1일로 부터 몇일이 지낫는지 계산한다 월~일 7가지가 반복되므로 %를 활용해 정답을 출력한다 #include #include #include #include #include using namespace std; int n, m; int map[15] = { 31,28,31,30,31,30,31,31,30,31,30,31 }; int main() { scanf("%d%d", &n, &m); int day = 0; for (int i = 0; i < n-1; i++) { /* if (i == 1) continue; if (i == 2) day += 31; if (i == 3) day += 28; if (i == 5 || i == 7 || i == 8 || ..
요구사항 문자열 안에서 숫자를 뽑아내어 오름차순으로 정열하여라 풀이 stoi를 이용한다면 문자열 길이가 100이라면 어마어마하게 큰 숫자이기 때문에 안된다 단어 중간중간을 string으로 뽑아내어 조건에 따라 예외처리 해주고 string을 정렬하여야 한다 #include #include #include #include #include using namespace std; int n; int map[51]; int target; bool com(string a, string b) { if (a.size() < b.size()) return true; else if (a.size() == b.size()) { if (a < b) return true; } return false; } int main() { ..