DFS
Eiffel灬
这个作者很懒,什么都没留下…
展开
-
HDU-2553 N皇后问题
#include#include#include#includeusing namespace std;int tot;int N;int C[15];int vis[3][100];void search(int cur){ if (cur == N) tot++; else for (int i = 0; i < N; i++) { if (!v原创 2017-07-02 23:24:15 · 293 阅读 · 0 评论 -
ZOJ-3687 The Review Plan I(容斥原理,禁位排列,dfs)
The Review Plan IMichael takes the Discrete Mathematics course in this semester. Now it's close to the final exam, and he wants to take a complete review of this course.The whole book he needs原创 2017-08-18 14:34:23 · 376 阅读 · 0 评论 -
数位DP UVA - 11038
数位DP,顾名思义,是在个位,十位,百位,千位…….这些数的数位上进行的DP,它其实就是一种暴力枚举+记忆化搜索。 数位DP一般用来解决要求找出某个区间内,满足要求的数有多少个之类的问题,在这里我拿UVA - 11038来举例。这道题就是给两个整数,然后要你求出这两个整数之间的数有多少个0,比如说1到10之间有1个0,100到110之间有12个0。这是一道最基础的数位DP题,我们可以令f(a)为从原创 2017-08-23 10:31:50 · 241 阅读 · 0 评论 -
HYSBZ-1853 幸运数字(容斥原理,dfs)
幸运数字在中国,很多人都把6和8视为是幸运数字!lxhgww也这样认为,于是他定义自己的“幸运号码”是十进制表示中只包含数字6和8的那些号码,比如68,666,888都是“幸运号码”!但是这种“幸运号码”总是太少了,比如在[1,100]的区间内就只有6个(6,8,66,68,86,88),于是他又定义了一种“近似幸运号码”。lxhgww规定,凡是“幸运号码”的倍数都是“近似幸运号码”,当然,任何的“原创 2017-08-28 11:34:52 · 649 阅读 · 0 评论 -
codeforces 451E Devu and Flowers(容斥原理,Lucas,dfs,隔板法)
E. Devu and Flowerstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDevu wants to decorate his garden with原创 2017-09-06 19:46:19 · 410 阅读 · 0 评论 -
HDU-1557 权利指数(dfs)
权利指数Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1324 Accepted Submission(s): 921Problem Description在选举问题中,总共有n个小团体,每个小团体拥原创 2017-09-06 21:02:30 · 435 阅读 · 0 评论 -
POJ-2773 Happy 2006(容斥,二分,dfs)
Happy 2006Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9…are all relatively prime to 2006. Now your job is easy:原创 2017-09-02 20:55:51 · 256 阅读 · 0 评论 -
SGU 476 Coach's Trouble(高精度,dfs,容斥)
476. Coach's TroubleTime limit per test: 0.5 second(s) Memory limit: 65536 kilobytesinput: standard output: standardBerland is a modern country, and one could hardly find a man, who woul原创 2017-11-13 14:21:10 · 298 阅读 · 0 评论