Submission #1335975

#TimeUsernameProblemLanguageResultExecution timeMemory
1335975cansu_mutluSocial Engineering (EGOI22_socialengineering)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
//#include "socialengineering.h"
using namespace std;

void SocialEngineering(int n,int m, vector<pair<int,int>> edges)
{
    vector<vector<pair<int,int>>> a(n+1);
    int num = 0;
    for(auto x:edges)
    {
        int u = x.first,v = x.second;
        a[u].push_back({v,num});
        a[v].push_back({u,num});
        num++;
    }
    vector<int> vis(n+1,0),v(num,0);
    
    int ok = 1;
    if((a[1].size())%2) return;
    int i =1;
    while(1)
    {
        i = GetMove();
        if(i==0) break;
        queue<int> q;
        q.push(i);vis[i]++;
    while ((q.size()))
    {
        int s = q.front();
        if(s==1) break;
        q.pop();
        for(auto x:a[s])
        {
            if(v[x.second]==0)
            {
                v[x.second] = 1;
                vis[x.first]++;
                //if(x.first!=1)
                MakeMove(x.first);
                q.push(x.first);
                break;
            }
        }
    }
    if(q.empty())
    {
        return;
    }
    }
    return;
}

Compilation message (stderr)

Main.cpp: In function 'void SocialEngineering(int, int, std::vector<std::pair<int, int> >)':
Main.cpp:23:13: error: 'GetMove' was not declared in this scope
   23 |         i = GetMove();
      |             ^~~~~~~
Main.cpp:39:17: error: 'MakeMove' was not declared in this scope
   39 |                 MakeMove(x.first);
      |                 ^~~~~~~~