給定 k 個長度為 n 的整數數列,求各數列裡總和為零的三個數字的位置。若存在多組解,則以自位置順序以最靠前的為準。

Given: A positive integer $k \leq 20$, a positive integer $n \leq 10^4$, and $k$ arrays of size $n$ containing integers from $-10^5$ to $10^5$.

Return: For each array $A[1..n]$, output three different indices $1 \leq p < q < r \leq n$ such that $A[p] + A[q] + A[r] = 0$ if they exist, and "-1" otherwise.

(https://rosalind.info/problems/3sum/)

閱讀全文 »

給定 k 個長度為 n 的整數數列,求各數列裡互為加法反元素(相反數)的兩數位置。

Given: A positive integer $k \leq 20$, a positive integer $n \leq 10^4$, and $k$ arrays of size $n$ containing integers from $-10^5$ to $10^5$.

Return: For each array $A[1..n]$, output two different indices $1 \leq p < q \leq n$ such that $A[p] = -A[q]$ if they exist, and "-1" otherwise.

(https://rosalind.info/problems/2sum/)

閱讀全文 »

給定兩個有序的整數數列,求一個含有兩數列所有數字的有序數列。

Given: A positive integer $n \leq 10^5$ and a sorted array $A[1..n]$ of integers from $-10^5$ to $10^5$, a positive integer $m \leq 10^5$ and a sorted array $B[1..m]$ of integers from $-10^5$ to $10^5$.

Return: A sorted array $C[1..n+m]$ containing all the elements of $A$ and $B$.

(https://rosalind.info/problems/mer/)

閱讀全文 »

《後宮之夜》是結合 ASMR 的試驗性短篇視覺小說,描述主角與逝去愛貓在神明安排下重逢的小小奇蹟。遊戲共有三個結局,總時數約四小時。兩位女主角皆由聲優以特殊麥克風配音,營造出角色在玩家耳邊細語的感覺,遊玩體驗很像在聽坊間的音聲作品。

雖然這款遊戲的情節主要為 H 場景服務,但它其實是在虛構世界中,為那些心懷遺憾的玩家帶來療育的故事。主角島津佳九是一名自由撰稿人,夢想著成為暢銷作家。佳九深信願望一旦說出口就不會成真,所以從不向他人透漏內心的夢想。這個信念與他小時候的經歷有關──佳九的雙親時常吵架,儘管他不斷央求雙方和好,家庭關係仍然緊張,宛若陌生人般住在同一屋簷下。

那時,佳九僅有的玩伴是家裡養的白貓,還有一隻常黏著他的野貓。佳九非常疼愛牠們,可是這兩隻貓就像他的父母一樣總是吵架。佳九不曾放棄讓牠們和好,但一場意外讓他徹底夢碎:兩隻貓都因為車禍過世。他在鄰近神社後方的空地埋葬了兩隻愛貓,哭著向神明祈願能再次與牠們重逢,但願望始終沒有實現。

閱讀全文 »

給定長度為 n 的數列,求其中出現頻率大於五成的數字。

Given: A positive integer $k \leq 20$, a positive integer $n \leq 10^4$, and $k$ arrays of size $n$ containing positive integers not exceeding $10^5$.

Return: For each array, output an element of this array occurring strictly more than $n / 2$ times if such element exists, and “-1“ otherwise.

(https://rosalind.info/problems/maj/)

閱讀全文 »

給定長度為 n 的嚴格遞增數列,求指定數字在此數列的位置。

Given: Two positive integers $n \leq 10^5$ and $m \leq 10^5$, a sorted array $A[1..n]$ of integers from $-10^5$ to $10^5$, and a list of $m$ integers $-10^5 \leq k_1, k_2, \ldots, k_m \leq 10^5$.

Return: For each $k_i$, output an index $1 \leq j \leq n$ such that $A[j] = k_i$, or “$-1$” if there is no such index.

(https://rosalind.info/problems/bins/)

閱讀全文 »

給定至多含 10 條 DNA 序列之 fasta 檔,求 GC 比最高者及其 GC 比。

Given: At most 10 DNA strings in FASTA format (of length at most 1 kbp each).

Return: The ID of the string having the highest GC-content, followed by the GC-content of that string. Rosalind allows for a default error of 0.001 in all decimal answers unless otherwise stated; please see the note on absolute error below.

閱讀全文 »

我覺得這本書的場景描述確實非常吸引人,能讓人投入在勒瑰恩創造的世界中。可是它不太容易讀,有些故事篇幅短,情節較不鮮明。陌生的角色姓名飛竄的時候,很容易迷失在文字與設定中,直到故事尾聲還沒辦法把握事件始末。

例如〈革命前夕〉整篇傳達無政府主義的概念和氛圍,但沒有很明顯的高潮起伏;〈離開奧美拉城的人〉則呈現了一個社會犧牲特定人獲取多數人的幸福的景象。

閱讀全文 »
0%