Artifact 28d343930b8a6ef80ed1c2b45c80d2c5d01ab912
- File
SRM/424/1A-2B.cpp
- 2011-02-23 09:21:16 - part of checkin [4fd800b3a8] on branch trunk - Copied from private svn repository. (user: kinaba) [annotate]
struct ProductOfDigits
{
int smallestNumber( int N )
{
if( N < 10 )
return 1;
int ans = 0;
for(int d=9; d>=2; --d)
while( N%d == 0 )
N/=d, ans++;
return N==1 ? ans : -1;
}
};