[algogeeks] Re: Problem

2006-11-07 Thread shisheng li








Can the 4 overlap?











From:
algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of mohamad momenian
Sent: Tuesday, November 07, 2006
4:09 PM
To: algogeeks@googlegroups.com
Subject: [algogeeks] Problem







Hi 











i have a problem please help me





The input of problem is : width and height of 4
rectangle that is between 1,50 





and thewe mustcalculate widthand
height ofallof rectangles that can coverthis 4 rectangles and
it'sareabecome minimum





and we can place 4 rectangle vertically or
horizontally in the result rectangle 








--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Algorithm Geeks group.  To post to this group, send email to algogeeks@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups-beta.google.com/group/algogeeks  -~--~~~~--~~--~--~---






[algogeeks] Re: Problem

2006-11-07 Thread mohamad momenian
No they can't over lap 

thank you for your attention
On 11/7/06, shisheng li [EMAIL PROTECTED] wrote:



Can the 4 overlap?





From:
 algogeeks@googlegroups.com [mailto:
algogeeks@googlegroups.com] On Behalf Of mohamad momenianSent: Tuesday, November 07, 2006 4:09 PM
To: algogeeks@googlegroups.comSubject: [algogeeks] Problem




Hi 



i have a problem please help me

The input of problem is : width and height of 4 rectangle that is between 1,50 

and thewe mustcalculate widthand height ofallof rectangles that can coverthis 4 rectangles and it'sareabecome minimum


and we can place 4 rectangle vertically or horizontally in the result rectangle 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Algorithm Geeks group.  To post to this group, send email to algogeeks@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups-beta.google.com/group/algogeeks  -~--~~~~--~~--~--~---


[algogeeks] Re: Problem

2006-11-07 Thread Malay Bag
I did not get the point:-we mustcalculate widthand height ofallof rectangles that can coverthis 4 rectangles and it'sareabecome minimumcan you give some example?
On 11/7/06, mohamad momenian [EMAIL PROTECTED] wrote:
No they can't over lap 

thank you for your attention
On 11/7/06, shisheng li [EMAIL PROTECTED]
 wrote:



Can the 4 overlap?





From:

 algogeeks@googlegroups.com [mailto:

algogeeks@googlegroups.com] On Behalf Of mohamad momenianSent: Tuesday, November 07, 2006 4:09 PM

To: algogeeks@googlegroups.comSubject: [algogeeks] Problem




Hi 



i have a problem please help me

The input of problem is : width and height of 4 rectangle that is between 1,50 

and thewe mustcalculate widthand height ofallof rectangles that can coverthis 4 rectangles and it'sareabecome minimum



and we can place 4 rectangle vertically or horizontally in the result rectangle 




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Algorithm Geeks group.  To post to this group, send email to algogeeks@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups-beta.google.com/group/algogeeks  -~--~~~~--~~--~--~---


[algogeeks] Re: Problem

2006-11-07 Thread Atamyrat Hezretguliyew

On 11/7/06, Malay Bag [EMAIL PROTECTED] wrote:
 I did not get the point:-
 we must calculate width and height of all of rectangles that can cover this
 4 rectangles and it's area become minimum
 can you give some example?

I think this problem is from IOI95
http://olympiads.win.tue.nl/ioi95/task/pack.html



  On 11/7/06, mohamad momenian [EMAIL PROTECTED] wrote:
 
  No they can't over lap
 
  thank you for your attention
 
 
 
  On 11/7/06, shisheng li [EMAIL PROTECTED]  wrote:
  
  
  
  
   Can the 4 overlap?
  
  
  
   

  
   From: algogeeks@googlegroups.com [mailto: [EMAIL PROTECTED] On
 Behalf Of mohamad momenian
   Sent: Tuesday, November 07, 2006 4:09 PM
   To: algogeeks@googlegroups.com
   Subject: [algogeeks] Problem
  
  
  
  
  
   Hi
  
  
  
  
  
   i have a problem please help me
  
  
   The input of problem is : width and height of 4 rectangle that is
 between 1,50
  
  
   and the we must calculate width and height of all of rectangles that can
 cover this 4 rectangles and it's area become minimum
  
  
   and we can place 4 rectangle vertically or horizontally in the result
 rectangle
  
  
  
  
  
  
 


  


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~--~~~~--~~--~--~---



[algogeeks] Re: Problem

2006-11-07 Thread Manish Garg
it will be better if u will give at least one sample input and output.
On 11/7/06, mohamad momenian [EMAIL PROTECTED] wrote:

Hi 

i have a problem please help me
The input of problem is : width and height of 4 rectangle that is between 1,50 
and thewe mustcalculate widthand height ofallof rectangles that can coverthis 4 rectangles and it'sareabecome minimum
and we can place 4 rectangle vertically or horizontally in the result rectangle [EMAIL PROTECTED] 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Algorithm Geeks group.  To post to this group, send email to algogeeks@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups-beta.google.com/group/algogeeks  -~--~~~~--~~--~--~---


[algogeeks] Re: Problem

2006-11-07 Thread mohamad momenian
Yes that is from ioi95
| INPUT.TXT | | OUTPUT.TXT ||___| ||| 1 2 | | 40 || 2 3 | | 4 10 || 3 4 | | 5 8 || 4 5 |  ||
|___| Example input and output 
On 11/7/06, Manish Garg [EMAIL PROTECTED] wrote:
it will be better if u will give at least one sample input and output.
On 11/7/06, mohamad momenian 
[EMAIL PROTECTED] wrote: 


Hi 

i have a problem please help me
The input of problem is : width and height of 4 rectangle that is between 1,50 
and thewe mustcalculate widthand height ofallof rectangles that can coverthis 4 rectangles and it'sareabecome minimum
and we can place 4 rectangle vertically or horizontally in the result rectangle 
[EMAIL PROTECTED] 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Algorithm Geeks group.  To post to this group, send email to algogeeks@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups-beta.google.com/group/algogeeks  -~--~~~~--~~--~--~---


[algogeeks] Re: majority element

2006-11-07 Thread J.Guo

**Presume the majority exists**, the following algo use O(1) space and
only scan the array one pass.

It is simple idea of counting. If there exists a majority elements in
the array, it must be the remaining element on the counter after we
consider all elements.

int getMajority(int A[], int n){

int count=0;
int val=0;
for (int i=1;in;i++){
if(count==0)
{
val=A[i];
count++;
}
else if (val==A[i])
count++;
else// val != A[i]
count--; 
}

return val;

}


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~--~~~~--~~--~--~---