QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#359399#408. Dungeon 2AdamGS17 1ms4216kbC++231.3kb2024-03-20 17:31:492024-03-20 17:31:50

Judging History

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

  • [2024-03-20 17:31:50]
  • 评测
  • 测评结果:17
  • 用时:1ms
  • 内存:4216kb
  • [2024-03-20 17:31:49]
  • 提交

answer

#include "dungeon2.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=207, INF=1e9+7;
vector<int>V[LIM], typ[LIM];
int odl[LIM][LIM], n=1;
void DFS(int x, int o) {
  int a=NumberOfRoads();
  rep(i, a) {
    V[x].pb(-1);
    typ[x].pb(0);
  }
  if(x!=o) {
    int p=LastRoad(); --p;
    V[x][p]=o;
    typ[x][p]=1;
  }
  Move(1, x+2);
  Move(LastRoad(), Color());
  rep(i, V[x].size()) if(typ[x][i]==0) {
    Move(i+1, Color());
    if(Color()!=1) {
      V[x][i]=Color()-2;
      Move(LastRoad(), Color());
      continue;
    }
    V[x][i]=n++;
    typ[x][i]=2;
    DFS(n-1, x);
  }
  rep(i, V[x].size()) if(typ[x][i]==1) Move(i+1, Color());
}
void Inspect(int R) {
  DFS(0, 0);
  rep(i, n) {
    rep(j, n) odl[i][j]=INF;
    odl[i][i]=0;
    queue<int>q;
    q.push(i);
    while(!q.empty()) {
      int p=q.front(); q.pop();
      for(auto j : V[p]) if(odl[i][j]>odl[i][p]+1) {
        odl[i][j]=odl[i][p]+1;
        q.push(j);
      }
    }
  }
  for(int d=1; d<=R; ++d) {
    int ans=0;
    rep(i, n) rep(j, i) if(odl[i][j]==d) ++ans;
    Answer(d, ans);
  }
}

详细

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 1ms
memory: 4108kb

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:

Accepted: #move = 62

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 4216kb

input:

50 100 50
2
39 10
4
7 43 11 33
2
7 18
1
14
3
46 42 27
2
12 49
4
2 41 3 35
1
37
1
14
4
13 14 19 1
3
22 2 44
1
6
4
49 21 10 36
6
4 9 35 10 37 20
1
49
2
21 29
2
45 25
2
3 28
2
10 38
2
50 14
2
16 13
1
11
1
38
1
41
1
17
2
48 32
3
40 5 48
1
18
1
16
1
49
1
40
1
26
1
2
1
50
2
7 14
1
13
2
8 14
2
23 19
2
45 1...

output:

Accepted: #move = 202

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 4164kb

input:

50 100 10
2
4 41
1
33
3
25 27 13
2
30 1
4
28 11 8 22
2
36 39
1
10
1
5
2
35 30
2
35 7
2
32 5
1
26
3
49 21 3
4
19 29 20 22
1
23
1
49
2
18 42
2
50 17
1
14
1
14
2
22 13
3
5 14 21
2
28 15
2
29 36
2
3 34
3
12 31 34
1
3
2
5 23
4
24 38 14 40
5
4 45 33 9 39
2
38 26
2
48 11
2
2 30
3
46 25 26
2
9 10
2
6 24
1
5...

output:

Accepted: #move = 206

result:

ok 

Test #4:

score: 0
Accepted
time: 1ms
memory: 3884kb

input:

50 100 50
3
5 16 18
1
43
4
46 14 31 38
3
34 22 39
2
1 33
2
12 30
2
41 24
2
29 23
2
45 47
2
15 40
3
50 42 43
2
19 6
2
40 22
3
3 39 22
2
19 10
1
1
1
47
1
1
2
15 12
1
35
2
27 48
3
14 4 13
3
26 39 8
1
7
3
26 29 33
2
23 25
1
21
3
35 40 36
2
25 8
1
6
2
3 42
1
46
3
5 43 25
2
40 4
2
20 28
1
28
1
40
1
3
4
4 ...

