Submission #741893

# Submission time Handle Problem Language Result Execution time Memory
741893 2023-05-15T03:50:00 Z t6twotwo Game (APIO22_game) C++17
2 / 100
1 ms 208 KB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int N, K;
vector<vector<bool>> a, b;
void init(int n, int k) {
    N = n;
    K = k;
    a = vector(N, vector<bool>(K));
    b = vector(K, vector<bool>(N));
    for (int i = 0; i < K; i++) {
        for (int j = i + 1; j < K; j++) {
            a[i][j] = 1;
            b[i][j] = 1;
        }
    }
}
int add_teleporter(int u, int v) {
    for (int i = 0; i < K; i++) {
        if (a[v][i] || v == i) {
            a[u][i] = 1;
        }
        if (b[i][u] || u == i) {
            b[i][v] = 1;
        }
    }
    bool flag = 0;
    for (int i = 0; i < K; i++) {
        if (a[u][i]) {
            flag = 1;
        }
        if (b[i][u] && flag) {
            return 1;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Incorrect 0 ms 208 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Incorrect 0 ms 208 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Incorrect 0 ms 208 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Incorrect 0 ms 208 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -