## 11044 - Searching for Nessy

Moderator: Board moderators

### 11044 - Searching for Nessy

i just print (n/3) * (m/3) and got WA.
Is my algorithm right ??
L I M O N
Learning poster

Posts: 58
Joined: Wed Dec 31, 2003 8:43 am

just print (n/3) * (m/3) and got WA.
Is my algorithm right ??
Yes, it's correct.
mf
Guru

Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland

TO LIMON

input
Code: Select all
`15 5`

output
Code: Select all
`4`

Code: Select all
`1`

emotional blind
A great helper

Posts: 383
Joined: Mon Oct 18, 2004 8:25 am

I disagree - 1 is the right answer (one sonar in the middle is enough).

Krzysztof Duleba
Guru

Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland

Krzysztof Duleba
I agree with you,
My previous post was an example of stupid mistake
sorry

emotional blind
A great helper

Posts: 383
Joined: Mon Oct 18, 2004 8:25 am

Yeah you are getting wrong answer because you have to cast in the div, is not the same (n/3) * (m/3) than ( (int) (n/3)) * ( (int) (m/3))

Good work
____________________________
"Free software for a free society"
fcsc
New poster

Posts: 3
Joined: Wed Mar 01, 2006 4:33 pm

### Re: 11044 - Searching for Nessy

How (n/3) * (m/3) derieved? anyone pls help
Yes!
New poster

Posts: 1
Joined: Tue Nov 13, 2007 6:10 pm

### Re: 11044 - Searching for Nessy

Think rows and columns differently.
Ami ekhono shopno dekhi...
HomePage
Jan
Guru

Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm

### Re: 11044 - Searching for Nessy

@LIMON your algorithm is partially correct.
Consider the following cases:
Code: Select all
`4173 29368801 8073403 706812 11`

Code: Select all
`55746788977267170412`
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson

plamplam
Experienced poster

Posts: 151
Joined: Fri May 06, 2011 11:37 am