output:

Accepted: #move = 214

result:

ok 

Test #5:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

50 100 50
2
11 48
2
25 22
2
7 30
1
40
2
50 37
1
34
3
15 36 3
3
42 21 33
3
10 32 27
2
45 9
3
1 18 32
4
36 13 34 43
4
43 18 21 12
1
45
3
7 31 28
3
50 18 22
2
28 20
4
11 22 13 16
1
50
2
29 17
3
8 13 43
5
2 35 16 18 27
2
36 24
1
23
2
2 26
2
25 41
2
9 22
2
17 15
3
49 20 30
3
3 38 29
2
15 49
3
9 11 39
1
8...

output:

Accepted: #move = 242

result:

ok 

Test #6:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

50 100 50
2
31 48
2
22 32
5
11 16 20 40 34
3
13 8 38
2
9 14
4
25 13 9 40
5
50 14 42 49 28
3
4 16 37
5
17 6 26 5 33
5
38 25 45 44 39
7
46 20 48 41 3 16 21
5
47 44 24 18 21
5
24 16 29 6 4
5
50 19 7 36 5
3
26 37 39
6
49 33 11 3 8 13
4
20 9 30 21
5
25 12 32 31 48
5
48 39 28 41 14
6
38 17 27 11 39 3
4
17...

output:

Accepted: #move = 402

result:

ok 

Test #7:

score: 0
Accepted
time: 1ms
memory: 4120kb

input:

32 100 20
5
11 20 30 3 18
5
21 8 22 12 10
5
6 31 16 1 24
5
15 27 29 17 5
5
12 19 26 21 4
5
3 25 14 11 7
5
24 9 28 32 6
5
28 2 24 23 16
5
22 7 21 26 25
5
17 16 31 15 2
5
1 29 27 6 32
5
5 23 13 2 15
5
26 18 12 22 20
5
16 17 6 27 28
5
4 30 20 10 12
5
14 10 3 30 8
5
10 14 25 4 21
5
32 13 23 24 1
5
23 5 ...

output:

Accepted: #move = 322

result:

ok 

Test #8:

score: 0
Accepted
time: 1ms
memory: 3928kb

input:

48 100 50
3
16 39 47
3
3 25 44
3
35 2 44
3
14 31 24
3
29 35 9
3
33 38 29
3
23 16 39
3
11 30 18
3
29 35 5
3
13 26 36
3
28 8 30
3
41 45 22
3
40 20 10
3
27 4 31
3
42 32 17
3
7 1 39
3
15 21 32
3
8 33 38
3
47 34 37
3
22 13 40
3
32 17 46
3
12 40 20
3
43 48 7
3
4 41 45
3
2 44 27
3
10 42 36
3
25 14 31
3
11 ...

output:

Accepted: #move = 290

result:

ok 

Test #9:

score: 0
Accepted
time: 1ms
memory: 3892kb

input:

44 100 50
3
26 40 32
3
31 14 6
3
18 26 11
3
29 41 16
3
23 7 33
3
31 14 2
3
5 33 18
3
15 43 20
3
17 27 30
3
35 12 23
3
18 26 3
3
20 10 35
3
25 19 36
3
6 2 21
3
24 8 43
3
29 41 4
3
9 30 44
3
7 11 3
3
13 37 36
3
8 35 12
3
14 38 42
3
27 28 39
3
10 5 33
3
41 15 43
3
38 42 13
3
11 3 1
3
9 30 22
3
22 34 39...

output:

Accepted: #move = 266

result:

ok 

Test #10:

score: 0
Accepted
time: 1ms
memory: 4196kb

input:

