960 - Gaussian Primes

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

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

960 - Gaussian Primes

Post by Jan » Mon Nov 20, 2006 10:19 pm

I m getting WA. But cant find any reason. My method is...

Code: Select all

My method is right, But slow...
Is my method wrong? Or I have missed something. Thanks in advance.
Last edited by Jan on Mon Nov 20, 2006 10:31 pm, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage

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

Post by rio » Mon Nov 20, 2006 10:22 pm

Did you see the "Bugs and suggestions"?

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

Post by Jan » Mon Nov 20, 2006 10:29 pm

Thanks......

:evil: :evil: :evil: .... what can I say...
Ami ekhono shopno dekhi...
HomePage

joy
New poster
Posts: 48
Joined: Wed Oct 18, 2006 1:00 pm
Location: Dhaka, Bangladesh
Contact:

960 I/O

Post by joy » Wed Nov 22, 2006 11:50 am

I got WA, but don't know why......

please give me some input output..
thankss
form kisui na ... class tai asol....
iF U hv d class u get the form....

Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Post by Wei-Ming Chen » Sun Nov 26, 2006 4:56 pm

Code: Select all

7
1 1
7 7
85 41
23 -45
-7 0
-13 0
62 -7

Code: Select all

P
C
C
C
P
C
C

coolguy
New poster
Posts: 30
Joined: Tue Oct 17, 2006 5:59 pm

Post by coolguy » Sun Dec 03, 2006 3:21 am

How to solve this problem ? any hints will be appreciated
bye
In good company

replicon
New poster
Posts: 2
Joined: Sun Feb 04, 2007 9:11 pm

Post by replicon » Sun Feb 11, 2007 12:04 am

This problem is giving me grief, but I can't figure out why. Can someone please post their output for this randomly-generated test input?

Code: Select all

50
886 -617
6915 2777
8335 -2207
-9508 -4614
-8579 6649
27 -7638
-9941 -1310
3926 7763
-6574 -9460
5736 -828
5368 -4789
6429 -7433
-8470 -4218
-4877 -7138
-6865 4067
9802 3929
-6942 4022
8167 3069
8456 -8607
8042 5011
7373 6229
-5081 -5579
8537 3784
4324 5198
-5630 8315
-6474 -3587
-1020 6091
-8127 9956
9170 -3138
7281 -3004
-9075 -7695
6327 7084
-3495 -9664
-8271 846
-4143 -8687
3895 6124
-9455 9582
3367 8814
364 5434
3750 -5957
-3192 1087
-2822 7276
3584 5788
-7349 -4597
2399 2754
5060 9932
3368 -324
12 -2261
8586 6226
7539 -1906
Thanks!

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

Post by Jan » Sun Feb 11, 2007 1:07 am

My accepted code returns

Output:

Code: Select all

C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
P
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
Hope it helps.
Ami ekhono shopno dekhi...
HomePage

replicon
New poster
Posts: 2
Joined: Sun Feb 04, 2007 9:11 pm

Post by replicon » Sun Feb 11, 2007 3:11 am

Thanks very much, that did help. I had a stupid operator precedence issue that was only visible with big numbers.

yiuyuho
A great helper
Posts: 325
Joined: Thu Feb 21, 2002 2:00 am
Location: United States
Contact:

Post by yiuyuho » Wed Jun 13, 2007 10:29 pm

What methods did you guys use? Is this suppose to be an easy problem?

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

Post by Jan » Wed Jun 13, 2007 11:48 pm

I don't know whether there exists a simple method or not. My method is not so easy. If you really want to know that, PM me.
Ami ekhono shopno dekhi...
HomePage

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Thu Jun 14, 2007 2:13 am

That depends on what you call simple :)
There's a method that is as easy as ordinary prime detection. You may want to google for it.
The biggest problem with most problems is not how to solve the problem, but how to not solve what is not the problem.

mukeshtiwari
Learning poster
Posts: 63
Joined: Tue Mar 07, 2006 6:51 pm
Location: india

Post by mukeshtiwari » Sat Jun 23, 2007 11:18 am

For those who did not solve the problem i found a link
http://www.jimloy.com/algebra/gprimes.htm . this problem is actually very nice.
hope it will be helpful and most of you will find some hidden beauty of number theory.

Post Reply

Return to “Volume 9 (900-999)”