Search found 20 matches

by dhruba07
Fri Apr 10, 2015 7:11 am
Forum: Volume 102 (10200-10299)
Topic: 10261 - Ferry Loading
Replies: 41
Views: 19212

Re: 10261 - Ferry Loading

How many cars will be there ? There is a comment that there may be 200 cars,we ignore after that.Why would we ignore that?
by dhruba07
Wed Apr 08, 2015 5:54 pm
Forum: Volume 12 (1200-1299)
Topic: 1213 - Sum of Different Primes
Replies: 1
Views: 1036

Re: 1213 - Sum of Different Primes

I am getting time limit.I am doing recursive dp.Any help would be appreciated. #include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_DEPRECATE typedef long long ll ; typedef vector <int> vi ; typedef pair <int, int> ii ; typedef vector <ii> vii; typedef set <int> si ; typedef map <str...
by dhruba07
Mon Jun 30, 2014 11:47 pm
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 20316

Re: 10020 - Minimal Coverage

I have followed this algorithm of the blog : Sort by the starting coordinate of each segment Set shouldBeCovered = 0, while(shouldBeCovered < M) get the max covering length (segment.end - shouldBeCovered + 1) segment that segment.start <= shouldBeCovered If segment found add to the segments that are...
by dhruba07
Thu Jun 26, 2014 12:41 am
Forum: Volume 4 (400-499)
Topic: 410 - Station Balance
Replies: 41
Views: 15005

Re: 410 WA

Thanks to Brianfry I got AC.

The problem is a special output problem.The order of the specimen doesn't matter as long as the partitioning and the imbalance is right.
by dhruba07
Mon Jun 16, 2014 5:56 pm
Forum: Volume 7 (700-799)
Topic: 714 - Copying Books
Replies: 29
Views: 19376

Re: 714 - Copying Books

Got AC.

There is a problem just like this in the topcoder tutorial of Binary Search.Interested readers can read it : http://community.topcoder.com/tc?module ... narySearch
by dhruba07
Thu Jun 12, 2014 9:35 pm
Forum: Volume 103 (10300-10399)
Topic: 10309 - Turn the Lights Off
Replies: 19
Views: 8674

Re: 10309 - Turn the Lights Off

testcase0 #OO#OO#O#O O#OOOO#OO# O#OO#O##O# #O###O##OO #O##O####O #O##OO#OO# ####O###O# O#O##O#OOO O#O#O#O##O OO#O###OO# testcase1 OOOOO#O#OO #O#OO##OOO O#O##OOOOO #O##O###O# ######OO## O#O#O##O## #OOO#O#O## ##O#OOOOOO ####OOO#O# O##O###O#O testcase2 ###OO#OOOO O##O##O#OO ##OO###OO# ##OO#OO#OO O####...
by dhruba07
Fri Apr 04, 2014 6:32 am
Forum: Volume 104 (10400-10499)
Topic: 10496 - Collecting Beepers
Replies: 19
Views: 9907

Re: 10496 - Collecting Beepers

This problem can be solved by recursive backtracking. The only thing to look at is : http://en.wiktionary.org/wiki/Manhattan_distance Because this grid has no obstacles in path, so the distance can be directly calculated by Manhattan Distance. So choose one beeper,backtrack and then choose another :...
by dhruba07
Thu Apr 03, 2014 12:09 am
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20659

Re: 193 Graph Coloring

AC :)
by dhruba07
Sat Mar 29, 2014 7:26 am
Forum: Volume 1 (100-199)
Topic: 193 - Graph Coloring
Replies: 93
Views: 20659

Re: 193 Graph Coloring

AC :)
by dhruba07
Tue Jan 28, 2014 7:23 pm
Forum: Volume 110 (11000-11099)
Topic: 11015 - 05-2 Rendezvous
Replies: 48
Views: 16666

Re: 11015 - 05-2 Rendezvous

Code: Select all

got AC
I just did the wrong calculation of comparison.thanks Anyway :D
by dhruba07
Sat Jan 04, 2014 12:23 pm
Forum: Volume 106 (10600-10699)
Topic: 10600 - ACM Contest and Blackout
Replies: 34
Views: 13023

Re: 10600 - ACM Contest and Blackout

I am getting run time error in this problem :( All test cases match with forum :evil: The algoritm is to run kruskal and print out the MST sum.Then for each edge in MST I took out the edge,make it's weight INF and run MST again,stored a variable if the cost is minimum and printed out the minimum val...
by dhruba07
Fri Jan 03, 2014 1:36 pm
Forum: Volume 103 (10300-10399)
Topic: 10307 - Killing Aliens in Borg Maze
Replies: 54
Views: 17448

Re: 10307 - Killing Aliens in Borg Maze

I am getting time limit for this problem. My algortihm is : 1.finding SSSP from all pairs (A to A and S).Create a graph by them using BFS. 2.Then Run the normal MST to find the answer. My program is returning the correct value for all the testcases :cry: Here goes my code : got AC :D The main thing ...
by dhruba07
Thu Dec 05, 2013 11:18 pm
Forum: Volume 105 (10500-10599)
Topic: 10583 - Ubiquitous Religions
Replies: 33
Views: 14539

Re: 10583 - Ubiquitous Religions

I looped through the whole array from 1 to number of students and incremented the counter whenever I got a parent index equal to the main index(Union find algorithm).Is there any other approach to solve this problem without running a loop from 1 to number of students?
by dhruba07
Wed Dec 04, 2013 9:46 am
Forum: Volume 101 (10100-10199)
Topic: 10102 - The path in the colored field
Replies: 34
Views: 12933

Re: 10102 - The Path in the Colored Field

I am getting wrong answer.I can't understand what is wrong with my code :oops:

Code: Select all

Thanks brianfry. Got AC
by dhruba07
Mon Nov 18, 2013 8:30 pm
Forum: Volume 115 (11500-11599)
Topic: 11504 - Dominos
Replies: 55
Views: 20182

Re: 11504 - Dominos

I am not understanding what am I doing wrong in this problem.The first test case from brianfry gives the correct answer but other testcases are giving wrong answers :evil:

Code: Select all

Got AC

Go to advanced search