Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Help! Spoj — Activ — Activities
Difference between en1 and en2, changed 195 character(s)
Problem: https://www.spoj.com/problems/ACTIV/↵
Hey! ↵

I've been stuck at this problem for the past 2 days. I came at a DP recurrence DP(i) = 1+DP(i+1)+DP(nextPossibleInterval(i)), where DP(i) represents all possible subsets of classes b/w ith and nth interval(sorted by endTime).↵

IM
HO & from what I've been able to see from solutions of other people(inTheProcessOfDebuggingMine) this logic is correct. For varioussome reasons I'm getting a TLE in my solution and getting WA in some testCases that I'm testing myself & while submitting. I've not been able to debug my code and for that any insight into what might be going wrong is highly appreciated.↵
Thanks!↵

[My Code](https://pastebin.com/fVKmMBdM↵

Spoj submission ID: 22172501
mf2f3QcJ)↵

[Problem](https://www.spoj.com/problems/ACTIV/)


Sample test case:↵

8↵
4 9↵
1 15↵
2 18↵
4 5↵
7 19↵
14 25↵
19 20↵
3 26↵
-1            Expected Output: 00000017; Actual Output: 00000026

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English vibster 2018-08-27 19:09:56 7 Tiny change: '/SxhiU1gU)\n[WA Code](' -> '/SxhiU1gU), \n [WA Code]('
en4 English vibster 2018-08-27 19:09:20 4 Tiny change: 'hiU1gU)\n[My Code](htt' -> 'hiU1gU)\n[WA Code](htt'
en3 English vibster 2018-08-27 19:08:47 61
en2 English vibster 2018-08-27 14:37:26 195
en1 English vibster 2018-08-17 21:24:22 886 Initial revision (published)