Description 给定序列 A, 求出 A 中本质不同的子序列 (包含空的子序列) 个数模 10^9+ 7 的结果. 一个序列 B 是 A 的子序列需要满足 A 删掉某些元素后能够得到 B. 两个子序列中对应位置的数都相同我们就认为这两个子序列本质相同 Input 第一行包含一个整数 N , 代表序列的长度. 接下来一行 N 个整数, 第 i 个数代表 Ai. Output 输出一个整数代表答案. Sample Input 5 2 3 1 3 2 Sample Output 27 Hint
Palindrome subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65535 K (Java/Others)Total Submission(s): 4513 Accepted Submission(s): 1935 Problem Description In mathematics, a subsequence is a sequence that can be derived f
题目链接:pid=1084">点击打开链接 寒假安排 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others) SubmitStatistic Next Problem Problem Description 寒假又快要到了,只是对于lzx来说,头疼的事又来了,由于众多的后宫都指望着能和lzx约会呢,lzx得安排好计划才行. 如果lzx的后宫团有n个人.寒假共同拥有m天,而每天仅仅能
求N以内的真分数个数 For example, if N = 5, the number of possible irreducible fractions are 11 as below. 0 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1 Input Output 代码: #include <iostream> #include <cstdio> using namespace std; #define _DEBUG 0 #define MAX 10
求集合里元素的个数 输出最大的个数是多少 Sample Input41 23 45 61 641 23 45 67 8 Sample Output42 # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <cmath> # include <queue> # define LL long long usi