Good Subsequence
Practice
4.5 (2 votes)
Math
Observation
Basic math
C++
Problem
22% Success 417 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given an array
Two subsequences are different if they differ in the indices chosen.
Input Format:
- The first line contains an integer
, which denotes the number of test cases. - The first line of each test case contains an integer
. - The second line of each test case contains
space-separated integers, elements of array .
Output Format:
For each test case, print the number of non-empty good subsequences modulo
Constraints:
Explanation
First test case:
Good subsequences are
Second test case:
Good subsequences are
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
26 votes
Tags:
Data StructuresBasic MathAlgorithmsMath BasicMath
Points:20
Tags:
Easy
Points:20
2 votes
Tags:
Ad-HocMathematicsEasySimple-mathMathematicsMathematicsMathamatics
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Results
Custom Input
Run your code to see the output