Problem link:http://mirror.codeforces.com/contest/339/problem/C
My solution :http://mirror.codeforces.com/contest/339/submission/27780404
You see here on my function dfs. it is calling new 9 dfs function.(because the vector size can be at most 10 ). so the complexity should be 9^n. Where n can be at most 1000.
I think it's because the programme need not traverse all the state. Before traversing all states it get the answer and return.
Please tell my assumption is right or not?
Be kind to me because it is my first blog.