#include "dungeon2.h"
#include <bits/stdc++.h>
using namespace std;
bool adj[59][59];
int dist[59][59];
int idx[59];
void Inspect(int R)
{
int n = 52, cnt = 1, i, prev = -1;
for(i=1; i<=n; i++)
idx[i] = 1;
while(1){
int d = NumberOfRoads();
int x = Color();
if(x==1)
x = ++cnt;
Move((idx[x] - 1) % d + 1, x);
idx[x]++;
if(prev != -1){
adj[prev][x] = adj[x][prev] = 1;
}
prev = x;
if(idx[x] >= 10 * d)
break;
}
int j, k;
for(i=2; i<=cnt; i++){
for(j=2; j<=cnt; j++){
if(i==j)
dist[i][j] = 0;
else if(adj[i][j])
dist[i][j] = 1;
else
dist[i][j] = 132489232;
}
}
for(k=2; k<=cnt; k++){
for(i=2; i<=cnt; i++){
for(j=2; j<=cnt; j++){
dist[i][j] = min(dist[i][k] +dist[k][j], dist[i][j]);
}
}
}
for(k=1; k<=R; k++){
int ans = 0;
for(i=2; i<=cnt; i++){
for(j=i+1; j<=cnt; j++){
assert(dist[i][j] < 132489232);
if(dist[i][j] == k)
ans++;
//printf("dist[%d][%d]=%d\n", i, j, dist[i][j]);
}
}
// printf("k=%d ans=%d\n", k, ans);
Answer(k, ans);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
860 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |