Search found 8 matches

by bill8124
Sun Mar 10, 2013 7:20 pm
Forum: Volume 103 (10300-10399)
Topic: 10360 - Rat Attack
Replies: 19
Views: 44587

Re: 10360 - Rat Attack

I think going through the array is slow because there might be many entry which is 0. My method is similar to lskull's but more faster: 1. Create an array [1025,1025], each entry contains how many rats will be killed if we put the bomb at this location. 2. Maintain best location (x, y) for bomb, ini...
by bill8124
Sat Mar 09, 2013 9:14 pm
Forum: Volume 104 (10400-10499)
Topic: 10420 - List of Conquests
Replies: 68
Views: 25906

Re: 10420 - List of Conquests

I used linked list to solve this problem but made some stupid mistakes before getting AC.
So I provided some I/O below which let me find the problem with my code.
Hope it helps.

Input:

Code: Select all

10
Ta
Tc
Tb
Ac
Ab
Aa
Te
Ar
Am
TT
Output:

Code: Select all

Aa 1
Ab 1
Ac 1
Am 1
Ar 1
TT 1
Ta 1
Tb 1
Tc 1
Te 1
by bill8124
Sat Jul 28, 2012 9:18 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 13484

Re: How to get even number line input???(498,10268)

Use fgets(line1, 200, stdin) instead of gets(line1)
gets() don't do any length control and may cause buffer overflow. (e.g. Write other variables and make an error in your program)
by bill8124
Fri Jul 27, 2012 6:26 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 31462

Re: 482 Permutation Arrays

I got accepted. Several Hints for everyone suffering WA: 1. The number of numbers will not exceed 40000, and there won't be more than 400000 characters in one line. 2. There are no spaces in a number. (i.e. You can use scanf("%s") to read them) 3. Be aware of output. Output for each input instance s...
by bill8124
Tue Jul 17, 2012 2:11 pm
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 21324

Re: 343(What Base is This?)

I've tried all the inputs I found but still received WA. Sample Input 12 5 10 A 12 34 123 456 1 2 10 2 0 0 10 36 35 Z Z 35 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 7FR82OGF 7FR82OGF IGW6NFP IGW6NFP I7U4NK1 I7U4NK1 4NTD52X 4NTD52X NMEP0AI NMEP0AI ID9QJFE ID9QJFE IU0TLAO IU0TLAO 4CY20XP 4CY20XP 2U6OA34 2U6OA34...
by bill8124
Tue Feb 22, 2011 3:25 pm
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 21694

Re: 275

Another Stupid Mistake:
"Output for each input instance (including the last input instance) should be followed by a blank line. "

NOT
"Output for each input instance should be seperated with a blank line. "
I get a WA because of this mistake...
by bill8124
Fri Feb 18, 2011 7:58 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 7489

Thanks, IRA!

In description: "Calls less than a minute are not recorded and no call may last more than 24 hours. "
I miss the case of whole 24 hours! (start time == end time)

again
Thank you, IRA!
by bill8124
Fri Feb 18, 2011 5:59 pm
Forum: Volume 109 (10900-10999)
Topic: 10934 - Dropping water balloons
Replies: 12
Views: 6400

Re:

for k=2, it seems we have just the sequnce 1,2,3,4... what for k=3, 4, ... ? You can try this instead of binary search: f(b,t)=f(b-1, t-1)+1+f(b, t-1) f: the highest floor you can definitely find the floor where the water balloon will burst b: water balloons you have t: the number of times you can ...

Go to advanced search