Page 5 of 10

Posted: Fri Aug 22, 2003 10:09 pm
by yiuyuho
hmm....news things everyday

thx.

so you just put the type definition before open block and variable names in ()?

THX

106 - WA .. help

Posted: Wed Oct 29, 2003 3:48 am
by Almost Human
Any sample input and output ???

thanks in advance

Posted: Wed Oct 29, 2003 10:42 am
by Almost Human
can anybody tell me what is the output for input like this :
1
10
100
1000
10000

thanks

Posted: Wed Oct 29, 2003 12:23 pm
by Maarten

Code: Select all

0 1
1 4
16 27
158 205
1593 1669
15919 14844
159139 133926
P.S. Please next time state the problem NAME along with the number. I think it makes you get more replies

Posted: Wed Oct 29, 2003 3:43 pm
by Almost Human
thank you for your advice.

I finally got an AC after realizing the difference between my last output ( for input 1000000 ) and yours.

many thanks

Problem Fermat vs. Pythagoras(106) - the second number

Posted: Tue Nov 18, 2003 10:39 pm
by Sensor
Could someone help me.
In the problem [b]Fermat vs. Pythagoras(106) [/b]I can find all triples but how can I find the second number (count of number whitch are not in triples) ???
I can't even imagine anything!!!

Problem 106 Fermat vs Phytagoras, help me

Posted: Tue Dec 16, 2003 5:31 pm
by iamdennis
i want to know, what is the meaning of the first output number ?
i.e :
input = 10
output = 1 4
input = 100
output = 16 27

Thank's ![/pascal]

Posted: Wed Dec 17, 2003 3:51 am
by Almost Human
input : 10
output : 1 4

pythagorean number from 1 to 10 :
3 , 4 , 5
6 , 8 , 10

1 is total of "triple pythagorean number that is relatively prime" form 1 to 10 ( 3 , 4 , 5 )
4 is total number that is not pythagorean number from 1 to 10 ( 1 , 2 , 7 and 9 )

I hope it help you

Posted: Wed Dec 17, 2003 1:40 pm
by iamdennis
ehm.. okay, thank's ! but, can you tell me, if the input is 100, can you tell me, the triple in there ? can be 16 ? i just can find 13.... thank's !

Posted: Fri Dec 19, 2003 9:43 pm
by pavelph
For n=100 answer will 16:
1)4 3 5
2)12 5 13
3)8 15 17
4)24 7 25
5)20 21 29
6)40 9 41
7)12 35 37
8)60 11 61
9)28 45 53
10)56 33 65
11)84 13 85
12)16 63 65
13)48 55 73
14)80 39 89
15)36 77 85
16)72 65 97

Posted: Fri Dec 19, 2003 11:53 pm
by pavelph
Hello!
Can anybody give outputs for 1<=N<=20? -I can`t understand what answer will for N=4: 0 4 or 0 2. Thanks.

Posted: Sat Dec 20, 2003 8:15 pm
by pavelph
Oh, hello. Sorry me for worring you
I`m already getting Accepted 8) [/b]

106 - Wrong Examples?

Posted: Fri Apr 23, 2004 3:09 am
by cthompson
I am working on problem 106, the program seems to work correctly, except my output is different to the sample output.

input:
10
25
100

my output:
1 4
4 9
36 27

sample output:
1 4
4 9
16 27

I tailored the program to print out all the hits to see why I counted 36 and the sample counted only 16. After looking through all of them, I could see no valid reason, does anyone have any insight?

(pow((double)ii, 2.0) --> Is there a better way?

Posted: Fri Apr 23, 2004 3:11 am
by cthompson
I am wanting to square some numbers (for problem 106).

ie

5^2

However the only way that I can see to do it is to use the pow function.

I tried ii^2, however errors where returned.

Does anyone know a better (faster) way?

Posted: Fri Apr 23, 2004 3:22 am
by cthompson
I am so dumb. I can't believe I asked that.

Please ignore my question.

I couldn't see the forest for the trees.

*grin*....