posts - 1, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

2006年4月4日


 1 class NewAlbum
 2 
 3 public
 4   int leastAmountOfCDs(int nSongs, int length, int cdCapacity) 
 5   { 
 6     int m = (cdCapacity+1)/(1+length);
 7     if (m%13 ==0 ) m--;
 8     int result = nSongs/+ (nSongs%m? 1:0);
 9     if ((nSongs/==0 || nSongs%m+1==m ) && nSongs%m%13==0 && nSongs%m )
10       result++;
11     return result;
12   } 
13 };


posted @ 2006-04-04 21:41 BinGo and WhitNey's 阅读(123) | 评论 (0)编辑 收藏