Search found 83 matches

by 898989
Sun Oct 10, 2010 10:05 am
Forum: Volume 118 (11800-11899)
Topic: 11859 - Division Game
Replies: 8
Views: 3008

Re: 11859 - Division Game

I am getting WA :( I think this problem should be solving by finding grundy number for each row, then applying nim on them as if they are piles size. I could not code efficient grundy, so through small brute force, i thought grundy of row will be equal to: sum of powers for all prime numbers in a ro...
by 898989
Fri Oct 16, 2009 2:43 pm
Forum: Volume 108 (10800-10899)
Topic: 10828 - Back to Kernighan-Ritchie
Replies: 20
Views: 14573

Re: 10828 - Back to Kernighan-Ritchie

Hmmm, How to handle the infinity case?, My Gaussian either says (we have sol, no sol, infinite ones)
I passed all the samples with wrong judging on infinity case.
by 898989
Tue Oct 13, 2009 12:04 pm
Forum: Volume 114 (11400-11499)
Topic: 11475 - Extend to Palindrome
Replies: 32
Views: 13402

Re: 11475 - Extend to Palindromes

I figured out the solution, thx
by 898989
Sat Oct 10, 2009 4:24 pm
Forum: Volume 114 (11400-11499)
Topic: 11475 - Extend to Palindrome
Replies: 32
Views: 13402

Re: 11475 - Extend to Palindromes

I have solved the problem using hashing, but do not know how to modify KMP to find answer. What I understood, solving following the problem will be the solution : Given String, Find longest prefix that is palindrome. Correct me if i am wrong. Also it is same as given string A, and its reversed one B...
by 898989
Sat Nov 15, 2008 11:01 pm
Forum: Volume 115 (11500-11599)
Topic: 11536 - Smallest Sub-Array
Replies: 9
Views: 1909

Re: 11536 - Smallest Sub-Array

Hi, When you have an Array, and required to find Sub-Array with certain criteria, usually this is done by "sliding window". sliding window means with a window with a size on input. E.g. imagine array 1 2 3 4 5 6, and we move with FIXED size window 3. in 1st iteration, window cover 1 2 3 in 2nd itera...
by 898989
Sun Nov 02, 2008 12:43 pm
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 26083

Re: 10986 - Sending email

Thx so much.
I discovered my bug.
by 898989
Sat Oct 18, 2008 5:42 pm
Forum: Volume 115 (11500-11599)
Topic: 11500 - Vampires
Replies: 10
Views: 4796

Re: 11500 - Vampires - tips

Hi, this is already how i did it, but last simple is not right. while(cin>>EV1>>EV2>>AT>>D && (EV1+EV2+D+AT)) { clr(vis, 0); cout.setf(ios::fixed|ios::showpoint ); cout.precision(1); double n1 = EV1/D, n2 = EV2/D; double p1, p2; if(AT == 3) { p1 = n1/(n1+n2); p2 = n2/(n1+n2); } else { // won't work ...
by 898989
Fri Oct 17, 2008 12:42 am
Forum: Volume 104 (10400-10499)
Topic: 10491 - Cows and Cars
Replies: 17
Views: 8136

Re: 10491 - Cows and Cars

I still can not figure out how to solve it. Can any one gives more explanation.
by 898989
Tue Oct 14, 2008 8:47 am
Forum: Volume 115 (11500-11599)
Topic: 11500 - Vampires
Replies: 10
Views: 4796

Re: 11500 - Vampires - tips

Can you please give me more details? What is the approach for solving this problem?
and please elaborate more on "Gambler ruin"
by 898989
Sat Oct 04, 2008 1:46 am
Forum: Volume 8 (800-899)
Topic: 802 - Lead or Gold
Replies: 20
Views: 10787

Re: 802 - Lead or Gold

The Hints here is not enough for me, Can some one go more in details. All what I realized alone that given input like: a0 b0 c0 a1 b1 c1 a2 c2 b2 and target ration at bt ct We can have matrix as following in relation AX = Y = factor * Y' A = a0 a1 a2 b0 b1 b2 c0 c1 c2 X = // This is the factor matri...
by 898989
Thu Oct 02, 2008 1:43 am
Forum: Volume 114 (11400-11499)
Topic: 11499 - Longest Increasing Sequence
Replies: 7
Views: 4267

Re: 11499 - Longest Increasing Sequence

Thanks so much for your reply. I got it AC. I did not understand ur 2, 2.1, 2.2 points, BUT point 1 helped me to convert my N^4 to N^3 My idea was 1. PRECOMPUTE lis [j], which is the length of longest increasing seqeunce at row i (only), starting from j. -> O(N^3) 2. For each 2 column, assume ur new...
by 898989
Mon Sep 29, 2008 8:51 pm
Forum: Volume 114 (11400-11499)
Topic: 11499 - Longest Increasing Sequence
Replies: 7
Views: 4267

11499 - Longest Increasing Sequence

Can any body give me hints for this problem. I stopped coding as I realized my order is big. I thought in trying all rectangles (each rectangle start at first row & end at last col), and for each rectangle I do a sliding window in Order (rectangle size). But I believe this is much. for (int c1 = 0; ...
by 898989
Mon Sep 29, 2008 4:10 pm
Forum: Volume 112 (11200-11299)
Topic: 11283 - Playing Boggle
Replies: 19
Views: 7926

Re: 11283 - Playing Boggle

Hi again;

I got AC, after figuring out my stupid typo.

In ur code, no problems except the case I mentioned above. This case answer should be ZERO.

Otherwise, the problem is direct in its input & output.

GoodLuck
by 898989
Mon Sep 29, 2008 6:49 am
Forum: Volume 112 (11200-11299)
Topic: 11283 - Playing Boggle
Replies: 19
Views: 7926

Re: 11283 - Playing Boggle

Hi, I have tried it now. I also got WA.
our codes is same way, but i think u have another bug.

When u START searching from i, j, you do not mark this position as visited, so it may be used again

If i am right, then your code will fail in this case

Code: Select all

1
KKKK
ADKK
BCKK
KKKK

1
ABCDA
by 898989
Thu Sep 18, 2008 5:16 pm
Forum: Volume 1 (100-199)
Topic: 127 - "Accordian" Patience
Replies: 83
Views: 8447

Re: #127, if you get AC, please try this input

Hi all, I need some help in this problem, I am suffering from TLE. My code use only arrays, and i implement double linked list ( using 2 arrays L, R). I also use scanf, printf. What else I can do?!!!! Please if any one has Hints, I will be happy. Edit: Passed 1.3s, I called function f(str a, str b) ...

Go to advanced search