子序列的和Ⅰ
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Problem Description
定义一个数组的权值和为:假设数组乘积为,数组的权值和为使得的所有对数(均为正整数)
给你一个数组,请你求出他的所有非空子序列的权值和,由于答案可能很大,请对取模
例如, 那么就有对符合要求, 分别为
Input Format
第一行一个整数,代表数组大小
第二行个整数,表示给定的数组A
Output Format
一行一个整数,表示答案
Sample
输入样例1
2
1 2
输出样例1
5
Hint
保证所有a[i]均为1或质数
重庆邮电大学第十七届ACM程序设计大赛(网络赛)
- Status
- Done
- Rule
- XCPC
- Problem
- 11
- Start at
- 2024-3-9 0:00
- End at
- 2024-3-11 0:00
- Duration
- 48 hour(s)
- Host
- Partic.
- 1