## Search found 8 matches

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

### 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...
Sat Mar 09, 2013 9:14 pm
Forum: Volume 104 (10400-10499)
Topic: 10420 - List of Conquests
Replies: 68
Views: 26275

### 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
``````
Sat Jul 28, 2012 9:18 am
Forum: Volume 4 (400-499)
Topic: 498 - Polly the Polynomial
Replies: 73
Views: 13823

### 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)
Fri Jul 27, 2012 6:26 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 32111

### 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...
Tue Jul 17, 2012 2:11 pm
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 21674

### 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...
Tue Feb 22, 2011 3:25 pm
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 21927

### 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...
Fri Feb 18, 2011 7:58 pm
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 11166

### 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!
Fri Feb 18, 2011 5:59 pm
Forum: Volume 109 (10900-10999)
Topic: 10934 - Dropping water balloons
Replies: 12
Views: 6528

### 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 ...