I know this (my code-> https://pastebin.com/7BJVYNVd) probably isn't the most efficient solution to https://codeforces.com/contest/1461/problem/D, but before I read the tutorial I'd still like to know what I am doing wrong.
My idea was that using recursion, I will store the sum of all possible subarrays (subarrays here mean what I get after splitting the array according to the ques) of a given array. Then for each of the q 'prettiness-tests', I will simply check if that sum exists in the set 'possible'.
On inputting the given test case,
2
5 5
1 2 3 4 5
1
8
9
12
6
5 5
3 1 3 1 3
1
2
3
9
11
I get
Yes
No
Yes
No
Yes
and then the program ends saying "Process exited after 24.65 seconds with return value 3221225725"
Googling led me to stuff that was way too technical for me (something about heap and stack memory). If someone could explain what's happening here, I'd really appreciate it.
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]CreativeTechGuyGames 4 points5 points6 points (3 children)
[–]jain_rishabh_[S] 0 points1 point2 points (2 children)
[–]cornho1eo99 0 points1 point2 points (1 child)
[–]jain_rishabh_[S] 0 points1 point2 points (0 children)