Search found 78 matches

by Sanny
Sat May 21, 2005 4:23 pm
Forum: Volume 108 (10800-10899)
Topic: 10850 - The Gossipy Gossipers Gossip Gossips
Replies: 11
Views: 2848

Make sure you've sorted the times. That was my problem during contest time.

Regards
Sanny
by Sanny
Tue May 10, 2005 12:08 am
Forum: Volume 108 (10800-10899)
Topic: 10848 - Make Palindrome Checker
Replies: 26
Views: 14841

Check if there is more than one space between inputs. I gave a check like this -

Code: Select all

if (length of 1st string + length of 2nd string + length of number + 2 != length of input line)
return false
Regards
Sanny
by Sanny
Mon Apr 25, 2005 7:01 am
Forum: Algorithms
Topic: A problem
Replies: 9
Views: 1646

This problem is actually more of a timus problem than pku. Peking University Judge just collects problems from different sources and arrange contests every 3/4 days (As far as I have seen in last few months). And also timus usually doesn't allow 64MB of memory :cry: .

Regards
Sanny
by Sanny
Sun Apr 24, 2005 7:44 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 27581

10023 - Square Root

The number can be 1000 digits long. So you just can't do it so simple. You could have done it if the number was at most 15-16 digit I guess. You need to use bigint to solve this problem.

Regards
Sanny
by Sanny
Sun Apr 24, 2005 9:34 am
Forum: Algorithms
Topic: A problem
Replies: 9
Views: 1646

Hi Prince,
My O(n^2) passes the time limit and runs .14 sec in judges input. :D So may be there's some problem with your implementation. You can send me your code to let me see what's the problem or I can send you my code if you like.

Regards
Sanny
by Sanny
Sun Apr 24, 2005 2:17 am
Forum: Volume 4 (400-499)
Topic: 424 - Integer Inquiry
Replies: 96
Views: 20028

Results can be more than 101 digits. :wink:

Regards
Sanny
by Sanny
Sun Apr 24, 2005 2:03 am
Forum: Algorithms
Topic: A problem
Replies: 9
Views: 1646

(n^2) algo: 1. You have a boolean flag array 0...n-1. This indicates which numbers so far can u generate. 2. Input numbers are in the array inp[1..n]. 3. In a loop from 1 to n, you add inp to previously generated numbers to see what new can you generate. All these numbers % n are flagged 1. 4. Whene...
by Sanny
Fri Apr 22, 2005 5:57 pm
Forum: Other words
Topic: The Best Online Contest
Replies: 4
Views: 2078

I liked World Finals Warmup - 2 with so many nice number theory and DP problems. :lol:
by Sanny
Fri Apr 22, 2005 5:46 pm
Forum: Algorithms
Topic: A problem
Replies: 9
Views: 1646

This problem can also be solved using O(N^2) within the time limit.

Regards
Sanny
by Sanny
Fri Apr 22, 2005 11:57 am
Forum: Volume 103 (10300-10399)
Topic: 10330 - Power Transmission
Replies: 43
Views: 15909

I can't really fully understand what u did but the general idea on flow problems with vertex capacity is to split each vertex into two where all incoming edges come to one vertex and all outgoing edges goes from the other vertex and the capacity between them is the capacity of the original vertex. A...
by Sanny
Fri Apr 22, 2005 11:34 am
Forum: Volume 1 (100-199)
Topic: 117 - The Postal Worker Rings Once
Replies: 58
Views: 16349

The graph is undirected. :wink:

Regards
Sanny
by Sanny
Wed Apr 20, 2005 9:07 am
Forum: Algorithms
Topic: Help on a USACO problem
Replies: 3
Views: 1154

Thanks for the reply. Actually I know the binary search method but haven't solved a problem using min cost flow yet. So I thought if I could solve this problem using min cost flow.

Regards
Sanny
by Sanny
Mon Apr 18, 2005 10:20 pm
Forum: Algorithms
Topic: Help on a USACO problem
Replies: 3
Views: 1154

Help on a USACO problem

It is a problem of last month's USACO gold division. The description is: FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They have decided to put a rain siren on the farm to let them know when rain is approaching. They i...
by Sanny
Wed Apr 13, 2005 4:07 pm
Forum: Volume 108 (10800-10899)
Topic: 10824 - Regular Polygon
Replies: 20
Views: 9696

The O(n^3) solution is just like this: - sorting all points O(n lg n) - for k from 3 to n, - - for j from 1 to n - - - loop to see if a k-gon with pt j is possible In checking whether a k-gon with pt j is possible, you have to check n -j points, isn't it? I'm not sure but I have a feeling that my (...
by Sanny
Sat Apr 09, 2005 8:59 pm
Forum: Volume 108 (10800-10899)
Topic: 10824 - Regular Polygon
Replies: 20
Views: 9696

Can anybody explain what is the O(n^2) or O(n^3) algorithm for this problem. I've used an O(n^3 lg n) algrotithm and got AC in ~.2 s and currently 5th in the ranklist. Thanks in advance.

Sanny

Go to advanced search