Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want…
Rescue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19985 Accepted Submission(s): 7110 Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is d…
HDOJ 1312 Red and Black http://acm.hdu.edu.cn/showproblem.php?pid=1312 很裸的dfs,在dfs里面写上ans++,能到几个点就调了几次dfs,最后ans就是答案 #include<cstdio> #include<iostream> using namespace std; ][]; int n,m,si,sj,ans; ][] = {{,}, {-,}, {,-}, {,}}; int dfs(int x, i…
Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Angel's friends want to save Angel. Their task is: approa…