Search found 481 matches

by Martin Macko
Tue Sep 12, 2006 11:28 pm
Forum: Volume 110 (11000-11099)
Topic: 11088 - End up with More Teams
Replies: 30
Views: 17488

I solved it using both DP and greedy. Greedy is as follows: 1. Take one guy with maximum value 2. Take two appropriate guys with minimum sum of values However, I have not proved it. This greedy should not pass the judge, as it does not work for the following input: 9 8 8 7 7 7 7 6 6 4 0 In the firs...
by Martin Macko
Tue Sep 12, 2006 11:10 pm
Forum: Volume 1 (100-199)
Topic: 120 - Stacks of Flapjacks
Replies: 118
Views: 13268

Re: 120 Problem

Disatoba wrote:HI I got WA in problem 120, i dont know why? would someone help me with any test cases or ideas for to get AC?
Thanks!
Post your question to the forum about problems from the set I. This forum is about problems with java.
by Martin Macko
Sun Sep 10, 2006 4:05 pm
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 17689

Re: need some explaination

i cant understand the problem.. can any one explain it with i/o ... plssss it will help mee I can give you an example of few first composite primes: 4 , 6 , 9 , 10 , 14 , ... The numbers 1 , 2 , 3 , 5 , 7 , 11 , 13 are not composite, therefore they are not composite primes. The numbers 8 and 12 hav...
by Martin Macko
Sun Sep 10, 2006 3:58 pm
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 17689

little joey wrote:Al three are different, and the last one is not the number of input values per case, but the input value itself.
At least that is how I interpret it, and I got AC with it....
Despite I've interpreted it in the same way finally, imho the problem statement says something different :evil:
by Martin Macko
Sun Sep 10, 2006 3:27 pm
Forum: Bugs and suggestions
Topic: <TITLE> TAG INCORRECT
Replies: 3
Views: 2045

Re: <TITLE> TAG INCORRECT

daveon wrote:For some problems (11078), the title tag is showing the title of another problem.
Well... there are a lot of problems with their title tags showing titles of other problems...
by Martin Macko
Sun Sep 10, 2006 3:25 pm
Forum: Volume 110 (11000-11099)
Topic: 11087 - Divisibility Testing
Replies: 36
Views: 18044

Hisoka wrote:Ouu, ic ... You can doing 2 N + K algo without sorting before ...

Thanks
My algo sorts the numbers at the beginning and runs in about 8.7s.
by Martin Macko
Sat Sep 09, 2006 9:05 pm
Forum: Volume 108 (10800-10899)
Topic: 10828 - Back to Kernighan-Ritchie
Replies: 20
Views: 14742

sclo wrote:I have a question, how many equations do we need to solve?
My solution solves n equations with n unknowns.
by Martin Macko
Sat Sep 09, 2006 8:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11087 - Divisibility Testing
Replies: 36
Views: 18044

It seems there is no input where the output doesn't fit in a 32 bit integer. At least under the assumption that you got accepted with long long. I got accepted with int. Well, I've corrected both bugs at once, so possibly there are be no such inputs in the judge. Anyway, the constraints allow such ...
by Martin Macko
Sat Sep 09, 2006 8:48 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 11313

Hello everyone! I've tried all the input avaliable in this thread and my code seems to work with them, except for that one from mamud, I think, where there are edges that connect vertexes beyond the limit previously given. Anyway, I just keep getting WA. Here is my code, can anyone tell me where is...
by Martin Macko
Sat Sep 09, 2006 8:34 pm
Forum: Volume 110 (11000-11099)
Topic: 11087 - Divisibility Testing
Replies: 36
Views: 18044

11087 - Divisibility Testing

To help people who have troubles with this problem, note, that the answer doesn't have to fit to 32bit integer (as the answer may be as big as 10^5*(10^5-1)/2). My other bug was, that at first I didn't realise that -7%4=-3 a not 1. :-?
by Martin Macko
Thu Sep 07, 2006 2:06 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 11313

Re: bipartite

By the way I would be blessed to get some useful links on Graphs, speciallly bipartite and its properties. Also some links for maximum matching algorithm... ohh the list is already too long.. :lol: please someone forward it if possible :oops: can anyone give some links please :cry: You can google i...
by Martin Macko
Thu Sep 07, 2006 1:49 pm
Forum: Volume 110 (11000-11099)
Topic: 11081 - Strings
Replies: 35
Views: 19476

Re: Lack of certain input?

StatujaLeha wrote:
Vexorian wrote:If I am not mistaken, for the case:
1
aaa e e

The output should be 1, right?
my solution outputs 1.
Yes, the correct answer is 1, as the empty string is also a valid subsequence of the string "aaa".
by Martin Macko
Sat Sep 02, 2006 11:26 pm
Forum: Volume 110 (11000-11099)
Topic: 11083 - Zeroes Revisited
Replies: 13
Views: 6426

Re: 11083 : Zeroes Revisited

Ashkankhan wrote:is there any idea about this problem?
First, think what is the statement that b is always a square free number good for. Afterwards... find the formula 8)
by Martin Macko
Sat Sep 02, 2006 11:20 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 11313

Re: final hint please

I programmed maximum matching and was sure it is correct, but can not get my solution AC. Wish i new what is my problem and why there were so many resubmitions during the contest. Consider the following graph: 0 - 1 , 2 - 1 , 1 - 3 , 3 - 4 and 3 - 5 . It's maximum matching is 2 , but you need 3 gua...
by Martin Macko
Sat Sep 02, 2006 10:36 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 11313

Re: final hint please

vinay wrote:n/2 ??
Actually not, consider the graph K1,7 (complete bipartite graph with one vertex in the first partition and seven vertices in the second partition). It has 8 vertices, and just one gruard is enough.

Go to advanced search