Furcifer's blog

By Furcifer, history, 8 years ago, In English

I was trying to solve this problem uva 13136 Recurrences .

But, I couldn't manage to understand the output.

For example in test case 1, n = 1,A0 = 1,B0 = 2,C0 = 3. So, According to the relations given, I should get, S0 = 0
A1 = 4-6-9= -11
B1 = 5-8-12 = -15
C1 = 2-1 = 1 S1 = 0+(-11)*(-15)+1 = 166
so,ans should be 166%10 = 6. But the output is given 5.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +2 Vote: I do not like it

I think there's a typo in the statement. If you make Sn = Sn - 1 + An + Bn + Cn, then the answers are OK.