My source code (C++) for the TCONNUM problem is here: https://ideone.com/bVaaI7. My algorithm for convert a r-base number to s-base number is: convert r-base number to 10-base number, then convert it to s-base number.
I submitted to Spoj and the result was “1 (threshold: 3)”, details in image below:
I tried some my own test cases and the results were right, I can’t find out the problem in my code, please tell me about it. Thank you a lot if you tell me some idea.
Sorry if there’re somethings not good in English usage above, cause I’m not too good at it, sorry again .