摘要: 题目描述 给出一个正整数x,问x最少能由多少个Fibonacci数加减算出。 例如1070=987+89-5-1,因此x=1070时答案是4。 给出一个正整数x,问x最少能由多少个Fibonacci数加减算出。 例如1070=987+89-5-1,因此x=1070时答案是4。 输入 第一行一个正整数 阅读全文
posted @ 2018-09-05 18:12 The_Virtuoso 阅读(216) 评论(0) 推荐(0)
摘要: 题目描述 维护一个长度为n的序列,一开始都是0,支持以下两种操作:1.U k a 将序列中第k个数修改为a。2.Z c s 在这个序列上,每次选出c个正数,并将它们都减去1,询问能否进行s次操作。每次询问独立,即每次询问不会对序列进行修改。 维护一个长度为n的序列,一开始都是0,支持以下两种操作:1 阅读全文
posted @ 2018-09-05 18:01 The_Virtuoso 阅读(226) 评论(0) 推荐(0)
摘要: 题目描述 有n种颜色的砖块,第i种颜色的砖块有a[i]个,你需要把他们放成一排,使得相邻两个砖块的颜色不相同,限定第一个砖块的颜色是start,最后一个砖块的颜色是end,请构造出一种合法的方案或判断无解。 有n种颜色的砖块,第i种颜色的砖块有a[i]个,你需要把他们放成一排,使得相邻两个砖块的颜色 阅读全文
posted @ 2018-09-05 14:47 The_Virtuoso 阅读(451) 评论(0) 推荐(0)
摘要: 题目描述 考虑正整数集合,现在有n组人依次来取数,假设第i组来了x人,他们每个取的数一定是x的倍数,并且是还剩下的最小的x个。正整数中有m个数被标成了幸运数,问有哪些人取到了幸运数。 考虑正整数集合,现在有n组人依次来取数,假设第i组来了x人,他们每个取的数一定是x的倍数,并且是还剩下的最小的x个。 阅读全文
posted @ 2018-09-05 12:02 The_Virtuoso 阅读(156) 评论(0) 推荐(0)
摘要: 题目描述 Byteasar is a famous safe-cracker, who renounced his criminal activity and got into testing and certifying anti-burglary devices. He has just rec 阅读全文
posted @ 2018-09-05 09:57 The_Virtuoso 阅读(274) 评论(0) 推荐(0)
摘要: 题目描述 A word consisting of lower-case letters of the English alphabet ('a'-'z') is given. We would like to choose a non-empty contiguous (i.e. one-piec 阅读全文
posted @ 2018-09-05 08:39 The_Virtuoso 阅读(163) 评论(0) 推荐(0)
摘要: 题目描述 Byteasar bought his son Bytie a set of blocks numbered from to and arranged them in a row in a certain order. Bytie's goal is to rearrange the bl 阅读全文
posted @ 2018-09-05 08:25 The_Virtuoso 阅读(312) 评论(0) 推荐(0)