Submission #1027670

# Submission time Handle Problem Language Result Execution time Memory
1027670 2024-07-19T08:48:32 Z 변재우(#10954) None (JOI16_dungeon2) C++14
17 / 100
1 ms 600 KB
#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]);
}
# Verdict Execution time Memory 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
# 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 600 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -