Submission #744265

# Submission time Handle Problem Language Result Execution time Memory
744265 2023-05-18T10:10:31 Z saayan007 Game (APIO22_game) C++17
0 / 100
1 ms 220 KB
#include "bits/stdc++.h"
using namespace std;

#define fr first
#define sc second
const char nl = '\n';
#include "game.h"

const int N = 301;
bitset<N> r[N];
int n, k;
void init(int _n, int _k) {
    for(int i = 0; i < N; ++i) {
        for(int j = 0; j < N; ++j) r[i][j] = 0;
    }
    n = _n; k = _k;
    for(int i = k - 2; i >= 0; --i) {
        r[i][i + 1] = 1;
        r[i] |= r[i + 1];
    }
}

int add_teleporter(int u, int v) {
    r[u][v] = 1;
    r[u] |= r[v];
    for(int i = 0; i < n; ++i) {
        if(r[i][u]) 
            r[i] |= r[v];
    }
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < n; ++j) cout << r[i][j];
        cout << nl;
    }
    cout << nl;

    for(int i = 0; i < k; ++i) {
        for(int j = 0; j < n; ++j) {
            if(r[i][j] && r[j][i]) return 1;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -