在上一篇博文中,我们将原先的纯C语言代码,编写成了用Objective-C(后面直接缩写成OC)的写法。使得代码在易读性上有明显提升,结构也更清晰。同时,也对面向对象的概念有了进一步的介绍和加深。 但是,通过上一个例子,我们发现代码的冗余还是很大。像Circle,Rectangle和Egg的定...
                            
                            
                                分类:
其他好文   时间:
2014-11-26 01:03:50   
                                阅读次数:
333
                             
                    
                        
                            
                            
                                题目链接:点击打开链接
思路:
显然就是问最大权闭合图 和 能取最多的正点权个数
1、首先对于正权值的付出,直接取,而对于梦想也忽略正权值的付出,这样就转成一个裸的最大权闭合图了。
2、计算此时的正点权个数:把所有点权*大数C,然后把正点权值+1,跑出来流量就是 flow / C, 最多的正点权个数就是 正点权点集-flow%C.
#include 
#include 
#inc...
                            
                            
                                分类:
其他好文   时间:
2014-11-25 23:30:56   
                                阅读次数:
286
                             
                    
                        
                            
                            
                                因为要花费最少,如果花费最少的有多个还要使得步数最少
所以在判断一个数字要不要入队列的时候只要判断这个就可以了
I - Interesting Calculator
Time Limit:2000MS     Memory Limit:131072KB     64bit IO Format:%lld & %llu
Submit Status Practice CSU
 1336...
                            
                            
                                分类:
其他好文   时间:
2014-11-24 22:41:25   
                                阅读次数:
284
                             
                    
                        
                            
                            
                                Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.Analysis:For each position (i,j),...
                            
                            
                                分类:
其他好文   时间:
2014-11-24 06:28:38   
                                阅读次数:
192
                             
                    
                        
                            
                            
                                Polycarpus likes giving presents to Paraskevi. He has bought two chocolate bars, each of them has the shape of a segmented rectangle. The first bar is...
                            
                            
                                分类:
其他好文   时间:
2014-11-23 23:06:07   
                                阅读次数:
380
                             
                    
                        
                            
                            
                                Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
                            
                            
                                分类:
其他好文   时间:
2014-11-23 17:19:58   
                                阅读次数:
254
                             
                    
                        
                            
                            
                                CSU 1334: 好老师(数学啊 湖南省第九届大学生计算机程序设计竞赛)...
                            
                            
                                分类:
其他好文   时间:
2014-11-22 20:18:23   
                                阅读次数:
163
                             
                    
                        
                            
                            
                                CSU 1330: 字符识别?(字符串模拟啊 湖南省第九届大学生计算机程序设计竞赛)...
                            
                            
                                分类:
其他好文   时间:
2014-11-22 20:17:37   
                                阅读次数:
153
                             
                    
                        
                            
                            
                                CSU 1337: 搞笑版费马大定理(数学啊 湖南省第九届大学生计算机程序设计竞赛)...
                            
                            
                                分类:
其他好文   时间:
2014-11-22 20:17:23   
                                阅读次数:
165
                             
                    
                        
                            
                            
                                CSU 1336: Interesting Calculator(BFS啊 湖南省第九届大学生计算机程序设计竞赛)...
                            
                            
                                分类:
其他好文   时间:
2014-11-22 20:17:16   
                                阅读次数:
197