formatting source-code for 153fb7b8a5

This commit is contained in:
github-actions
2020-05-30 04:02:09 +00:00
parent 92fe9495ec
commit 8a2de9842b
175 changed files with 1671 additions and 3460 deletions

View File

@@ -11,8 +11,7 @@ using namespace std;
int checked[999] = {WHITE};
void dfs(const list<int> lista[], int start)
{
void dfs(const list<int> lista[], int start) {
stack<int> stack;
int checked[999] = {WHITE};
@@ -20,33 +19,28 @@ void dfs(const list<int> lista[], int start)
stack.push(start);
checked[start] = GREY;
while (!stack.empty())
{
while (!stack.empty()) {
int act = stack.top();
stack.pop();
if (checked[act] == GREY)
{
if (checked[act] == GREY) {
cout << act << ' ';
for (auto it = lista[act].begin(); it != lista[act].end(); ++it)
{
for (auto it = lista[act].begin(); it != lista[act].end(); ++it) {
stack.push(*it);
if (checked[*it] != BLACK)
checked[*it] = GREY;
}
checked[act] = BLACK; //nodo controllato
checked[act] = BLACK; // nodo controllato
}
}
}
int main()
{
int main() {
int u, w;
int n;
cin >> n;
list<int> lista[INF];
for (int i = 0; i < n; ++i)
{
for (int i = 0; i < n; ++i) {
cin >> u >> w;
lista[u].push_back(w);
}