Search found 37 matches

by forthright48
Sun Feb 21, 2016 10:00 am
Forum: Volume 129 (12900-12999)
Topic: 12969 - Foes of Friends
Replies: 1
Views: 1090

Re: 12969 - Foes of Friends

So we have to find Maximum Independent Set. Is there any algorithm or trick to solve this efficiently? Pointer to the right direction will be appreciated :)
by forthright48
Fri Aug 21, 2015 7:05 pm
Forum: Volume 124 (12400-12499)
Topic: 12430 - Grand Wedding
Replies: 0
Views: 1258

Re: 12430 - Grand Wedding

Apparently we need to print -1 when we have to remove all roads. I couldn't figure this out by reading the statement. Not to mention, the statement doesn't have any constraints! I assumed both N and M to be less than 10^6. Hope this helps.
by forthright48
Wed Aug 19, 2015 10:11 pm
Forum: Volume 128 (12800-12899)
Topic: 12838 - Identity Redemption
Replies: 0
Views: 531

Re: 12838 - Identity Redemption

Seems like matching on general graph. Though not sure if it's the correct approach. Anybody has some other hint or resource?
by forthright48
Fri Jan 23, 2015 8:49 pm
Forum: Volume 110 (11000-11099)
Topic: 11013 - Get Straight
Replies: 12
Views: 4309

Re: 11013 - Get Straight

What is the output for:

Code: Select all

JS 9H 9S JH QH
#
I get "Stay" but on uDebug I get "Exchange 9H". According to my calculation staying is better than exchanging 9H. Am I missing something?
by forthright48
Thu Sep 18, 2014 9:39 am
Forum: Volume 12 (1200-1299)
Topic: 1223 - Editor
Replies: 1
Views: 994

Re: 1223 - Editor

Something is wrong with the Judge Data. It says in the input specification, "the length is less than or equal to 5,000". I get WA when I use 5010 as my array size. Even 6000 gives wrong answer. Finally I got AC by increasing my array size to 10000. Either fix the data set or the input specification.
by forthright48
Sun Aug 17, 2014 6:38 pm
Forum: Volume 105 (10500-10599)
Topic: 10511 - Councilling
Replies: 26
Views: 11368

Re: 10511 - Councilling

After 20 submission, I finally found out why I was getting WA. Guys, be careful. Each person will have unique name, BUT, a person name can be same as a party or club. A party name can also be same as club name. We have to count them as different.

1

a a a
b b b
c c c

Answer is
a a
b b
c c
by forthright48
Thu May 29, 2014 7:00 am
Forum: Volume 119 (11900-11999)
Topic: 11959 - Dice
Replies: 6
Views: 2519

Re: 11959 - Dice

Tried really hard to avoid simulating rotation of the cube, but had no luck with mathematical approach :( . So in the end, had to run flood-fill over all the states reachable from given string by simulating rotation to get AC.
by forthright48
Wed May 07, 2014 11:40 am
Forum: Volume 115 (11500-11599)
Topic: 11523 - Recycling
Replies: 5
Views: 2293

Re: 11523 - Recycling

Really interesting problem. Found a good hint from UVA Toolkit that this problem is similar to SRM 240 Div 1 900. Here is the editorial link http://community.topcoder.com/tc?module ... &d2=srm240
by forthright48
Tue May 06, 2014 10:20 pm
Forum: Volume 115 (11500-11599)
Topic: 11500 - Vampires
Replies: 10
Views: 4743

Re: 11500 - Vampires

I simply assumed that after 1000 moves, the probability becomes so small that it is negligible. Got AC with O(20*20*1000)
by forthright48
Mon May 05, 2014 9:35 am
Forum: Volume 111 (11100-11199)
Topic: 11153 - Museums
Replies: 16
Views: 8838

Re: 11153 - Museums

Here is a tricky case:
Input:

Code: Select all

2
1 2 1 1
1 1
0 1 1
1 17 1 1
1 1
0 1 1
Output:

Code: Select all

Case 1: No possible trip.
Case 2: 1
by forthright48
Sat May 03, 2014 1:51 pm
Forum: Volume 106 (10600-10699)
Topic: 10688 - The Poor Giant
Replies: 27
Views: 16130

Re: 10688 - The Poor Giant

Seems like the problem statement has not been fixed yet. I was so confused seeing this:
1+3+3+3=13
I kept on checking my code over and over again, until I realized, the equation is just plain wrong. 1+3+3+3 = 10, not 14. Can't believe it took me so long to see the arithmetic error :lol:
by forthright48
Fri Mar 21, 2014 2:52 pm
Forum: Volume 117 (11700-11799)
Topic: 11774 - Doom's Day
Replies: 10
Views: 3237

Re: 11774 - Doom's Day

Exactly what theory do I need to study to be able to solve this one? I found the formula, but I don't understand why it works. Also, why does the question ask for 3^m by 3^n grid? What's special about "3"? Cause I tried the formula with 3 * 4 grid and it didn't work. Seems like it only works with po...
by forthright48
Wed Mar 19, 2014 9:08 pm
Forum: Volume 106 (10600-10699)
Topic: 10643 - Facing Problem With Trees
Replies: 10
Views: 5371

Re: 10643 - Facing Problem With Trees

I knew there was a relation between total number of binary tree and catalan number, but I failed to find the relation with Balance binary tree. In the end I constructed a dp solution that took a long time to calculation the answer and then simply hard coded the answers into the solution :p
by forthright48
Mon Jan 20, 2014 6:23 pm
Forum: Volume 100 (10000-10099)
Topic: 10028 - Demerit Points
Replies: 10
Views: 1949

Re: 10028 - Demerit Points

I guess the judge data is weak then. I too limited merits to maximum of 5. Then I got lots of WA and so started to try out different things. Later I found bugs and fixed them. By the time I was finished my code no longer restricted merits to max of 5.
by forthright48
Sun Jan 19, 2014 8:08 pm
Forum: Volume 102 (10200-10299)
Topic: 10211 - Divisibility Testing! Wow!
Replies: 10
Views: 4415

Re: 10211 - Divisibility Testing! Wow!!

Really interesting problem. I knew about the divisibility rules before, but to solve the problem, I had to finally understand the proofs formally.

Go to advanced search