1234567891011121314151617181920212223#include using namespace std; int main() { int N, r, c, x = 0, y = 0, index = 0; cin >> N >> r >> c; int num = 1; for (int i = 1; i 0) { if (r >= y + num) { y += num; index += num * num * 2; } if (c >= x + num) { x += num; index += num * num; } num /= 2; } cout
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include bool isOnField(int x, int y, int width, int height) { if (x = height) return false; return true;} void DFS(int** arr, int x, int y, int width, int height) { if (!isOnField(x, y, width, height) || arr[x][y] == 0) return; arr[x][y] = 0; DFS(arr, x, y - 1, width, height); DFS(arr, x - 1, y, wid..
123456789101112131415161718192021222324#include #include #include using namespace std; int main() { int N; scanf("%d", &N); int* arr = new int[N]; priority_queue pQueue; unordered_map uMap; for (int i = 0; i 0; pQueue.pop()) { if (uMap.find(pQueue.top()) == uMap.end()) { uMap.insert({ pQueue.top(), i }); i++; } } for (int i = 0; i second);}Colored by Color Scriptercs
1234567891011121314151617181920212223242526272829303132#include using namespace std; void DFS(bool** connect, bool* arr, int size, int pos, int inf = 0) { for (int i = 1; i > T >> num; bool* arr = new bool[T + 1]{ false, }; bool** connect = new bool* [T + 1]; for (int i = 1; i com1 >> com2; connect[com1][com2] = true; connect[com2][com1] = true; } DFS(connect, arr, T, 1); for (int i = 1; i
1234567891011121314151617181920212223242526272829303132333435363738394041#include #include using namespace std; class Meeting {private: int start, end;public: bool operatorend == m1.end) return this->start end start = start; this->end = end; } int getEnd() { return end; } int getStart() { return start; }}; int main() { int N, cnt = 0, criterion = 0; cin >> N; Meeting* meetings = new Meeting[N]; ..
123456789101112131415161718192021222324252627282930313233#include using namespace std; void find(int** grp, int* arr, int size, int val) { arr[val] = 1; for (int pos = 0; pos > N >> M; int* arr = new int[N + 1]{ 0, }; int** grp = new int*[N + 1]; for (int i = 1; i u >> v; grp[u][v] = 1; grp[v][u] = 1; } for (int i = 1; i
- Total
- Today
- Yesterday
- 완전탐색
- Dynamic Programming
- 컨트리뷰톤
- 백트래킹
- 코딩
- 카카오
- webOS
- LG
- 플로이드 와셜
- 파이썬
- 동적 계획법
- 오픈소스
- BFS
- 구현
- 이분탐색
- 정렬
- 한화큐셀
- 알고리즘
- c
- BaekJoon
- 1932
- DP
- PyPy3
- 백준
- 프로그래머스
- c++
- 브루트포스
- DFS
- 피보나치
- 인공지능
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |