TC598 div2
    
            
摘要:题意:给一些物品item[],这些物品的重量在101至300之间,要将这些物品全部放进若干个bins中,已知bins盛的重量为300,可以将bins装满也可以不装满,问放这些物品最少需要几个bins.思路:当时把最关键的地方忽略了,就是物品的重量在101至300之间,这就说明每个bins至多放2个物品。然后从小到大排序,倒着贪心就可以了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 class BinPackingEasy10 {11 private:.
        
阅读全文
                posted @ 
2013-11-29 14:23 
straw_berry
        
阅读(245) 
         
        推荐(0)     
             
            
            
    Integer Intervals(贪心)
    
            
摘要:Time Limit:1000MSMemory Limit:10000KTotal Submissions:12123Accepted:5129DescriptionAn integer interval [a,b], a 2 #include 3 #include 4 using namespace std; 5 6 struct node 7 { 8 int s,t; 9 }L[10010];10 int cmp(const struct node &a, const struct node &b)11 {12 return a.t = L[i].s && 
        
阅读全文
                posted @ 
2013-11-06 20:40 
straw_berry
        
阅读(274) 
         
        推荐(0)     
             
            
            
    Radar Installation 贪心
    
            
摘要:Language:Radar InstallationTime Limit:1000MSMemory Limit:10000KTotal Submissions:42461Accepted:9409DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locati
        
阅读全文
                posted @ 
2013-08-02 14:46 
straw_berry
        
阅读(173) 
         
        推荐(0)     
             
            
            
    贪心算法       Wooden Sticks
    
            
摘要:Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are as
        
阅读全文
                posted @ 
2013-05-26 01:22 
straw_berry
        
阅读(342) 
         
        推荐(0)