Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed 111.txt
Empty file.
147 changes: 0 additions & 147 deletions Algo.vcxproj

This file was deleted.

22 changes: 0 additions & 22 deletions Algo.vcxproj.filters

This file was deleted.

4 changes: 0 additions & 4 deletions Algo.vcxproj.user

This file was deleted.

34 changes: 0 additions & 34 deletions BASE/Split구현.cpp

This file was deleted.

46 changes: 0 additions & 46 deletions BASE/누적합.cpp

This file was deleted.

41 changes: 0 additions & 41 deletions BASE/순열.cpp

This file was deleted.

60 changes: 60 additions & 0 deletions DFS기본.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include <iostream>
#include <vector>

using namespace std;

int dy[4] = {-1, 0, 1, 0};
int dx[4] = {0, 1, 0, -1};

int a[1004][1004];
bool visited[1004][1004];

int n, m, nx, ny, answer;

void dfs(int y, int x)
{
cout << y << " : " << x << "\n";
visited[y][x] = 1;
for(int i = 0; i < 4; i++)
{
ny = y + dy[i];
nx = x + dx[i];
if(ny < 0 || nx < 0 || ny >= n || nx >= m) continue;
if(a[ny][nx] == 0 && !visited[ny][nx])
{
dfs(ny, nx);
}
}

return;
}


int main()
{
cin >> n >> m;

// 입력
for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
{
cin >> a[i][j];
}
}

for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
{
if(a[i][j] == 0 && !visited[i][j])
{
answer ++;
dfs(i, j);
}
}
}

cout << answer << "\n";
return 0;
}
11 changes: 0 additions & 11 deletions Debug/Algo.exe.recipe

This file was deleted.

Binary file removed Debug/Algo.ilk
Binary file not shown.
2 changes: 0 additions & 2 deletions Debug/Algo.log

This file was deleted.

2 changes: 0 additions & 2 deletions Debug/Algo.tlog/Algo.lastbuildstate

This file was deleted.

Binary file removed Debug/Algo.tlog/CL.command.1.tlog
Binary file not shown.
Binary file removed Debug/Algo.tlog/CL.read.1.tlog
Binary file not shown.
Binary file removed Debug/Algo.tlog/CL.write.1.tlog
Binary file not shown.
Binary file removed Debug/Algo.tlog/link.command.1.tlog
Binary file not shown.
Binary file removed Debug/Algo.tlog/link.read.1.tlog
Binary file not shown.
Binary file removed Debug/Algo.tlog/link.write.1.tlog
Binary file not shown.
Binary file removed Debug/Text.obj
Binary file not shown.
Binary file removed Debug/vc142.idb
Binary file not shown.
Binary file removed Debug/vc142.pdb
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# AlgorithmStudy
This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub).
Loading