Skip to content

Commit

Permalink
visited ์ œ๊ฑฐ
Browse files Browse the repository at this point in the history
  • Loading branch information
makehard23 committed Aug 14, 2024
1 parent e0454ee commit 63d2e57
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions yuyu0830/์œ„์ƒ์ •๋ ฌ/2252.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using namespace std;

int n, m;
int enter[NUM] = {0, };
bool visited[NUM] = {0, };

vector<int> rule[NUM];

Expand All @@ -26,10 +25,8 @@ int main() {
vector<int> ans;

for (int i = 1; i <= n; i++) {
if (!enter[i]) {
if (!enter[i])
empty.push(i);
visited[i] = true;
}
}

while (!empty.empty()) {
Expand All @@ -41,14 +38,11 @@ int main() {
for (int i : rule[cur]) {
enter[i]--;

if (!enter[i]) {
if (!enter[i])
empty.push(i);
visited[i] = true;
}
}
}

for (int i : ans) {
for (int i : ans)
printf("%d ", i);
}
}

0 comments on commit 63d2e57

Please sign in to comment.