#include "dungeon2.h"
#include <bits/stdc++.h>
using namespace std;
int N=1, adj[55][55], D[55][55], ans[210];
int F() {
int P=LastRoad(), K=NumberOfRoads(), C=Color();
if(C>1) {
Move(P, C);
return C;
}
int x=++N;
for(int i=1; i<=K; i++) {
Move(i, x);
adj[x-1][F()-1]=true;
}
if(P>0) Move(P, x);
return x;
}
void Inspect(int R) {
F();
N--;
for(int i=1; i<=N; i++) for(int j=1; j<=N; j++) D[i][j]=(adj[i][j]?1:10000);
for(int k=1; k<=N; k++) for(int i=1; i<=N; i++) for(int j=1; j<=N; j++) D[i][j]=min(D[i][j], D[i][k]+D[k][j]);
for(int i=1; i<=N; i++) for(int j=i+1; j<=N; j++) if(D[i][j]<=R) ans[D[i][j]]++;
for(int i=1; i<=R; i++) Answer(i, ans[i]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |