Page 1 of 1

Algorithms C++

PostPosted: 27 Mar 2015, 19:26
by RandomLyrics
Hey, i have trouble with my study work.
program should count the number of digits of specified base, for example: 153 (10 base) have 3 digits, 5197 (64 base) have 3 digits etc.
input line: NC BB 'EOL-ASCII-10' N1 N2 N3 NN
all phrases divded by 'whitespace ASCII 32'.
NC = count of numbers ; BB - base ; N1, N2, NN - numbers;
Example:
IN:
10 2
0 1 2 3 4 5 6 7 8 9
OUT:
2
mycode: http://pastebin.com/zw4cB0Rb
the main condition of it is to do this as much fast as it can and at lowest memory cost. Im kinda in dead end coz i get with this code 2/100 avialabe points, some bad outputs and timeouted. Ill be glad for any help