Submission #1351360

#TimeUsernameProblemLanguageResultExecution timeMemory
1351360pineapple0006Social Engineering (EGOI22_socialengineering)C++20
0 / 100
0 ms336 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector<vector<ll>> adj;
vector<bool> visited;

int GetMove() { return 0; };
void MakeMove(int v) {};

ll findPathCountToCenter(ll v)
{
    visited[v] = true;
    ll res = 0;
    for (ll i : adj[v])
    {
        if (i == 1)
        {
            res++;
        }
        if (visited[i])
        {
            continue;
        }
        res += findPathCountToCenter(i);
    }
    return res;
}

void SocialEngineering(int n, int m, vector<pair<int, int>> edges)
{
    adj.resize(n + 1);
    visited.resize(n + 1, false);
    visited[1] = true;
    for (pair<int, int> p : edges)
    {
        adj[p.first].push_back(p.second);
        adj[p.second].push_back(p.first);
    }
    for (ll i : adj[1])
    {
        if (visited[i])
        {
            continue;
        }
        ll path_count = findPathCountToCenter(i);
        if (path_count % 2 == 1)
        {
            return;
        };
    }
    GetMove();
    return;
}

int main() {}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...