subarray of exhibit a from record l to the list r is the cluster [al,al+1,… ,ar]. The number of events of the exhibit b in the cluster an is the number of subarrays of a to such an extent that they are equivalent to b. You are given n exhibits A1,A2,… ,An; the components of these clusters are integers from 1 to k. You need to assemble a cluster a comprising of m integers from 1 to k so that, for each given subarray Ai,

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

c++ language only. Correct answer will upvoted else downvoted.

 

subarray of exhibit a from record l to the list r is the cluster [al,al+1,… ,ar]. The number of events of the exhibit b in the cluster an is the number of subarrays of a to such an extent that they are equivalent to b. You are given n exhibits A1,A2,… ,An; the components of these clusters are integers from 1 to k. You need to assemble a cluster a comprising of m integers from 1 to k so that, for each given subarray Ai, the number of events of Ai in the exhibit an isn't not exactly the number of events of each non-void subarray of Ai in a. Note that if Ai doesn't happen in a, and no subarray of Ai happens in a, this condition is as yet met for Ai. Your undertaking is to compute the number of various clusters a you can fabricate, and print it modulo 998244353. 

Input :The main line contains three integers n, m and k (1≤n,m,k≤3⋅105) — the number of the given clusters, the ideal length of the exhibit a, and the upper bound on the qualities in the clusters. 

Then, at that point, n lines follow. The I-th line addresses the exhibit Ai. The main integer in the I-th line is ci (1≤ci≤m) — the number of components in Ai; then, at that point, ci integers from 1 to k follow — the components of the exhibit Ai. Extra imperative on the input: ∑i=1nci≤3⋅105; i. e., the number of components in the given clusters altogether doesn't surpass 3⋅105. 

Output :Print one integer — the number of various exhibits a you can fabricate.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY