Submission #978671

# Submission time Handle Problem Language Result Execution time Memory
978671 2024-05-09T13:12:32 Z Nexus Game (APIO22_game) C++17
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#define ll long long

using namespace std;

const ll N=1e3+9,M=2e18+9,mod=1e9+7;

ll balt;
ll vis[N],n,k,x,y,z;
vector<ll>v[N];

void dfs(int node)
{
    if(vis[node])
    {
        if(node<z)balt=1;
        return;
    }
    vis[node]=1;
    for(auto i:v[node])dfs(i);
}

void init(int n,int k)
{
    z=k-1;
    for(ll i=0;i<z;++i)v[i].push_back(i+1);
}

int add_teleporter(int x,int y)
{
    if(n==k)return 1;
    v[x].push_back(y);
    memset(vis,0,sizeof vis);
    balt=0;
    dfs(0);
    return balt;
}

/*
int main()
{
    ios::sync_with_stdio(0);
    //cin.tie(0);cout.tie(0);


    cin>>n>>k;
    init(n,k);
    while(1)
    {
        cin>>x>>y;
        v[x].push_back(y);
        if(add_teleporter(x,y))
        {
            cout<<1;
            return 0;
        }
        cout<<0;
    }
}
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -