Search found 162 matches

by newton
Thu Aug 09, 2007 7:43 am
Forum: Volume 4 (400-499)
Topic: 478 - Points in Figures: Rectangles, Circles, Triangles
Replies: 44
Views: 10615

i tried but cant find the bug. please help me where is my faults. why this code does not give me write output??? #include <stdio.h> #include <string.h> #define LD long double struct rect{ char c; LD upp_left_x; LD upp_left_y; LD low_right_x; LD low_right_y; }; struct circle{ LD x0; LD y0; LD redius;...
by newton
Wed Aug 08, 2007 7:57 am
Forum: Volume 4 (400-499)
Topic: 478 - Points in Figures: Rectangles, Circles, Triangles
Replies: 44
Views: 10615

i have solved 476 and 477 easily but here is a problem with triangle. do you think this functions works well. inline int is_in_left(LD x1,LD y1, LD x2, LD y2, LD x3, LD y3) { LD area; area = 0.5 * (x1*(y2-1)*(y3-1) - y1*(x2-1)*(x3-1) + (x2-y3)*(x3-y2)); if(area <= 0) return 0; else return 1; } inlin...
by newton
Tue Aug 07, 2007 6:21 am
Forum: Volume 4 (400-499)
Topic: 476 - Points in Figures: Rectangles
Replies: 87
Views: 7722

i cant find out any bugs. If you can please check it. WA WA WA... #include <stdio.h> #include <string.h> struct rect{ long double upp_left_x; long double upp_left_y; long double low_right_x; long double low_right_y; }; struct fig{ long double x; long double y; }; char c; int main() { rect array[100]...
by newton
Sun Jul 29, 2007 3:05 pm
Forum: Volume 103 (10300-10399)
Topic: 10347 - Medians
Replies: 32
Views: 14061

just change the condition

Code: Select all

if(a<0||b<0||c<0)
to:

Code: Select all

if(area <= 0)
and also use Long double
check spelling b4 submit....


hope that help
by newton
Wed Jul 25, 2007 7:39 am
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31647

mr ishtiaqq,

you needn't count upto i<SIZE for the outer loop.
if you replaced:

Code: Select all

the condition i<SIZE
into:
i<= sqrt(SIZE)

it will work good as you want.
by newton
Mon Jul 23, 2007 3:26 pm
Forum: Off topic (General chit-chat)
Topic: if u need specific type problem...
Replies: 1
Views: 26540

if u need specific type problem...

i would like to solve permutation related problems.
may you give me some link....???





thanx
by newton
Mon Jul 23, 2007 2:44 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 36756

Code: Select all


    ACCEPTED

abdullah how it can be?? may u explaine in brief???

thanx in advanced
by newton
Sun Jul 22, 2007 3:59 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 31585

why wrong answer. need inputs and outputs. /* Author : Newton Problem name : Permutation array [482] Algorithm : Simple string, strtok */ #include <stdio.h> #include <string.h> #include <stdlib.h> char strings[20000][50],str[100000]; int num[20000]; int main() { int test,i,j; char *p; //freopen("inp...
by newton
Sun Jul 22, 2007 1:53 pm
Forum: Volume 1 (100-199)
Topic: 146 - ID Codes
Replies: 35
Views: 5733

i am extremely sorry. it was a chilly mistake [spelling mistake]. but it should be WA!
why PE??
by newton
Sun Jul 22, 2007 12:55 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 17075

i cant find the point like jojo.
may you help explaining it elaborately....



thanx
by newton
Sun Jul 22, 2007 12:43 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 36756

thanx to all.

Code: Select all

  Accepted
by newton
Sun Jul 22, 2007 12:35 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22649

thank you jainal.
you are really a genish!!!
by newton
Sat Jul 21, 2007 2:24 pm
Forum: Volume 9 (900-999)
Topic: 900 - Brick Wall Patterns
Replies: 16
Views: 9134

i got ACCEPTED both of the problem. now my question??

1. if fibo[m][n];
what should be the value of m and n for minimum memory
in the both problem??



thanx in advanced
by newton
Sat Jul 21, 2007 1:00 pm
Forum: Volume 9 (900-999)
Topic: 900 - Brick Wall Patterns
Replies: 16
Views: 9134

Code: Select all


  ACCEPTED

by newton
Thu Jul 19, 2007 12:51 pm
Forum: Volume 4 (400-499)
Topic: 438 - The Circumference of the Circle
Replies: 29
Views: 9391

shihabrc

first try to check the sample input output in the problem carefully. if okey but WA then use forum.
try this
input:

Code: Select all

0.0 0.0 -1.0 7.0 7.0 7.0
output:

Code: Select all

31.42

and also try to print.....

Code: Select all

 "%.2Lf\n"
.

mind that %Lf is for long double, %lf is for double.

hope that helps

Go to advanced search