AFreeMan
AFreeMan
全部文章
数论
BFS(1)
CDQ分治和整体二分(1)
Codeforces(15)
DFS(4)
GDUT训练(8)
KMP(1)
MST(1)
RMQ(2)
Trie(1)
二分(3)
几何(2)
区间型DP(5)
单调栈(3)
容斥原理(2)
尺取(1)
差分(1)
广工新生赛题解(1)
序列型DP(1)
思维(1)
拓扑排序(1)
排序(3)
搜索(2)
数位DP(5)
无向图双连通分量(1)
最短路(8)
未归档(95)
杂(5)
栈/(优先)队列/链表(1)
树形DP(2)
树链剖分(2)
棋盘型DP(4)
概率/期望DP(3)
模拟退火(1)
物理(1)
状压型DP(9)
矩阵快速幂(2)
线性DP(4)
线段树/树状数组(8)
组合数学(1)
缩点(不仅SCC)(1)
网络流(4)
背包型DP(4)
莫队算法(2)
贪心(3)
题解(3)
归档
标签
去牛客网
登录
/
注册
AFreeMan的博客
全部文章
/ 数论
(共9篇)
?OJ 集合子集不能拼出的最小数
题意: 给定一个集合,求不能由该集合子集拼出的最小数。 样例: {2,5,1} 1,2,3均可以拼出,4不能拼出,故答案是4. 思路: 先把集合元素从小到大排序,首先,假设第1个数必须是1,否则答案就是1. 归纳法假证: x=1时可以拼出1.(第1项满足) 对于任意x(x>=...
2019-03-22
0
590
LightOJ - 1282 Leading and Trailing
You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk. Input Input s...
2019-02-20
0
826
Codeforces1114 C Trailing Loves (or L'oeufs?)
http://codeforces.com/contest/1114/problem/C The number "zero" is called "love" (or "l'oeuf" to be precise, literally m...
2019-02-11
0
505
Codeforces-55D Beautiful numbers
http://codeforces.com/problemset/problem/55/D Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number ...
2019-02-10
0
589
HDU3037 Saving Beans
http://acm.hdu.edu.cn/showproblem.php?pid=3037 枚举Beans的数量x∈[0,m],然后用隔板法,答案就是Σ C(n+x-1,n-1),x∈[0,m] 但是直接这么算会超时,需要变化化简。 C(n-1,n-1)+C(n,n-1)+C(n+...
2019-02-07
0
529
ZOJ3557 How Many Sets II
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3557 1~n取m个不相邻的数的方案数等价于 n个相同的小球取m个不相邻的小球的方案数 取m个留下n-m个,然后在形成的n-m个空中任选m个插入 就是C...
2019-02-07
0
641
k-rounding
For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisi...
2019-01-24
0
634
hdu3031 N Knight
http://acm.hdu.edu.cn/showproblem.php?pid=3010 题目大意:在n*n棋盘上放n个骑士,要求满足两个条件①副对角线上最多放m个②任意两个骑士不在同一行/列,求方案数。 条件副对角线最多放m个的方案数等价于主对角线最多放m个,那我们考虑主对角线最多放m个。...
2019-01-12
0
492
斐波那契数列兔子繁殖问题相关思考
斐波那契数列的一个典型应用就是兔子繁殖问题。 一.最朴素的兔子繁殖问题就是:有一只兔子,从出生后第3个月起每个月都生一只兔子,小兔子长到第三个月后每个月又生一只兔子,假如兔子都不死,问第n个月的兔子总数为多少? 这个问题就是斐波那契数列的直接应用。设f【n】表示第n个月所有的兔子总...
2018-11-05
0
692