QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#786933#4251. Gameisirazeev0 1ms3952kbC++23602b2024-11-27 02:08:332024-11-27 02:08:35

Judging History

你现在查看的是最新测评结果

  • [2024-11-27 02:08:35]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3952kb
  • [2024-11-27 02:08:33]
  • 提交

answer

#include "game.h"

#include <bits/stdc++.h>

using namespace std;

int n, k;

vector<int> g[1010];

bool used[1010];

bool dfs(int v) {
    if (used[v]) return false;
    used[v] = true;
    for (auto u: g[v]) {
        if (used[u]) return true;
        if (dfs(u)) return true;
    }
    return false;
}

void init(int this_n, int this_k) {
    n = this_n, k = this_k;
}

int add_teleporter(int u, int v) {
    if (u == v && u < k) return 1;
    fill(used, used + 1010, false);
    g[u].emplace_back(v);
    for (int i = 0; i < k; i++) {
        if (dfs(i))
            return 1;
    }
    return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 2
Accepted
time: 1ms
memory: 3872kb

input:

1 1
1
893123 893123
-1

output:

0

result:

ok interaction finished.

Test #2:

score: 0
Wrong Answer
time: 1ms
memory: 3952kb

input:

9 9
29
893122 893124
893121 893127
893120 893124
893123 893121
893122 893131
893125 893131
893121 893126
893123 893126
893126 893131
893123 893131
893123 893125
893123 893124
893127 893125
893120 893126
893123 893120
893121 893131
893123 893127
893122 893126
893122 893127
893127 893131
893122 893125...

output:

2

result:

wrong answer Wrong Answer [1]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

0%