48 100 30
2
6 28
2
28 20
2
35 32
2
26 37
2
22 8
2
33 1
2
27 9
2
5 48
2
7 19
2
24 39
2
48 38
2
21 13
2
12 46
2
16 35
2
31 44
2
29 14
2
23 42
2
44 41
2
9 24
2
2 23
2
30 12
2
34 5
2
20 17
2
19 10
2
42 31
2
39 4
2
40 7
2
1 2
2
47 16
2
37 21
2
25 15
2
3 34
2
36 6
2
32 22
2
3 14
2
46 33
2
4 30
2
11 43
2
1...

output:

Accepted: #move = 194

result:

ok 

Test #11:

score: 0
Accepted
time: 1ms
memory: 3924kb

input:

50 100 50
4
42 7 39 27
4
11 9 35 29
4
44 23 8 45
4
23 8 45 48
4
27 37 16 43
4
24 14 21 36
4
40 1 42 39
4
3 4 23 45
4
18 2 11 35
4
34 24 32 38
4
18 2 9 35
4
25 26 28 49
4
48 17 47 19
4
6 44 21 36
4
50 49 20 33
4
27 37 5 43
4
13 47 19 50
4
22 11 9 35
4
48 17 13 47
4
50 49 33 15
4
6 44 14 36
4
25 26 28...

output:

Accepted: #move = 402

result:

ok 

Test #12:

score: 0
Accepted
time: 1ms
memory: 3928kb

input:

50 100 50
4
46 4 5 2
4
5 1 3 4
4
2 5 4 8
4
1 2 5 3
4
4 3 1 2
4
7 8 10 11
4
9 6 11 8
4
7 9 6 3
4
7 10 11 8
4
6 11 13 9
4
9 10 6 7
4
13 14 15 16
4
10 16 15 12
4
16 15 21 12
4
16 14 12 13
4
14 13 15 12
4
19 22 21 18
4
19 20 22 17
4
21 17 20 18
4
18 21 19 22
4
14 17 19 20
4
20 17 24 18
4
27 26 25 24
4
2...

output:

Accepted: #move = 402

result:

ok 

Test #13:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

50 100 50
4
3 2 6 7
4
47 3 7 1
4
2 1 5 4
4
5 3 9 6
4
7 4 6 3
4
7 1 4 5
4
6 1 5 2
4
10 13 14 9
4
4 8 14 11
4
20 11 12 8
4
12 13 10 9
4
10 14 11 13
4
11 8 14 12
4
13 9 8 12
4
22 17 21 16
4
17 18 22 15
4
19 18 15 16
4
16 17 19 20
4
21 17 18 20
4
18 22 10 19
4
19 22 15 23
4
20 16 21 15
4
21 26 25 27
4
2...

output:

Accepted: #move = 402

result:

ok 

Test #14:

score: 0
Accepted
time: 1ms
memory: 3880kb

input:

50 100 50
4
9 10 3 2
4
1 10 4 3
4
1 2 49 4
4
5 6 2 3
4
4 7 13 6
4
4 7 5 8
4
5 8 6 9
4
9 6 10 7
4
7 10 1 8
4
9 2 1 8
4
12 13 15 16
4
11 14 13 16
4
5 12 14 11
4
16 15 12 13
4
14 11 16 23
4
12 11 15 14
4
18 25 19 24
4
19 25 20 17
4
20 18 17 21
4
21 22 18 19
4
20 19 23 22
4
23 20 24 21
4
22 15 21 24
4
2...

output:

Accepted: #move = 402

result:

ok 

Test #15:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

50 100 50
4
27 2 3 26
4
3 1 27 4
4
4 1 5 2
4
3 5 2 6
4
7 3 6 4
4
5 7 8 4
4
9 8 6 5
4
6 9 10 7
4
8 10 11 7
4
9 11 8 12
4
12 13 9 10
4
11 13 10 14
4
12 14 11 15
4
12 15 13 16
4
17 14 13 16
4
14 44 18 15
4
18 31 15 19
4
20 17 16 19
4
20 18 21 17
4
18 21 22 19
4
20 19 23 22
4
20 23 21 24
4
21 24 22 25
4...

output:

Accepted: #move = 402

result:

ok 

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: