Submission #728

# Submission time Handle Problem Language Result Execution time Memory
728 2013-03-01T12:04:12 Z jyuno426 지도 색칠하기 (GA3_map) C++
30 / 120
1500 ms 920 KB
int map[30][30];
int chk[30];

long long mapping(int num)
{
	if(num == 0) return 1;
	bool color[5];
	int i;
	long long ans = 0;

	for(i=1;i<=4;i++) color[i] = false;

	for(i=1;i<=map[num][0];i++)
	{
		color[chk[map[num][i]]] = true;
	}
	
	for(i=1;i<=4;i++)
	{
		if(!color[i])
		{
			chk[num] = i;
			ans += mapping(num-1);
			chk[num] = 0;
		}
	}

	return ans;
}

long long NumberOfMaps (int N, int M, int *A, int *B){

	int i;

	for(i=0;i<M;i++)
	{
		map[A[i]][++map[A[i]][0]] = B[i];
		map[B[i]][++map[B[i]][0]] = A[i];
	}

	return mapping(N);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 920 KB Output is correct
2 Correct 0 ms 920 KB Output is correct
3 Correct 0 ms 920 KB Output is correct
4 Correct 0 ms 920 KB Output is correct
5 Correct 0 ms 920 KB Output is correct
6 Correct 0 ms 920 KB Output is correct
7 Correct 0 ms 920 KB Output is correct
8 Correct 0 ms 920 KB Output is correct
9 Correct 0 ms 920 KB Output is correct
10 Correct 0 ms 920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 920 KB Output is correct
2 Correct 31 ms 920 KB Output is correct
3 Correct 22 ms 920 KB Output is correct
4 Correct 6 ms 920 KB Output is correct
5 Correct 0 ms 920 KB Output is correct
6 Correct 0 ms 920 KB Output is correct
7 Correct 0 ms 920 KB Output is correct
8 Correct 0 ms 920 KB Output is correct
9 Correct 0 ms 920 KB Output is correct
10 Correct 1 ms 920 KB Output is correct
11 Correct 0 ms 920 KB Output is correct
12 Correct 0 ms 920 KB Output is correct
13 Correct 0 ms 920 KB Output is correct
14 Correct 0 ms 920 KB Output is correct
15 Correct 0 ms 920 KB Output is correct
16 Correct 0 ms 920 KB Output is correct
17 Correct 0 ms 920 KB Output is correct
18 Correct 0 ms 920 KB Output is correct
19 Correct 0 ms 920 KB Output is correct
20 Correct 0 ms 920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1500 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
11 Halted 0 ms 0 KB -
12 Halted 0 ms 0 KB -
13 Halted 0 ms 0 KB -
14 Halted 0 ms 0 KB -
15 Halted 0 ms 0 KB -
16 Halted 0 ms 0 KB -
17 Halted 0 ms 0 KB -
18 Halted 0 ms 0 KB -
19 Halted 0 ms 0 KB -
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1500 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
11 Halted 0 ms 0 KB -
12 Halted 0 ms 0 KB -
13 Halted 0 ms 0 KB -
14 Halted 0 ms 0 KB -
15 Halted 0 ms 0 KB -
16 Halted 0 ms 0 KB -
17 Halted 0 ms 0 KB -
18 Halted 0 ms 0 KB -
19 Halted 0 ms 0 KB -
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1500 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -
3 Halted 0 ms 0 KB -
4 Halted 0 ms 0 KB -
5 Halted 0 ms 0 KB -
6 Halted 0 ms 0 KB -
7 Halted 0 ms 0 KB -
8 Halted 0 ms 0 KB -
9 Halted 0 ms 0 KB -
10 Halted 0 ms 0 KB -
11 Halted 0 ms 0 KB -
12 Halted 0 ms 0 KB -
13 Halted 0 ms 0 KB -
14 Halted 0 ms 0 KB -
15 Halted 0 ms 0 KB -
16 Halted 0 ms 0 KB -
17 Halted 0 ms 0 KB -
18 Halted 0 ms 0 KB -
19 Halted 0 ms 0 KB -
20 Halted 0 ms 0 KB -
21 Halted 0 ms 0 KB -
22 Halted 0 ms 0 KB -
23 Halted 0 ms 0 KB -
24 Halted 0 ms 0 KB -
25 Halted 0 ms 0 KB -
26 Halted 0 ms 0 KB -
27 Halted 0 ms 0 KB -
28 Halted 0 ms 0 KB -
29 Halted 0 ms 0 KB -
30 Halted 0 ms 0 KB -