Submission #1027372

# Submission time Handle Problem Language Result Execution time Memory
1027372 2024-07-19T05:14:14 Z 김은성(#10950) None (JOI16_dungeon2) C++14
17 / 100
3 ms 604 KB
#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] >= 1000 * 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);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 560 KB Output is correct
5 Correct 3 ms 556 KB Output is correct
6 Correct 3 ms 348 KB Output is correct
7 Correct 2 ms 348 KB Output is correct
8 Correct 2 ms 348 KB Output is correct
9 Correct 2 ms 348 KB Output is correct
10 Correct 3 ms 432 KB Output is correct
11 Correct 3 ms 348 KB Output is correct
12 Correct 3 ms 556 KB Output is correct
13 Correct 3 ms 348 KB Output is correct
14 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 604 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -