Search found 143 matches

by angga888
Mon Nov 14, 2005 1:37 pm
Forum: Volume 109 (10900-10999)
Topic: 10975 - Dueue's Quiz
Replies: 39
Views: 16486

little joey wrote:Yes, duplicates occur in the dictionary, but they should be printed only once in the output.
Wow... I 'accidentally' handled such case without knowing it :o I was so lucky.... :wink:
by angga888
Mon Nov 14, 2005 1:31 pm
Forum: Algorithms
Topic: Flood Fill problem
Replies: 8
Views: 6117

Re: Flood Fill problem

Btw, which problem that use floodfill function to solved/finished the problem? I need some... thanx for advance... Some problems that can be solved using flood fill: 352 - The Seasonal War 469 - Wetlands of Florida 572 - Oil Deposits 657 - The die is cast 776 - Monkeys in a Regular Forest 782 - Con...
by angga888
Sun Nov 13, 2005 6:06 pm
Forum: Volume 101 (10100-10199)
Topic: 10192 - Vacation
Replies: 58
Views: 14387

I think that you should change your input reading method. You can read one line using gets(). I have changed your code using gets() and it was not OLE anymore.

Hope it helps :D
by angga888
Sun Nov 13, 2005 10:35 am
Forum: Volume 109 (10900-10999)
Topic: 10973 - Triangle Counting
Replies: 31
Views: 13291

Wei-Ming Chen wrote:I used bool[3001][3001], is this too big?
No, my solution also uses such array. :D
by angga888
Sun Nov 13, 2005 8:49 am
Forum: Volume 109 (10900-10999)
Topic: 10960 - The Party, Part II
Replies: 4
Views: 2223

I haven't looked at your code, but:
kp wrote:Also I implemented various features like trim() to correct
input (just in case).
I didn't check for the input validity, so I think the judge input should be correct (at least it works well with scanf() and gets() in C).
by angga888
Sat Nov 12, 2005 10:19 pm
Forum: Volume 109 (10900-10999)
Topic: 10960 - The Party, Part II
Replies: 4
Views: 2223

Re: 10960 - The Party, Part II

I've got it AC. Now, I will answer my own questions (hopefully some of you will find them useful :D ). May I assume that in the input, the persons will always be represented as consecutive letters starting from 'A'? May I assume that in the input, the items will always be represented as consecutive ...
by angga888
Sat Nov 12, 2005 8:06 pm
Forum: Volume 109 (10900-10999)
Topic: 10946 - You want what filled?
Replies: 38
Views: 18090

Roby wrote:But the new question is.. how to make floodFill function iteratively?
We can convert recursive floodfill into iterative by using BFS :D
by angga888
Sat Nov 12, 2005 7:54 pm
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 23631

If number only has 1 divisor, should i output "bla bla bla has 1 divisor" or "bla bla bla has 1 divisors" According to the problem description: Print the text 'Between L and H, P has a maximum of D divisors.', where L, H, P, and D are the numbers as defined above. I think the output should still be...
by angga888
Sat Nov 12, 2005 7:48 pm
Forum: Volume 109 (10900-10999)
Topic: 10960 - The Party, Part II
Replies: 4
Views: 2223

10960 - The Party, Part II

I've tried this problem, and got WA over and over. I have several questions as follow: May I assume that in the input, the persons will always be represented as consecutive letters starting from 'A'? May I assume that in the input, the items will always be represented as consecutive integers startin...
by angga888
Sat Nov 12, 2005 7:15 pm
Forum: Volume 109 (10900-10999)
Topic: 10975 - Dueue's Quiz
Replies: 39
Views: 16486

My output is: Test Case #1 Query #1 a 72 Query #2 bb 40 bbb 16 Query #3 I count a single character as 8 occurences (just like the 'madam' example), therefore I get 72 for the input 'a'. Btw, oops... :oops: I forgot to check for multiple words in the list, but fortunately maybe there is no such case ...
by angga888
Fri Nov 11, 2005 2:32 pm
Forum: Volume 8 (800-899)
Topic: 836 - Largest Submatrix
Replies: 19
Views: 8860

Here is the hint: Let sum[row][col] be the summation of all elements from the top left corner of the matrix (0,0) up to the (row, col) position. If you want to count the summation of elements between position (x1,y1) and (x2,y2) where x1<x2 and y1<y2, then you only need to calculate sum[x2][y2]-sum[...
by angga888
Fri Nov 11, 2005 7:41 am
Forum: Volume 8 (800-899)
Topic: 836 - Largest Submatrix
Replies: 19
Views: 8860

Re: 836 - Largest Submatrix

Roby wrote:Any idea how to solve this problem?
Is there something related to floodfill + math method to solve this one?
I don't know about how to solve this problem using floodfill+math, but you can try to use the same algorithm as problem 108 (Maximum Sum). :wink:
by angga888
Tue Oct 25, 2005 7:03 pm
Forum: Volume 109 (10900-10999)
Topic: 10941 - Words adjustment
Replies: 19
Views: 6121

And I'd like to ask, are there empty lines in the input? I use scanf(" %s",...) to read words, could this be a problem? From the problem description: All words use only lowercase letters and contain between 1 and 1000 characters. I think empty string should not be possible. Besides, I also used sca...
by angga888
Mon Oct 24, 2005 9:03 am
Forum: Volume 109 (10900-10999)
Topic: 10941 - Words adjustment
Replies: 19
Views: 6121

Hi, does anyone know the time limit of this problem during the contest?

:D
by angga888
Thu Aug 25, 2005 10:12 pm
Forum: Volume 104 (10400-10499)
Topic: 10440 - Ferry Loading II
Replies: 10
Views: 7261

Re: 10440 please help

vcchung wrote:I am not very good at programming, but I am learning.

When I try to do 10440, but I found that it has many variations so that difficult to finish it.

Can anyone please give me some ideas, guidelines or algorithm for this problem??

Many thanks!
think about greedy algorithm :D

Go to advanced search