## Search found 37 matches

Sat Mar 12, 2005 8:56 am
Forum: Volume 108 (10800-10899)
Topic: 10823 - Of Circles and Squares
Replies: 50
Views: 10960

### Re: precision error..

sohel wrote:watch out for precision error...

11 / 2 = 5.49999999999999 and not 5.50000000000000
So add necessary eps to handle this case.
I think this can be solved by:

Code: Select all

``````double ar = R / inCount + 0.5;
int iar = (int)ar;``````
When I participate the contest, this problem really confuses me....>"<
Mon Nov 03, 2003 7:44 am
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31902
Cound anyone help with my code? ><" I try many cases, but still can't find the problem. #include<stdio.h> typedef struct { int digitprimestate; long key; }NUM; NUM array[1000002]; int primestate[1000002]; long getdigitnum(long n); int main() { long digitprimecount = 2; long cases; long left,right; l...
Thu May 01, 2003 6:46 pm
Forum: Volume 3 (300-399)
Topic: 375 - Inscribed Circles and Isosceles Triangles
Replies: 19
Views: 2723
The following is my code.I got P.E. If you got W.A.,you may check it with my code. However,could anyone tell me about the standard I/O form. Why I got P.E. #include<stdio.h> #include<math.h> int main() { double r,total; double H,B; int cases; double pi=2.0*acos(0.0); int nl=0; scanf("%d",&cases); wh...
Thu May 01, 2003 6:44 pm
Forum: Volume 3 (300-399)
Topic: 375 - Inscribed Circles and Isosceles Triangles
Replies: 19
Views: 2723
The following is my code.I got P.E. If you got W.A.,you may check it with my code. However,could anyone tell me about the standard I/O form. Why I got P.E. #include<stdio.h> #include<math.h> int main() { double r,total; double H,B; int cases; double pi=2.0*acos(0.0); int nl=0; scanf("%d",&cases); wh...
Thu May 01, 2003 6:41 pm
Forum: Volume 3 (300-399)
Topic: 375 - Inscribed Circles and Isosceles Triangles
Replies: 19
Views: 2723
The following is my code.I got P.E. If you got W.A.,you may check it with my code. However,could anyone tell me about the standard I/O form. Why I got P.E. #include<stdio.h> #include<math.h> int main() { double r,total; double H,B; int cases; double pi=2.0*acos(0.0); int nl=0; scanf("%d",&cases); wh...
Thu May 01, 2003 6:39 pm
Forum: Volume 3 (300-399)
Topic: 375 - Inscribed Circles and Isosceles Triangles
Replies: 19
Views: 2723
The following is my code.I got P.E. If you got W.A.,you may check it with my code. However,could anyone tell me about the standard I/O form. Why I got P.E. #include<stdio.h> #include<math.h> int main() { double r,total; double H,B; int cases; double pi=2.0*acos(0.0); int nl=0; scanf("%d",&cases); wh...
Mon Mar 31, 2003 6:53 pm
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 8861
Thank you very much!!!!

I miss this mistack...........

Thanks again....
Mon Mar 31, 2003 10:46 am
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 8861
hmm..I test the input sample you modified.My ouput is following:

Code: Select all

``````abcd

There is no such word.

abcd

There is no such word.
``````
Is it correct?
Sat Mar 29, 2003 4:42 pm
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 8861
blank line ??
I print a blank line between cases.

Code: Select all

``````if(nl) printf("\n");
else nl=1;
``````
Is there any wrong??
By the way,if there is only blank line's error and my answer is correct,the system should judge me P.E.

Anyway,thx.
Sat Mar 29, 2003 6:19 am
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 8861

### 10126 Zipf's Law (WA)

I use binary tree to save the datas and "inorder" to print out the answers. But I got W.A. .Could anyone will help me with my code,or send me the sample I missed.Thx. [c] #include<stdio.h> #include<ctype.h> #include<string.h> #include<stdlib.h> struct TREE{ int count; char *alpha; struct TREE *left,...
Sun Feb 16, 2003 1:37 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 20243

Could anyone tell me why I got P.E.

Is there any wrong about the presentation?

I see only 18 Accepted and many (P.E.)s
Thu Feb 06, 2003 6:01 pm
Forum: Volume 3 (300-399)
Topic: 357 - Let Me Count The Ways
Replies: 90
Views: 7559
This code is almost correct.
But try "99"

I think the answer is 252.
Wed Jan 29, 2003 2:10 pm
Forum: Volume 3 (300-399)
Topic: 333 - Recognizing Good ISBNs
Replies: 166
Views: 21797

I got AC(P.E.) with this problem 333. But I can't find any wrong.I think the "(in)correct." is not the problem. This is my thougt: Ignore the spaces in front of the string,and output the followings. char temp[100],prob[100],*p; int i; gets(temp); i=0; p=temp; while(isspace(temp[i])) i++; strcpy(prob...
Tue Jan 14, 2003 2:41 am
Forum: Volume 4 (400-499)
Topic: 496 - Simply Subsets
Replies: 48
Views: 9273
input: (1) 1 1 1 (2) 1 1 1 (3) 1 1 1 1 (4) (5) 1 (6) 1 (7) 1 3 2 1 2 3 (8) 1 3 2 1 1 2 3 output: (5) B is a proper subset of A (6) A is a proper subset of B (1),(2),(3),(4),(7),(8)=> equal ps. I am not sure if the judge will have the tests as the (4),(5),(6). If you want to check with my source code...
Sun Jan 12, 2003 3:35 am
Forum: Volume 101 (10100-10199)
Topic: 10188 - Automated Judge Script
Replies: 58
Views: 30810
Oh , I see . Thank you very much!