递推
搬砖的小孩有肉吃
我曾十步杀一人,却败给你的眼神
展开
-
2020牛客寒假算法基础集训营4--树上博弈
此题按层分析,分析得出,如果两人起初的层数差值是偶数的话,牛牛肯定赢 #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> #include<vector> #include<cmath> #include<st...原创 2020-02-14 15:22:16 · 160 阅读 · 0 评论 -
台阶问题
题目描述 有N级的台阶,你一开始在底部,每次可以向上迈最多K级台阶(最少1级),问到达第N级台阶有多少种不同方式。 输入输出格式 输入格式: 两个正整数N,K。 输出格式: 一个正整数,为不同方式数,由于答案可能很大,你需要输出ans \bmod 100003后的结果。 输入输出样例 输入样例#1:复制 5 2 输出样例#1:复制 8 ...原创 2019-05-01 22:41:50 · 456 阅读 · 0 评论 -
Faulhaber’s Triangle---Contest1539 - 2019年我能变强组队训练赛第十一场
http://icpc.upc.edu.cn/contest.php?cid=1539 题目描述 The sum of the m-th powers of the first n integers can be written as a polynomial of degree m + 1 in n: For example: S(n, 1) = (1 + . . . + n) = (...原创 2019-08-28 18:28:19 · 113 阅读 · 0 评论