摘要: 转自 源博客链接:http://blog.csdn.net/cc_again/article/details/25866971 动态规划(英语:Dynamic programming,DP)是一种在数学、计算机科学和经济学中使用的,通过把原问题分解为相对简单的子问题的方式求解复杂问题的方法。 动态规 阅读全文
posted @ 2020-09-19 18:39 一只球球 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题意: 对于Legend Tuple(下文称为LT)有以下3种规则: 1、(1,k)必然符合要求; 2、如果(n,k)符合要求,则(n+k,k)也符合要求; 3、如果(n,k)符合要求,则(n*k,k)也符合要求。 给出N、K,分别为n、k的范围,问有多少符合要求的LT。 思路:我们可以先看一下N= 阅读全文
posted @ 2020-08-01 17:05 一只球球 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 题目来源:2020牛客暑期多校训练营(第三场)A-Clam and Fish 题目链接:https://ac.nowcoder.com/acm/contest/5668/A 题目大意:有n个阶段,每个阶段可能是4种状态的一种。 1:没鱼没饲料; 2:没鱼有饲料; 3:有鱼没饲料; 4:有鱼有饲料。 阅读全文
posted @ 2020-07-25 11:02 一只球球 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 哇!!!!哭了出来。 宛如瞎了一般,J题如此简单而又明显的规律竟然没看出来,后来还是****出来的。ps:下一次我就算不打acm,原地退役,3口吞键盘,也不可能在oeis了。。。。真香。 J:Easy Integration n=1,ans=1/(2*3); ​n=2,ans=(1*2)/(3*4* 阅读全文
posted @ 2020-07-12 23:14 一只球球 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一个n*m的方格,你可以在格子中放入1或0.任意一个格子与它所有相邻(有公共边)的格子最多只有一个相同。问有多少种方法。 思路:我们先考虑只有一维的情况,发现是一个斐波那契数列。处理出来记为a[]; 当第一行确定时,1:如果第一行有至少一个(相邻的2个格)相同,那么整个矩阵就可以通过这2个 阅读全文
posted @ 2019-10-23 14:19 一只球球 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Heard that eomeom is a fishing MASTER, you want to acknowledge him as your mentor. As everybody knows, if you want to be a MASTER's apprentice, you sh 阅读全文
posted @ 2019-08-25 15:11 一只球球 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 题面: For a positive integer nn, let's denote function f(n,m)f(n,m) as the mm-th smallest integer xx that x>nx>n and gcd(x,n)=1gcd(x,n)=1. For example,  阅读全文
posted @ 2019-08-09 21:12 一只球球 阅读(165) 评论(0) 推荐(0) 编辑
摘要: You are given three positive integers N,x,y.Please calculate how many permutations of 1∼N satisfies the following conditions (We denote the i-th numbe 阅读全文
posted @ 2019-08-06 11:31 一只球球 阅读(186) 评论(0) 推荐(0) 编辑
摘要: You are given two integers N,CN,C and two integer sequences aa and bb of length NN. The sequences are indexed from 11 to NN. Please solve the followin 阅读全文
posted @ 2019-08-06 10:11 一只球球 阅读(140) 评论(0) 推荐(1) 编辑
摘要: 链接:https://ac.nowcoder.com/acm/contest/884/B来源:牛客网 题目描述 Your are given n sets.Every set contains some integers. We say a set can express an integer, o 阅读全文
posted @ 2019-08-02 21:54 一只球球 阅读(240) 评论(0) 推荐(0) 编辑