【leetcode】第11题:Container问题
2016-03-14 20:38
399 查看
这题比较简单,自己就直接贴代码了
代码如下:
代码如下:
public static int container ( int[ ] a ) { int container = 0 ; for(int i = 0; i < a.length ; i++){ for(int j =i+1; j< a.length; j++){ if( a[ i ] > a[ j ] ){ a [ i ] = a [ j ]; } int thisContainer = (j-i) * a [ i ] ; if( thisContainer > container ){ container = thisContainer; } } } return container; }
相关文章推荐
- 关灯游戏AI扩展
- git RPC failed;result=18
- Socket bind failed: [730048] ͨ³£ÿ¸öÌÓ×ֵØַ(ЭÒé/ÍøÂçµØַ/¶˿Ú)ֻÔÊÐíʹÓ
- EventMailer使用方法
- ERROR: Upgrade faifailed bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost'
- 用TextPaint来绘制文字
- [BZOJ 4320]ShangHai2006 Homework
- 游戏人工智能开发之6种决策方法
- lightoj 1021 - Painful Bases 状压DP
- System and device programming——R&W with semaphore
- An error was encountered while running(Domain=LaunchSerivcesError, Code=0)
- 发现大量的TIME_WAIT解决办法
- la 4394 string painter 区间dp
- 查看AIX文件系统分布所在的物理磁盘
- Flask-mail 邮件带中文名称的附件
- [AIR] Screen 的应用
- 简述raid0、raid1、raid5的区别
- IMA: maintain i_readcount in the VFS layer
- MRC时代@property关键字retain的作用
- need improve 219. Contains Duplicate II