摘要: 看了chenxing老湿的代码,我真心为自己智商捉鸡啊。。一遍dfs搞定啊。。 1 #include 2 #include 3 #define maxn 110 4 int first[maxn],v[maxn*2],next[maxn*2]; 5 int len,e; 6 inline int max(int a,int b){ 7 return a > b ? a : b; 8 } 9 10 void init(){11 e = 0;12 memset(first,-1,sizeof(first));13 }14 15 void add_edge(int a,i... 阅读全文
posted @ 2013-08-05 18:06 浙西贫农 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 我也搞不懂为什么我每次做这种明明很简单清晰的题目总是会想出那么操蛋的办法,诶。贴个正常的: 1 #include 2 typedef long long LL; 3 LL a[20]; 4 LL count(LL num){ 5 int bit[20],cnt = 0; 6 LL tmp = num; 7 while(tmp > 0){ 8 bit[cnt++] = tmp % 10; 9 tmp /= 10;10 }11 if(cnt == 1) return num - 1;12 LL ans = 9;... 阅读全文
posted @ 2013-08-05 15:02 浙西贫农 阅读(252) 评论(0) 推荐(0) 编辑