Search found 38 matches

by eloha
Tue Mar 02, 2004 11:50 am
Forum: Volume 103 (10300-10399)
Topic: 10352 - Count the eWords
Replies: 30
Views: 14299

10352 WA

Can anyone tell me the output for:

cd cde #

Please give me more test data. Thanks.
by eloha
Thu Feb 26, 2004 9:59 am
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 29698

I just modify my sort function and got AC. Why? The following is my new sort function: [c] int sort_function( const void *a, const void *b) { struct s *p=(struct s *)a, *q=(struct s *)b; if(p->inversion != q->inversion) return p->inversion - q->inversion; else return p->serno - q->serno; } [/c]
by eloha
Wed Feb 25, 2004 5:04 am
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 29698

Can anyone tell me what's wrong with my code? [c] #include <stdio.h> struct s { int serno; char dna[51]; int inversion; }a[100]; int n,m; int getdna(char x) { switch(x) { case 'A': return 0; case 'C': return 1; case 'G': return 2; case 'T': return 3; default : abort(); } } int count_sort(char *str) ...
by eloha
Mon Dec 01, 2003 7:40 am
Forum: Volume 104 (10400-10499)
Topic: 10465 - Homer Simpson
Replies: 75
Views: 32429

I got TLE too. Can anyone help me? [c]#include <stdio.h> #include <string.h> int a[10000]; void main() { int t,i,j,k,m,n,temp; while(scanf("%d %d %d",&m,&n,&t)==3) { if(m>n) { temp=m; m=n; n=temp; } /* make sure m<=n */ if(m==1) { printf("%d\n",t); continue; } if(m>t)...
by eloha
Mon Nov 24, 2003 10:06 am
Forum: Volume 5 (500-599)
Topic: 565 - Pizza Anyone?
Replies: 12
Views: 5894

565 Pizza Anyone?

I caculate all the possible combination topping for the constraints.
It works fine. But it is not fast enough. I got TLE. :cry:
Can anyone tell me your idea about this problem?
by eloha
Mon Nov 24, 2003 9:57 am
Forum: Volume 3 (300-399)
Topic: 347 - Run
Replies: 20
Views: 8402

Yes, I do.
I got AC in 7 sec.
by eloha
Fri Jun 20, 2003 5:40 am
Forum: Volume 104 (10400-10499)
Topic: 10499 - The Land of Justice
Replies: 51
Views: 25953

Can anyone tell me what the problem is talking about?

Thanks.
by eloha
Thu Jun 05, 2003 12:34 pm
Forum: Volume 5 (500-599)
Topic: 548 - Tree
Replies: 23
Views: 13690

It got RunTime Error, but I did nothing but input string. [c]#include <stdio.h> #define StrMax 200000000 int main() { char s[StrMax]; while (gets(s)) { /* do nothing */ } }[/c] I don't know why it get Runtime Error if I set the max length of string to 200000000. But when I set the max length of str...
by eloha
Thu Jun 05, 2003 12:25 pm
Forum: Volume 5 (500-599)
Topic: 571 - Jugs
Replies: 24
Views: 15103

My program solved it in 0.1 second using BFS.
by eloha
Tue Jun 03, 2003 11:29 am
Forum: Volume 5 (500-599)
Topic: 548 - Tree
Replies: 23
Views: 13690

I have found what wrong with my code. The error is the input. I am very surprised after I submit the following code. It got RunTime Error, but I did nothing but input string. :evil: [c]#include <stdio.h> #define StrMax 200000000 int main() { char s[StrMax]; while (gets(s)) { /* do nothing */ } }[/c]...
by eloha
Mon Jun 02, 2003 11:19 am
Forum: Volume 5 (500-599)
Topic: 548 - Tree
Replies: 23
Views: 13690

I always got Runtime Error (Invalid memory reference), but I do not know what is wrong. I think this problem is similar to ACM 536 Tree Recovery which I got AC. My algorithm is make the tree by the 2 given inorder and postorder traversal sequences. And then use inorder dfs to travel the tree and fin...
by eloha
Tue May 27, 2003 6:32 am
Forum: Volume 8 (800-899)
Topic: 825 - Walking on the Safe Side
Replies: 38
Views: 25663

However, I still don't understand what "minimal paths" mean in this qq........................ Also, my algorithm isn't very good. If the width and height are large, my program can't handle it...... (P.S. I made use of Floyd-Warshall's Algorithm...) Any suggestions? Any help is warmly wel...
by eloha
Tue May 27, 2003 6:26 am
Forum: Volume 8 (800-899)
Topic: 825 - Walking on the Safe Side
Replies: 38
Views: 25663

route wrote:what is the maximum of "positive integers" in the input ?
(width and height)
100 is enough.
by eloha
Tue May 27, 2003 6:22 am
Forum: Volume 101 (10100-10199)
Topic: 10198 - Counting
Replies: 30
Views: 42262

It's not too hard to see the recurrence relations.. and once you got that, you can easily solve it using DP...
Please tell me more about the recurrence relations. I can't find it. :-?
by eloha
Wed May 21, 2003 12:30 pm
Forum: Volume 101 (10100-10199)
Topic: 10198 - Counting
Replies: 30
Views: 42262

10198 Counting

Can anyone tell me how to solve this?

Go to advanced search