## 11180 - Base i-1

Moderator: Board moderators

New poster
Posts: 27
Joined: Sun Feb 18, 2007 2:14 pm

### 11180 - Base i-1

I think, it is related to Gaussian integer or something. But could not solve.
Any help ?

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Contact:
How do you usually convert a number into base b if b is a positive integer >=2?
A similar idea works here.
We can similarly define the concept of a remainder.

KirllButin
New poster
Posts: 6
Joined: Mon Feb 26, 2007 10:42 pm
I recieve a and b for each power
1 0
-1 1
0 -2
2 2
-4 0
4 -4
.....

but I don't know what subset we should use for

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong
Dont' think too hard. Think of sclo's hint. We got accepted using the same idea.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

KirllButin
New poster
Posts: 6
Joined: Mon Feb 26, 2007 10:42 pm
Thank you
Yes I understand, my way is wrong

So I just should divide on (i-1)
If a or b are odd then 1 else 0 . Am I right?

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
No, if (a+b) is odd then 1, otherwise 0. Unless that's what you meant (but that's not what you said).

New poster
Posts: 27
Joined: Sun Feb 18, 2007 2:14 pm
Darko wrote:No, if (a+b) is odd then 1, otherwise 0.
any reason for this assumption?

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am