The solution should get TLE but getting accepted. Please help Experts by giving proper reason.

Revision en1, by Secret.Codes, 2017-06-14 23:15:15

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.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Secret.Codes 2017-06-14 23:15:15 627 Initial revision (published)