10211 - Divisibility Testing! Wow!

All about problems in Volume 102. 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
10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

10211 - Divisibility Testing! Wow!

Post by 10153EN »

I have tired this problem but got wrong answer...

Could anyone tell me what's the base of the second input of each input set?

e.g. if the input is 16 20
then it means the base is 16
but the 20 means a decimal 20 or 20 of base 16?

Thx in advance =)
Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Post by Adrian Kuegel »

I havn't tried this problem yet, but I am absolutely sure that the second number is a decimal number, because in the description of the problem there is no definition how to write for example 97 in base 100, therefore the problem wouldn't be solvable.
Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

10211 - "Divisibility Testing! Wow!!"

Post by Per »

Could someone confirm or refute these outputs?

Input:

Code: Select all

439 2918
27 12
3 13
3141 592
10 6
Output:

Code: Select all

Add all 1458
Alternate 729 change sign

condition not found.

Add all 3

Add all 36

condition not found.
Andrey Mokhov
Experienced poster
Posts: 128
Joined: Fri Nov 15, 2002 7:45 am
Location: Kyrgyzstan

Post by Andrey Mokhov »

Hello!

My AC program produced this:

Code: Select all

Alternate 729 change sign

condition not found.

Add all 3

Add all 36

condition not found.
According to the problem statement Add all 1458 is illegal.

Have AC! :D
Andrey.
Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

Post by Per »

Thanks Andrey!

I had misunderstood the output format. Also I had another mistake, in handling cases such as "7 2", but now I'm AC. Thanks!
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post by Wei-Ming Chen »

Hello, what are the outputs of

Code: Select all

10 6
5 2
Thanks
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio »

My AC code outputs:

Code: Select all

condition not found.

Add all 1
Alternate 1 change sign
----
Rio
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post by Wei-Ming Chen »

Code: Select all

5 2
why the answer is

Code: Select all

Add all 1 
Alternate 1 change sign
not

Code: Select all

Add all 1
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio »

Because:

Code: Select all

Sum of all digits is even(odd)  <--> Sum of all digits with alternative signs is even(odd)
----
RIo
Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post by Wei-Ming Chen »

Thanks rio

you help me again and again.. :D
forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am
Location: Bangladesh
Contact:

Re: 10211 - Divisibility Testing! Wow!!

Post by forthright48 »

Really interesting problem. I knew about the divisibility rules before, but to solve the problem, I had to finally understand the proofs formally.
What ever happens, happens for good. Even when we get WA :p
http://www.forthright48.com
Post Reply

Return to “Volume 102 (10200-10299)”