Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×
Help
Difference between en3 and en4, changed 136 character(s)
- **I can't think of a DP for this task help plz**↵
_Find the number of sequences (a1, a2,..., an) such that_↵
a[i]^2 + a[i + 1]^2 + ... + a[n]^2 = k↵
a[i] <= a[i + 1] <= ... <= a[n]↵

- T is testcase↵
- n is quantity of number↵
- k is a[i]^2 + a[i + 1]^2 + ... + a[n]^2 = k↵

- 1 <= T <= 1e5↵
- 1 <= n <= 100↵
- 1 <= k <= 5000↵
- example↵
- input↵
- 1↵
- 4 243↵
- output ↵
- 9↵

- Explanation↵
1.- first 1 1 4 15  -> (1 * 1) + (1 * 1) + (4 * 4) + (15 * 15) = 243                                                                                                                                                              2.&mdash; second 1 3 8 13                                                                                                                                                                3. &mdash; third 1 7 7 12                                                                                                                                                                4.&mdash; fouth 3 3 9 12                                                                                                                                                                5.&mdash; fifth 3 4 7 13                                                                                                                                                                  6.&mdash; sixth 3 7 8 11                                                                                                                                                                 7.&mdash; seventh 4 5 9 11                                                                                                                                                                 8.&mdash; eighth 5 5 7 12                                                                                                                                                                 9.&mdash; nineth 7 7 8 9 

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English DEAMN 2021-04-19 10:39:42 1
en4 English DEAMN 2021-04-19 09:57:26 136
en3 English DEAMN 2021-04-19 09:54:55 51
en2 English DEAMN 2021-04-19 09:52:44 62 Tiny change: '**I can't ' -> '- **I can't '
en1 English DEAMN 2021-04-19 09:50:35 1774 Initial revision (published)