two ways to do it
1) qsort then binary search
2) binary search tree is also an option
think about it ... you will get the idea
Search found 131 matches
- Sun Aug 12, 2007 7:17 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10282 - Babelfish
- Replies: 48
- Views: 19639
- Mon May 14, 2007 12:19 pm
- Forum: Algorithms
- Topic: USACO, Section : 1.4 , Packing Rectangles
- Replies: 7
- Views: 8642
- Fri May 11, 2007 1:38 pm
- Forum: Algorithms
- Topic: USACO, Section : 1.4 , Packing Rectangles
- Replies: 7
- Views: 8642
http://riyad13783.googlepages.com/pack.gif i forgot to give the picture of the 6 basic layouts. i wrote all the formulas in one of my previous post. could some one check those and tell me weither my formulas are correct or not. i will remove all my post as soon as i get accepted in this problem. by...
- Fri May 11, 2007 1:31 pm
- Forum: Algorithms
- Topic: USACO, Section : 1.4 , Packing Rectangles
- Replies: 7
- Views: 8642
- Fri May 11, 2007 1:22 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10581 - Partitioning for fun and profit
- Replies: 15
- Views: 8430
I/O
but i get this output for your input. could you tell what am i doing wrong?please help.....
what is ur output for
i get
is it right????
Code: Select all
1
1
1
1
1
1
52
3
1
1
1
1
1
1
64
31
1
1
1
1
66
41
Code: Select all
10 4 10
Code: Select all
1
2
3
4
- Tue May 08, 2007 11:45 am
- Forum: Volume 105 (10500-10599)
- Topic: 10581 - Partitioning for fun and profit
- Replies: 15
- Views: 8430
can't get AC still :( can anyone please help. below is my code # include <stdio.h> # include <assert.h> typedef long long i64 ; i64 memo[250][20]; i64 go( int sum , int n ){ i64& ret = memo[sum][n]; if(ret !=-1) return ret ; if( !sum && !n ) return ret = 1 ; ret = 0 ; int i ; for( i = 1 ; i <= sum &...
- Mon May 07, 2007 5:31 am
- Forum: Volume 105 (10500-10599)
- Topic: 10581 - Partitioning for fun and profit
- Replies: 15
- Views: 8430
some more test cases
i am getting WA in this problem. could anyone provide more testcases. boundary cases would be very nice. i got correct results for all the above i/o. please help....
- Sat Mar 31, 2007 4:03 am
- Forum: Algorithms
- Topic: USACO, Section : 1.4 , Packing Rectangles
- Replies: 7
- Views: 8642
Help on packing rectangle.........
hello, thank you for the help. im not good at geometry. so i am not confident about finding the height and width of the different scenarios case 1 : 1 2 3 4 H = max4(h1,h2,h3,h4); W = w1+w2+w3+w4 ; case 2: (1 2 3) 4 H = max3(h1,h2,h3)+h4; W = max2( w4,w1+w2+w3); case 3 : ( 1 2 ) 4 3 H = max2( h4, ma...
- Tue Mar 27, 2007 6:04 pm
- Forum: Algorithms
- Topic: USACO, Section : 1.4 , Packing Rectangles
- Replies: 7
- Views: 8642
USACO, Section : 1.4 , Packing Rectangles
Four rectangles are given. Find the smallest enclosing (new) rectangle into which these four may be fitted without overlapping. By smallest rectangle, we mean the one with the smallest area. All four rectangles should have their sides parallel to the corresponding sides of the enclosing rectangle. ...
- Tue Sep 05, 2006 4:32 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10051 - Tower of Cubes
- Replies: 19
- Views: 8792
- Sat Sep 02, 2006 8:10 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11081 - Strings
- Replies: 35
- Views: 19517
- Sat Sep 02, 2006 7:50 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11077 - Find the Permutations
- Replies: 14
- Views: 7091
algorithm of 101077
is dp the obvious choice to go for this problem ?? and can some one tell me whats the complexity of the DP .....
is it O(nk) ???????????????
thanx in advance
is it O(nk) ???????????????
thanx in advance
- Sat Sep 02, 2006 7:41 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11081 - Strings
- Replies: 35
- Views: 19517
- Sat Sep 02, 2006 7:38 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11076 - Add Again
- Replies: 34
- Views: 16431
about 11076
try to find some formula for this problem ..... no backtracking needed ...
- Sun Aug 27, 2006 5:39 am
- Forum: Volume 109 (10900-10999)
- Topic: 10920 - Spiral Tap
- Replies: 12
- Views: 7190
about 10920
i cant find any suitable way to solve this problem . can some one give me some hints ??? is there formula needed or simulation is the way to go ???
please help
Thanx in advance
please help
Thanx in advance