일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 13908
- 연결요소
- 오퍼레터
- 기술면접
- 파라메트릭
- upper_bound
- 소프티어
- 백준
- softeer
- 경력
- 매개변수탐색
- msSQL
- OFFSET
- Kafka
- incr
- BFS
- 이분탐색
- 성적평가
- dfs
- compose
- 처우협의
- Docker
- 6987
- 물채우기
- 백트래킹
- 처우산정
- boj #19237 #어른 상어
- 퇴사통보
- BOJ
- @P0
- Today
- Total
목록전체 글 (633)
기술 블로그
정식 알고리즘 명칭 : 플로이드 와샬 알고리즘 제출하였는데 계속 100%에서 틀렸다고 나오길래 생각해보니, 조건을 생각 못 했었다. 60번 째 줄 코드 비용은 100,000하고 같거나 작은 수이다.즉, 시작 도시에서 끝 도시로 갈 때에 비용이 100,000 초과가 된다면, 갈 수 없는 경우이므로 0을 출력해야한다. https://www.acmicpc.net/problem/11404 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869#include #include #include #include #define INF 987654..
C언어의 에서 제공하는 퀵 정렬 함수이다. 최악 : O(N^2)보통 : O(NlogN) 12345678910111213141516171819202122232425262728293031#include #include #include #include // 오름차순으로 정렬할 때 사용하는 비교함수int static compare(const void* first, const void* second){ if (*(int*)first > *(int*)second) return 1; // 내림차순은 -1 else if (*(int*)first
C언어 구현 처음엔 먼저 나이를 퀵 정렬만 하고, 출력했으나 계속 같은 나이일 때, 이름 순서가 바뀌었다. 그래서, 따로 구현했던 Swap 함수 내에서 첫 번째로 바로 같은 나이이면 return 해줬는데도 바뀌었다. 그런데, 잘 생각해보니 나이에도 조건이 있고, 사람 수에도 조건이 있다. 그래서 생각을 해보니, 따로 정렬 알고리즘을 사용할 필요가 없었다. https://www.acmicpc.net/problem/10814 12345678910111213141516171819202122232425262728293031323334353637383940414243#include #include #include #include typedef struct oj{ int age; char name[102];}oj;..
p[1][1]에 1을 넣어주고, 계산을 하면 된다. a b a+b 이런 구조이다. https://www.acmicpc.net/problem/15489 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include #include #include #include #include #include #include #include using namespace std; int p[31][31] = { 0, }; int R = 0, C = 0, W = 0; int main(void){ scanf("%d %d %d", &R, &C, &W); memset(p, 0, sizeof(p)); p[1][1] = 1; ..
C언어로 구현하였다. 전형적인 DFS의 연결 요소의 개수를 구하는 문제이다. https://www.acmicpc.net/problem/4963 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include #include #include #include int w = 0, h = 0; int visit[51][51] = { -1, }; int map[51][51] = { 0, }; int dy[8] = { -1, 0, 1, 0, 1, -1, 1, -1};int dx[8] = { 0, -1, 0, 1, 1, 1, -1, ..
※ C언어로 구현 알고리즘 순서 ① x, y를 구조체로 생성한다.② x를 기준으로 먼저 오름차순으로 퀵 정렬을 한다.③ 같은 x일 경우에만, y를 오름차순 퀵 정렬을 한다. 이 문제에서는 좌표가 중복을 허락하므로, 31, 37, 74, 80번 째 while문 안에 map과 pivot의 x, y좌표를 비교할 때, '='가 붙는다. 133 ~ 134번 째 주석도 참고하자. https://www.acmicpc.net/problem/11650 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808..
C언어 퀵 정렬 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677#include #include #include #include int value[1001] = { 0, }; int partition(int start, int end){ int pivot = end; int left = start; int right = end; int temp = 0; while (left
C언어 코드로 구현 http://hsdevelopment.tistory.com/63