Search found 17 matches

by Lawrence
Mon Jul 15, 2002 1:20 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 8061

Oh, that's it. Your phone array should have a size of 9, to include the null-terminator.

And your program prints 0.6, not 0.60 in my computer. Dunno if it is the problem.
by Lawrence
Sun Jul 14, 2002 11:45 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 8061

1. Do you need to null terminate your 'phone' variable?

2. You need to print 0.60 if the money is 0.6
by Lawrence
Wed Jul 10, 2002 3:59 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 8061

I am quite confused by ur code. [cpp]StartH = (TimeSH[0] - 48) * 10 + TimeSH [1] - 48; StartM = (TimeSM[0] - 48) * 10 + TimeSM [1] - 48; EndH = (TimeEH[0] - 48) * 10 + TimeEH [1] - 48; EndM = (TimeEM[0] - 48) * 10 + TimeEM [1] - 48; [/cpp] What is this kind of things? I figure the input times work o...
by Lawrence
Mon Jun 03, 2002 2:37 pm
Forum: Volume 102 (10200-10299)
Topic: 10291 - Cut the Legs
Replies: 3
Views: 2434

The problem description is really opaque. I didn't even realized it was such a problem in the contest!

HINT: It has something to do with gravity.
by Lawrence
Fri Apr 19, 2002 11:33 am
Forum: Volume 102 (10200-10299)
Topic: 10258 - Contest Scoreboard
Replies: 87
Views: 34563

Adrian: tried on my machine with multiple spaces, my program handles them correctly. So the problem must be hiding somewhere else.
by Lawrence
Fri Apr 19, 2002 11:28 am
Forum: Volume 1 (100-199)
Topic: 173 - Network Wars
Replies: 29
Views: 2709

I don't know why you get WA, but the following is my 'moving sequence', since I got accepted, it might help.

1. Move paskill.
2. If paskill trapped print
3. Move lisper.
4. If lisper destroyed print
5. If both annihilated print
6. If lisper trapped print
by Lawrence
Wed Apr 17, 2002 1:45 pm
Forum: Volume 102 (10200-10299)
Topic: 10258 - Contest Scoreboard
Replies: 87
Views: 34563

10258 Multiple input issues

Is this code enough to handle the multiple input in 10258? [cpp]void main() { #ifdef ONLINE_JUDGE FILE *fp=stdin; #else FILE *fp=fopen("b.in","r"); #endif int n,p,t; int i; char l; int j; char buf[100]; fgets(buf,100,fp); sscanf(buf,"%d",&j); fgets(buf,100,fp); while(j>0) { //......initializations w...
by Lawrence
Sat Apr 13, 2002 5:16 am
Forum: Volume 1 (100-199)
Topic: 168 - Theseus and the Minotaur
Replies: 64
Views: 7600

Maybe I should post my code here and someone would like to help. :oops: #include <stdio.h> int laby[26][26]; int candle[26]; int count[26]; int theseus; int minotaur; int k; void chase() { int i,j; int ct=0; j=0; while(1) { ct=count[minotaur]; for(i=0;i<ct;i++) { if(!candle[laby[minotaur] ] && laby[...
by Lawrence
Tue Apr 02, 2002 5:05 pm
Forum: Volume 1 (100-199)
Topic: 168 - Theseus and the Minotaur
Replies: 64
Views: 7600

This seems to be a very easy problem but I have been getting wrong answer. I have tried several cases and they all work very well. So reading the program specification again I'm now wondering what should Theseus do if the Minotaur is approaching(i.e. starts) Theseus in a one-direction passage, that ...
by Lawrence
Sat Mar 30, 2002 9:41 am
Forum: Volume 1 (100-199)
Topic: 139 - Telephone Tangles
Replies: 66
Views: 8289

And if you still cannot get passed, look at the previous post on this problem and you will find it.
by Lawrence
Thu Mar 07, 2002 4:47 am
Forum: Volume 1 (100-199)
Topic: 133 - The Dole Queue
Replies: 42
Views: 5713

Well that's easy, just try to input
1 1 1
and find it out yourself.
:smile:
by Lawrence
Sun Mar 03, 2002 4:03 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 21320

Hi, just look back at the previous thread of this problem, I have explained this phenomena a little there.
by Lawrence
Wed Feb 27, 2002 5:16 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 21320

I don't know, I can't understand your code to calculate the table (though I just did this problem today!), should j increment only 1? But I must point out that using (int) (amount * 100) is a dangerous thing, I have had times when the value was stored as 54.999987 while it should be 55, and (int) ma...
by Lawrence
Sat Feb 23, 2002 4:04 pm
Forum: Volume 1 (100-199)
Topic: 139 - Telephone Tangles
Replies: 66
Views: 8289

You are right, and I've got a P.E. now! Thanks very much.
by Lawrence
Sat Feb 23, 2002 3:56 pm
Forum: Volume 1 (100-199)
Topic: 140 - Bandwidth
Replies: 49
Views: 7582

How fast would you want? My complete search algorithm only runs 0.47 sec, this is enough for me.

Go to advanced search