11621 - Small Factors

All about problems in Volume 116. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Shafaet_du
Experienced poster
Posts: 147
Joined: Mon Jun 07, 2010 11:43 am
Location: University Of Dhaka,Bangladesh
Contact:

11621 - Small Factors

Post by Shafaet_du »

Sample inputs:

Code: Select all

2147483647
1000000
99999999
324534536
2342323333
1
222222222
444444444
555555555
6345345345
0
output:

Code: Select all

2147483648
1048576
100663296
339738624
2415919104
1
226492416
452984832
573308928
6442450944
generate the set {2^i*3^j} using two nested loops and search inside it. Use long long or unsigned int for safety.

happy programming :wink:
masum93
New poster
Posts: 7
Joined: Wed May 11, 2011 11:15 am

Re: 11621-Small factors

Post by masum93 »

But your input consists of numbers greater than 2147483648 :)
And a stupid fact, the problem states that the numbers will be of the form 2^i3^j where i,j are in N i.e. they are positive integers, so the first number should be 6 because N is the set of positive integers, but this gives WA.
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 11621-Small factors

Post by uDebug »

Here's some input I found useful during testing / debugging.

Input:

Code: Select all

2147483647
1000000
99999999
2
324534536
48223023
847223
1231298
3
94383434
101010032
1000000000
2000000000
54362323
333711
4742
841232
1
0
AC Output:

Code: Select all

2147483648
1048576
100663296
2
339738624
50331648
884736
1259712
3
95551488
102036672
1019215872
2038431744
56623104
354294
5184
884736
1
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11621 - Small Factors

Post by lighted »

Shafaet_du wrote:generate the set {2^i*3^j} using two nested loops and search inside it. Use long long or unsigned int for safety.

happy programming :wink:
This problem is similar to Ugly Numbers (136) and Humble Numbers (443). Set can be generated with one loop using pointers.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Post Reply

Return to “Volume 116 (11600-11699)”