Submission #1026739

#TimeUsernameProblemLanguageResultExecution timeMemory
1026739dozer게임 (IOI14_game)C++14
42 / 100
1073 ms7652 KiB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
#define sp " "
#define endl "\n"
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt","w", stdout)
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define pb push_back
#define pii pair<int, int>
#define st first
#define nd second
#define LL node * 2
#define RR node * 2
#define mid (l + r) / 2
#define ll long long
#define MAXN 1505

const int modulo = 1e9 + 7;
const ll INF = 2e18 +7;


int adj[MAXN][MAXN], N;

void initialize(int n) {
    N = n;
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++) adj[i][j] = 1;
    }
}

int hasEdge(int u, int v) {
    vector<int> vis(N, 0);
    vis[u] = 1;
    adj[u][v] = 0;
    adj[v][u] = 0;
    queue<int> q;
    q.push(u);
    while(!q.empty()){
        int top = q.front();
        q.pop();
        for (int i = 0; i < N; i++){
            if (vis[i] || adj[top][i] == 0) continue;
            if (i == v){
                return 0;
            }
            vis[i] = 1;
            q.push(i);
        }
    }

    adj[u][v] = 1;
    adj[v][u] = 1;
    return 1;
}


#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...