東野圭吾(推理小說家) 加上 宮藤官九郎(鬼才編劇)
又搞笑又沈重又歡樂又哀傷的日劇
而且戶田惠梨香有演出!正妹 最高!!
From UtOpIaN |
曾幾何時 這座小島只剩下一條聯外橋樑
島上的居民都十分依賴這座橋樑來對外聯絡
但是不知怎麼地 這座橋慢慢年久失修
居民們卻沒有察覺出橋樑即將崩壞的徵照
每日依然照常地享受這橋給他們的便利
一日 橋樑垮了
人們惆悵地站在岸邊望著大海
原來如此堅固的橋樑依舊經不起時間與海水的摧殘
唯一的橋樑斷了 就這麼斷了
這座島變成了一座漂流之島
漂流阿 漂流 最終消逝在大海的彼方
G社大拜拜 之 戰利品:
林雲太 交大資工學弟 樂陞科技同事
是個非常有趣的人 很容易與人相處
跟朋友在一起就像三歲小孩一樣地吵鬧打混
跟女友認識不到一年就步入禮堂
蜜月旅行是到法國自助旅行一個月
喜宴是由新郎打鼓&新娘玩keyboard來開場
開場後也不用什麼致詞 直接上菜
車子, 房子, 老婆 一次搞定 XD
祝這對新人永遠幸福美滿健康快樂 :)
--
[1;42m�[41m�[m O[1mri[30mgi[mn: [1;41m 黎巴嫩花園˙玫瑰花的符咒 [42m tybsd2.csie.nctu.edu.tw [m
[1;44m�[43m�[m Au[1mt[30mho[mr: [1;31mphenix[m 從 [1;36m237.254.192.210.dynamic.ttn.net[m 發表
※ 引述《Baudelaire (Sunnyvale)》之銘言:
: 這題據強者我ebay的朋友說,Google在on-campus也問過他這題。
: Array Rotation
: You should be able to do this in less than linear time.
: Implement the following function, FindSortedArrayRotation,
: which takes as its input an array of unique integers that has
: been sorted in ascending order, then rotated by an unknown
: amount X where 0 <= X <= (arrayLength - 1). An array rotation
: by amount X moves every element array[i] to array[(i + X) %
: arrayLength]. FindSortedArrayRotation discovers and returns X
: by examining the array. Consider performance, memory utilization
: and code clarity and elegance of the solution when implementing
: the function.
基本上算是binary search的變形:
public static int FindSortedArrayRotation(int array[]) {
int begin = 0, end = array.length - 1;
while (end-begin>1) {
if (array[begin] > array[(begin + end) / 2]) {
end = (begin + end) / 2;
} else if (array[(begin + end) / 2] > array[end]) {
begin = (begin + end) / 2;
} else {
return (begin+end)/2+1;
}
}
return end;
}
: ----
: Partitioning
: Given an array of balls, which can be one of two colors (RED or BLUE),
: write a function that partitions the array in-place such that on exit
: from the function all the balls of the same color are contiguous. It
: does not matter whether the red or blue balls come first. The return
: value from the function is the index of the first ball of the second
: color. If there is only one color of balls in the array then the
: return value should be 0. It is not legal to change the color of a
: ball. They must be moved. Consider performance, memory utilization
: and code clarity and elegance of the solution when implementing the
: function.
算是quicksort裡面的in-place partition,也不會太難。
public static int Partition(Ball[] aBalls) {
int left = 0, right = aBalls.length - 1;
BallColor pivotColor = aBalls[0].Color();
while (left <= right) {
BallColor leftColor = aBalls[left].Color();
BallColor rightColor = aBalls[right].Color();
if (leftColor == pivotColor) && rightColor == pivotColor)
left++;
} else if (leftColor == pivotColor && rightColor != pivotColor) {
left++;
} else if (leftColor != pivotColor && rightColor != pivotColor) {
right--;
} else if (leftColor != pivotColor && rightColor == pivotColor) {
Ball tmp = aBalls[left];
aBalls[left] = aBalls[right];
aBalls[right] = tmp;
left++; right--;
}
}
return left;
}
--
[1;30;40mJe t'aime,o capitale infame.
[0;37;40m Tu m'as donne ta boue et j'en ai fait de l'or.
[1;37;40m Charles Baudelaire 1821-67[m
http://wonderfultown.spaces.live.com/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 76.21.111.81