QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#359763#408. Dungeon 2antekpusz0 0ms0kbC++111.3kb2024-03-20 20:41:562024-03-20 20:41:57

Judging History

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

  • [2024-03-20 20:41:57]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-03-20 20:41:56]
  • 提交

answer

#include <bits/stdc++.h>
#include "dungeon2.h"
using namespace std;

vector<vector<int>> g (60, vector<int>());
vector<int> o (60, 0);
int poz = 2;
int ilew = 1;

void dfs (int v) {
    int x = NumberOfRoads();
    for (int i = 1; i < x+1; i++) {
        Move(i, v);
        int kp = LastRoad();
        if (o[Color()] == i) {
            continue;
        }
        if (Color() == 1) {
            ilew++;
            int u = ilew+1;
            o[u] = v;
            dfs(u);
            g[v].push_back(u);
            g[u].push_back(v);
        }
        else {
            g[v].push_back(Color());
            g[Color()].push_back(v);
        }
        Move(kp, Color());
    }
}

void Inspect(int R) {
    dfs(2);
    vector<int> w (60, 0);
    for (int i = 2; i < ilew+2; i++) {
        queue<int> q;
        vector<int> dl (ilew+2, 10000000);
        q.push(i);
        dl[i] = 0;
        while (!q.empty()) {
            int v = q.front();
            q.pop();
            for (int u : g[v]) {
                if (dl[u] != 10000000) {
                    dl[u] = dl[v]+1;
                    w[dl[u]]++;
                    q.push(u);
                }
            }
        }
    }
    for (int i = 1; i < R+1; i++) {
        Answer(i, w[i]/2);
    }
}

詳細信息

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

input:

10 100 50
7
5 7 10 4 6 2 3
2
1 5
3
1 10 7
2
10 1
3
1 9 2
2
1 7
5
9 6 8 3 1
1
7
2
5 7
3
1 4 3
15
24
6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

output:

Wrong Answer [5]

result:


Subtask #2:

score: 0
Runtime Error

Test #16:

score: 0
Runtime Error

input:

10 3 50
4
7 4 10 5
2
8 6
1
10
2
1 9
3
1 7 10
2
7 2
5
6 1 5 8 9
3
7 9 2
4
10 8 7 4
4
1 9 5 3
15
19
9
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

output:

Wrong Answer [6]

result:


Subtask #3:

score: 0
Runtime Error

Test #31:

score: 0
Runtime Error

input:

200 3 200
6
149 79 143 164 179 68
4
44 52 144 113
1
84
3
31 188 166
1
109
4
154 192 125 147
1
198
4
103 27 192 95
3
33 166 179
1
125
3
31 61 150
3
168 152 161
2
67 64
1
136
2
150 17
1
192
2
15 142
2
56 122
1
35
2
97 200
2
129 22
4
72 134 31 21
2
53 82
4
195 181 104 146
1
78
1
88
3
8 78 127
4
152 200...

output:

Wrong Answer [6]

result: