Search found 33 matches

by Khaled_912
Thu Apr 24, 2008 7:00 pm
Forum: Volume 114 (11400-11499)
Topic: 11438 - Integer Transmission EXTREME
Replies: 1
Views: 866

Re: 11438 - Integer Transmission EXTREME

nevermind... I got it. It has a O(number_of_zeros * number_of_ones) solution. Here are some extra cases if anyone might need them: Input: 1000 1000 1 1000 1000 298347928379879798798720 1000 1000 999999999999999999999999999999999 Output: Case 1: 1000 1 535754303593133660474212524530000905280702405852...
by Khaled_912
Thu Apr 24, 2008 1:42 pm
Forum: Volume 114 (11400-11499)
Topic: 11438 - Integer Transmission EXTREME
Replies: 1
Views: 866

11438 - Integer Transmission EXTREME

Any ideas on this one? Finding the minimum and the maximum is an easy task, but counting isn't. I thought about many DP approaches, but none seems to work. Any hints please?
by Khaled_912
Mon Apr 21, 2008 9:26 pm
Forum: Volume 114 (11400-11499)
Topic: 11444 - Sum
Replies: 8
Views: 1747

Re: 11444 - Sum

I understood how to deduce the answer from the partial sums when K = 1, but I failed to generalize it for K > 1.
How can the binomial expansion help me here?
by Khaled_912
Mon Apr 21, 2008 3:40 pm
Forum: Volume 114 (11400-11499)
Topic: 11446 - Where is the 'back' button?
Replies: 17
Views: 3418

Re: 11446 - Where is the 'back' button?

We choose some leaves and make sure every node could reach at least one of them.
(and choose some roots to make sure every node could be reached from them)
I don't quite understand what you mean by this, can you elaborate more please?
by Khaled_912
Mon Sep 17, 2007 8:41 am
Forum: General
Topic: New system is coming!
Replies: 13
Views: 8354

Thanks for your concern :) I'll let you know if I have some more comments. About the 'speed' issue. Using mozilla firefox the website loads pretty quick, it's only the statistics bar that takes time to load after the page is displayed. Using IE, the page isn't fully displayed untill all the image ba...
by Khaled_912
Sun Sep 16, 2007 9:29 am
Forum: General
Topic: New system is coming!
Replies: 13
Views: 8354

I agree with all of you, and I hope one of the new website admins read this. The new online judge is just great, specially now it supports java 1.6 and g++ 4.1.2 (No more unusual compilation errors 8) ), in addition, now with a single log-in I can submit many times without having to rewrite my ID. H...
by Khaled_912
Wed Apr 11, 2007 6:09 pm
Forum: Volume 6 (600-699)
Topic: 663 - Sorting Slides
Replies: 18
Views: 10825

Here's the test case that Andrian has mentioned:

Code: Select all

5
0 10 0 10
0 10 0 10
0 8  0 8
0 5 0 5
0 4 0 4

9 9
9 9
7 7
1 1
1 1
My program outputs (C, 3) and I keep getting WA.
Any more test cases plz?
by Khaled_912
Sat Apr 07, 2007 7:06 pm
Forum: Volume 111 (11100-11199)
Topic: 11114 - Polygon Encoder
Replies: 9
Views: 5989

any test cases plzz ??
by Khaled_912
Fri Apr 06, 2007 2:44 pm
Forum: Volume 111 (11100-11199)
Topic: 11114 - Polygon Encoder
Replies: 9
Views: 5989

but wouldn't the sqrt of a bignum need to be calculated using binary search as well ?? do u know an efficient implementation for calculating the sqrt of a bignum?? I've seen some algorithms such as "pell's equation", but binary search proves to be much faster...
by Khaled_912
Thu Apr 05, 2007 6:06 pm
Forum: Volume 111 (11100-11199)
Topic: 11114 - Polygon Encoder
Replies: 9
Views: 5989

The problem is all about writing the decode function.. the rest is straight forward. I'm getting TLE... Here's my decode function, which decodes a value 'p' into the corresponding row and column 'r' and 'c': void decode(type p, type& r, type& c) { type l = 0; type h = p + 1; while(1 < h - l) { type ...
by Khaled_912
Thu Mar 15, 2007 8:28 pm
Forum: Volume 111 (11100-11199)
Topic: 11109 - Rinse
Replies: 8
Views: 3092

I think I totally failed to do the analysis, even after I found the source code which distributes the average value of (vb+vw-vr)/k, I didn't understand why this is correct. Any explanation plz ??
by Khaled_912
Tue Mar 13, 2007 10:39 am
Forum: Off topic (General chit-chat)
Topic: Let's try to keep this forum useful for everyone!
Replies: 13
Views: 22293

Re: Divide the forum

I think it would be fine, if we divide every volume (say starting from CXII) in 100 sections for every problem, then divide these sections in a few parts(for example WA, TLE). So, if somone have an error ERROR on problem PROBLEM, he must read the section PROBLEM->ERROR, and if that doesn't help, th...
by Khaled_912
Tue Mar 13, 2007 10:18 am
Forum: Volume 111 (11100-11199)
Topic: 11109 - Rinse
Replies: 8
Views: 3092

but is the assumption that from the 2nd uptill the Kth rinse will use the same amount of water correct?
by Khaled_912
Mon Mar 12, 2007 11:16 pm
Forum: Volume 111 (11100-11199)
Topic: 11109 - Rinse
Replies: 8
Views: 3092

Still WA...
Correct me if I'm wrong, but I assume that all rinses use the same amount of water... except the first rinse which I use ternary search to calculate.
by Khaled_912
Mon Mar 12, 2007 9:07 am
Forum: Volume 111 (11100-11199)
Topic: 11109 - Rinse
Replies: 8
Views: 3092

Thanks for your... uhh.. *cool* hint :D It made me realize that my old greedy solution wasn't correct.
It came to my mind to use ternary search, but I ended up getting WA (but your test data matched). Please see if you can post some more test cases.

Go to advanced search