944 - Happy Numbers

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

Moderator: Board moderators

bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

944 - Happy Numbers

Post by bishop » Sun Jul 22, 2007 9:29 pm

i solved 10591
it seem me like that
i solve like that problem
judge show WA

Code: Select all


Last edited by bishop on Mon Jul 23, 2007 8:10 pm, edited 2 times in total.

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Mon Jul 23, 2007 8:41 am

Every line contains two positive integers between 1 and 99999 each
There is a case which lower limit is 1. (checked by assert())
The statement should include term "inclusive".

ADD : There is also a case which H < L.
ADD : Please change the title to "944 Happy numbers".
----
Rio

bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

check

Post by bishop » Mon Jul 23, 2007 9:01 am

i do that but still WA
next code that post

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Mon Jul 23, 2007 9:07 am

Some io test case.
INPUT

Code: Select all

7 10
1 7
10 4
10 10
OUTPUT

Code: Select all

7 6
10 2

1 1
7 6


10 2
----
Rio

Roger Isanta
New poster
Posts: 3
Joined: Mon Jul 23, 2007 3:27 pm

Post by Roger Isanta » Mon Jul 23, 2007 3:33 pm

Hi,
I did the input, and Rio, you are right. Thanks.

There's a case in which L>H, this is going to be fixed, so that all test cases are L<=H.

However, this is not the reason why bishop is getting WA.

Roger
Last edited by Roger Isanta on Mon Jul 23, 2007 4:19 pm, edited 2 times in total.

Roger Isanta
New poster
Posts: 3
Joined: Mon Jul 23, 2007 3:27 pm

Post by Roger Isanta » Mon Jul 23, 2007 3:45 pm

Bishop try this in/out:

IN:
1111 1120

OUT:
1112 7
1114 6
1115 5

bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

then why for WA944

Post by bishop » Mon Jul 23, 2007 8:16 pm

all are checked
but it show WA

Code: Select all

accepted
Last edited by bishop on Tue Jul 24, 2007 4:59 pm, edited 1 time in total.

Roger Isanta
New poster
Posts: 3
Joined: Mon Jul 23, 2007 3:27 pm

Post by Roger Isanta » Mon Jul 23, 2007 9:11 pm

Hi bishop,

the only thing I think is wrong in your code is that you output a new line after each case, while it should be between each case.

The input has been changed and now it's correct. Try now.

Roger

bishop
New poster
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

Post by bishop » Tue Jul 24, 2007 5:02 pm

thanx
roger isanta && rio

thanx for input output

mohsincsedu
Learning poster
Posts: 63
Joined: Tue Sep 20, 2005 12:31 am
Location: Dhaka
Contact:

Description

Post by mohsincsedu » Sat Nov 03, 2007 2:31 am

Input

The input has two lines which contain a positive integer between 1 and 99999 each; the first integer, L, is the low limit of the closed interval; the second one, H, is the high limit


why multiple i/o??
Amra korbo joy akhdin............................

shakil
Learning poster
Posts: 74
Joined: Sat Jul 15, 2006 6:28 am
Location: CUET , bangladesh
Contact:

Post by shakil » Mon Nov 12, 2007 8:31 pm

Why WA. PLease help......

Code: Select all

Thanks jan
Last edited by shakil on Wed Nov 14, 2007 6:11 am, edited 1 time in total.
SHAKIL

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Tue Nov 13, 2007 9:03 pm

newlines should be printed between cases.
Ami ekhono shopno dekhi...
HomePage

User avatar
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am
Contact:

Make me cruel...

Post by Rocky » Fri Jun 20, 2008 7:29 am

Hi,
I cant find any bug in my code...can any one give any hints wht is tricks behind it.
i check all the cases in the board but still wA..

thanks in advance
Rocky

User avatar
Rocky
Experienced poster
Posts: 124
Joined: Thu Oct 14, 2004 9:05 am
Contact:

Re: 944 - Happy number--Got acc

Post by Rocky » Sun Jun 22, 2008 7:07 pm

Thnx
Got Ac Now.

Rocky

kissu parina
New poster
Posts: 19
Joined: Thu May 20, 2010 8:58 am

Re: 944 - Happy number

Post by kissu parina » Mon Jan 10, 2011 1:26 pm

just dont output a blank line after the last case and i also swaped the values if L>H
hope it helps :wink:
one day...

Post Reply

Return to “Volume 9 (900-999)”