2013年5月30日 星期四

UVa 1549 -- 數學愛好者的天堂 Gauss Circle Problem


UVa 1549 - Lattice Point



Wiki: http://en.wikipedia.org/wiki/Gauss_circle_problem

這題是問 exact form N(r)

題目給的演算法 time complexity T(r) = O(r^2),這肯定會爆表

((否則本題會變成灌水題))



可以回頭想想 UVa 11526 - H(n),這給我們許多啟發。

((Time complexity = O(sqrt(n)),否則會吃 TLE))

自己給的演算法 T(r) = O(r),AC,所以這條路可行的。

2013年5月28日 星期二

UVa - 10005 Packing polygons


簡化題: 11281 - Triangular Pegs in Round Holes

這個只要檢查一個三角形就夠了。



本題: 10005 - Packing polygons

雖然是多邊形,但只要窮舉所有三個點所形成的三角形 ((無論是否退化)) 就可以了。

#include <iostream>
#include <math.h>
#include <stdio.h>

struct Point 
{
    int x_;
    int y_;

    Point() : x_(0), y_(0) { }

    static double distance(const Point& a, const Point&b)
    {
        int dx = a.x_ - b.x_;
        int dy = a.y_ - b.y_;
        return sqrt((double)(dx*dx + dy*dy));
    }

    static int distance2(const Point& a, const Point&b)
    {
        int dx = a.x_ - b.x_;
        int dy = a.y_ - b.y_;
        return dx*dx + dy*dy;
    }
};

double maximum(double a, double b)
{
    return (a > b) ? a : b;
}

Point V[101];
int N;

double good_circumscribed_circle_radius(int i, int j, int k)
{
    int a2 = Point::distance2(V[j], V[k]);
    int b2 = Point::distance2(V[k], V[i]);
    int c2 = Point::distance2(V[i], V[j]);
    if ((a2 > b2 + c2) || (b2 > c2 + a2) || (c2 > a2 + b2))
    {
        return 0.0;
    }

    double a = sqrt((double)a2);
    double b = sqrt((double)b2);
    double c = sqrt((double)c2);
    double p = (a+b+c)*0.5;
    double area = sqrt(p*(p-a)*(p-b)*(p-c));
    return a*b*c / area / 4.0;
}

int main(int argc, char* argv[])
{
    while (std::cin >> N && N)
    {
        // Read input
        for (int i = 0; i < N; i++)
        {
            std::cin >> V[i].x_ >> V[i].y_;
        }
        double radius;
        std::cin >> radius;

        // Fit any segments
        double max_covering_radius = 0.0;
        for (int i = 0; i < N; i++)
        {
            for (int j = i+1; j < N; j++)
            {
                double d = Point::distance(V[i], V[j]) * 0.5;
                max_covering_radius = maximum(max_covering_radius, d);
            }
        }

        // Fit any acute or right triangle
        for (int i = 0; i < N; i++)
        {
            for (int j = i+1; j < N; j++)
            {
                for (int k = j+1; k < N; k++)
                {
                    double r = good_circumscribed_circle_radius(i, j, k);
                    max_covering_radius = maximum(max_covering_radius, r);
                }
            }
        } 

        // Output here
        if (radius >= max_covering_radius)
        {
            puts("The polygon can be packed in the circle.");
        }
        else
        {
            puts("There is no way of packing that polygon.");
        }
    }

    return 0;
}

當然還有其他做法,

這就是寫演算法好玩的地方。

UVa -- Time waster 推薦題庫


((保證不會用到甚麼怪演算法))



(1) UVa 11223 - O: dah, dah, dah!

摩斯密碼表,有眼花的可能。

AC source code: https://github.com/Meng-Gen/UVa/blob/master/UVa/acm_11223.cc



(2) UVa 12060 - All Integer Average

數空白數到眼花。

AC source code: https://github.com/Meng-Gen/UVa/blob/master/UVa/acm_12060.cc



(3) UVa 12421 - (Jiandan) Mua (I) - Lexical Analyzer

這個保證很花時間,沒有演算法,就是花時間。

AC source code: https://github.com/Meng-Gen/UVa/blob/master/UVa/acm_12421.cc

如果吃到 WA 鐵定會很幹。

2013年5月27日 星期一

UVa -- 好用的資料結構 Disjoint Sets


為了解決 UVa 某些簡單題,刻一套自用的 disjoint-set forests 並不過分,

這裡採用 CLRS, Introduction to Algorithms 3/e 的程式碼,

以前念大學實在太混,這可是人生第一次實作 disjoint-set forests

((就算以前有作業,大概也是用抄的...))



struct DisjointSets {
    std::map<int, int> parent_;
    std::map<int, int> rank_;
    int size_;

    DisjointSets(int size) : size_(size) { 
        for (int i = 1; i <= size; i++) {
            parent_[i] = i;
            rank_[i] = 0;
        }
    }

    void Union(int x, int y) {
        Link(FindSet(x), FindSet(y));
    }

    void Link(int x, int y) {
        if (rank_[x] > rank_[y]) {
            parent_[y] = x;
        } 
        else {
            parent_[x] = y;
            if (rank_[x] == rank_[y]) {
                rank_[y]++;
            }
        }
    }

    int FindSet(int x) {
        if (x != parent_[x]) {
            parent_[x] = FindSet(parent_[x]);
        }
        return parent_[x];
    }
};

這是基本型,裡面用 std::map 說不定有 overkilled 之嫌。

以上 source code 可以再調,例如 Link() 可以先檢查 x == y,

如果一樣就不用傻傻的把 rank_[x]++

UVa 793

((AC: https://bitbucket.org/Menggen/uva/src/c70149a46f06089bbcdd0502468509e1f1e4975d/UVa/acm_793.cc?at=master))



當然 UVa Online Judge 不是吃素的,disjoint set 還可以稍加變化一下,

細節可參考:http://www.csie.ntnu.edu.tw/~u91029/DisjointSets.html

UVa 10608, 10685, 11503



此外,disjoint sets 也可取代使用 DFS 計算 component count,

哪個方便我們就用哪個。

UVa 10178

((提示:http://en.wikipedia.org/wiki/Euler_characteristic))

((當然不一定要這樣做))

((AC: https://bitbucket.org/Menggen/uva/src/56b804883cfe11520712b96eb0edac9699aa44d5/UVa/acm_10685.cc?at=master))

2013年5月25日 星期六

UVa -- Java BigInteger 之夜


果然是好物。

UVa 623, 10007, 10106, 10220, 10303, 10494, 10523, 10814, 10925, 11448, 11830, 11879



以 UVa 10106 來說,就是大數乘法運算,關鍵計算直接一行清掉,

連 java.math.BigInteger 都不用 import,多爽。



import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
System.out.println(cin.nextBigInteger().multiply(cin.nextBigInteger()).toString());
}
cin.close();
}
}

2013年5月23日 星期四

UVa -- GCD 之夜

UVa 題庫:

 GCD and/or LCM (6/11)
  106 - Fermat vs. PythagorasdiscussLev 2 --- ? ---
  332 - Rational Numbers from Repeating FractionsdiscussLev 3 --- ? ---
  408 - Uniform GeneratordiscussLev 2 ✔ 0.015s/1683
  412 - PidiscussLev 2 --- ? ---
  10407 - Simple division discussLev 3 ✔ 0.022s/1035
  10892 - LCM Cardinality discussLev 4 --- ? ---
  11388 - GCD LCMdiscussLev 3 ✔ 0.015s/1838
  11417 - GCDdiscussLev 2 ✔ 0.332s/2409(1)
  11774 - Doom's DaydiscussLev 5 --- ? ---
  11827 - Maximum GCD discussLev 3 ✔ 0.022s/1029
  12068 - Harmonic MeandiscussLev 5 ✔ 0.025s/283(2)

照著練習就可以了

好用的演算法就是輾轉相除法

// Euclidean Algorithm
long long gcd(long long a, long long b)
        while (b)
        {
                long long t = b; 
                b = a % t; 
                a = t; 
        }
        return a;
}



理論上能用 non-recursive 版本的計算方式就用 non-recursive,比較快。

原則上沒太大問題,有問題的就先跳過,改天有時間再慢慢做。

2013年5月22日 星期三

DFS 基本架構 -- UVa 10336


題目: http://uva.onlinejudge.org/external/103/10336.html

這是很傳統的 Flood Fill/Finding Connected Components (9/26)

經典教本 CLRS, Introduction to Algorithms 3/e 給出 recursive 版本的 DFS,

習題請你給 non-recursive 版本的 DFS。



來看程式基本資料結構:

bool visited[1000][1000];

這是最重要的部分,DFS 精神就是盡量走到底,走過的不要再走。

怎麼知道有沒有走過?就記起來唄。



接著是走的動作。Non-recursive 實作方式就是仰賴 stack。

void visit()
{
    Node node(x, y);

    std::stack<Node> dfs_stack;
    dfs_stack.push(node);

    while (dfs_stack.size() > 0)
    {
        Node top = dfs_stack.top();
        dfs_stack.pop();

        // 假如位置不合法,略過唄

        // 假如不在同一塊字母區域,也略過唄

        // 假如走過了,還是略過
        if (visited[top.x_][top.y_])
        {
            continue;
        }

        // 我走過了,記起來
        visited[top.x_][top.y_] = true;

        // 盡量走到底,有四個方位就走四個,有八個就走八個
        for (...)
        {
            Node next(...);
            dfs_stack.push(next);
        }
    }
}



int main(int argc, char* argv[])
{
    // UVa 讀入數據,沒甚麼特別的,就刻進去
    for (int case_id = 1; case_id <= num_testcases; case_id++)
    {
        // 還是讀數據

        // 初始化 visit[][]

        // 開始 DFS-Visit(),把結果記起來
        std::map<char, int> rank_map;
        for (...)
        {
            char letter = grid[i][j];
            if (!visited[i][j])
            {
                visit(i, j, letter);
                rank_map[letter]++;
            }
        }

        // 把結果排序一下印出來
    }

    return 0;
}

整個結構大致如此。




基本上作超過 200 題,這麼麻煩的題目也要順手撿起來。

UVa Online Judge 本月統計

傳說中的老二 ((羞))

差不多洗了快兩百題的簡單題 ((默))

Wednesday, 22nd May 2013, 12h:48m:54s GMT
UVa Online Judge
Author Ranklist of Present Month
(Top 100 from 4384 users)
Only new AC or cpu time improved
RANKAUTHORPROBLEMS
SOLVED
 1Gerald Belga295
 2Meng-Gen, Tsai191
 3HarryGo2013151
 4Jose Enrico B. Tiongson128
 5bryan117
 6Jepoy Baduria108
 7Giuliano Vilela [UFRN]102
 8Chi-Yen Teng96
 9Pham Huu Canh - HUBT University90
 10Evan89
 11kgduu88
 12Nguyen Truong Duy87
 12Tom87
 14Ong Ming Hui85
 14Md.Mostafizur Rahman85
 14sagar sharma85
 17Sam84
 18Bill83
 19???? ????? ????81
 20fishtoby79
 21Bob78
 21???78
 23???77
 24#Undefined - HUBT University76
 24Jim76
 26Russelle Guadalupe75
 27???72
 28Ibrahim Nash70
 29NCU - Morris69
 30Peter Gabrielsen65
 30Reinald Kim Amplayo65
 30Maciej65
 33Chowdhury Osman64
 33Siegrift64
 35Bao Ve - HUBT University61
 36???59
 37Le Thanh Hai - HUBT University58
 38Adrian Vidal57
 39zhaiyu56
 39akash sinha56
 39Prospero56
 42Vu Van Tuyen - HUBT University55
 43Josh Bao54
 43StrangeMonster54
 43Usshellub54
 46Jake Randolph Muncada53
 47Mahbububur Rahman52
 47Vincentius Madya Putra Indramawan52
 49Kyle See51
 49???51
 49marjana51
 49Anmol Gulati51
 53Imam Mohammad Bokhary50
 53Pepe50
 55Jian Lee47
 55Eric Wang47
 55Half Blood Prince47
 58Shafiqul Islam Anik46
 58Tomas46
 58Floris46
 61123321321 (CJCU, Taiwan)45
 61Jeru45
 63Caesar Stefanus44
 63Neal Zane44
 63???44
 66Irwan AP43
 66Vernon43
 66bxf43
 66bly43
 66Duhan Caraciolo [UFPE]43
 66Dai-Ni Hsieh43
 72YanHan42
 72??42
 72Time-UFPE42
 75try41
 75mobasshir(mbstu_ict 01712492935)41
 75Willson wijaya41
 75sobhan41
 79Aninda Majumder40
 79Qxect40
 79Yelinyan40
 79Marco Vincenzo40
 83Matteo Almanza39
 83Carlson Cheng39
 83Thanatos39
 86azharuddin ahmed38
 87Mustafa A. Abdel-Tawwab Jr.37
 87AC_coral37
 87????37
 87Wira Abdillah37
 91MD. Tamal Tahasin Khan36
 91Jawad Siddique36
 91MUKUND MADHAV THAKUR36
 91nazmulhasan36
 91Israel Batista36
 96anwar hussen wadud35
 96practice35
 96tony suarez35
 96Kawin Teeraprapkajorndet35
 96???35
 96MD.ABDUL WADUD35

2013年5月21日 星期二

UVa 12470 -- Tribonacci


Key: Linear algebra

http://en.wikipedia.org/wiki/Recurrence_relation

http://en.wikipedia.org/wiki/Companion_matrix



原問題:

Problem J. Tribonacci
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. Got it?
Leonardo Pisano Bigollo 
13th Century

Everybody knows about Fibonacci, they guy who invented the famous sequence where the first two terms are 0 and 1 and from then on every term is the sum of the previous two.

What most people don’t know is that he had a somewhat mentally retarded brother named Tribonacci. In a desperate attempt to surpass his brother and achieve eternal glory, Tribonacci invented his own sequence: the first three terms are 0, 1, 2 and from then on every term is the sum of the previous three.

Sadly, regardless of enormous courage and dedication, Tribonacci was never able to compute more than the first 3 terms of his sequence. Even more sadly, one cold night he performed an extraordinary mental effort that dilated one of the blood vessels in his brain, causing severe hemorrhage and killing him instantly. This is clinically known as an aneurysm, but of course Tribonacci did not know this (it is suspected that even pronouncing the word aneurysm would have been an impossible task for him).

Write a program that changes history and finds the nth term in the Tribonacci sequence modulo 1,000,000,009.



1,000,000,009 這數字是有意義的,因為這是個質數,取 mod 之後,

幾乎很難誤打誤撞瞎到正確答案。



因為是寫程式,所以計算高次方矩陣不能傻傻的算,

要用已知的訊息加速,這樣可以把單純 O(n) 算法降到 O(log n)。

((說不定有人覺得 O(log n) 算法也很單純))



總之,類似題 UVa 10689 - Yet another Number Sequence

還有一種是故意問你很大的 Fibonacci number,

此時可以開 array 簡單模擬大數,畢竟 Fibonacci sequence 只是簡單的加法運算。

2013年5月18日 星期六

UVa 10642 -- Can You Solve It?


先不看題目,先關心一個問題:the set of all rational numbers is countable.

http://en.wikipedia.org/wiki/Countable

The Cantor pairing function assigns one natural number to each pair of natural numbers.

這樣就能證明有理數是可數的 ((當然還有其他證明,請看 Royden, Real Analysis))




回到題目,擺明就是問 Cantor pairing function。簡單題得證

通常反著問會困難許多,UVa 880,

如果直接計算會碰到 sqrt(8n+1),這又牽涉到浮點數誤差問題,很煩。



程式:


2013年5月17日 星期五

UVa 11281 -- TRIANGULAR PEGS IN ROUND HOLES


簡單題。

http://uva.onlinejudge.org/external/112/11281.html

給定三角形,求最小半徑的圓洞 x,讓三角形 PEGS 剛好通過圓洞。

第一個想法是求三角形外接圓半徑。

T = sqrt[p(p-a)(p-b)(p-c)] = abc/(4R),其中 p = (a+b+c)/2 三角形半周長,

這樣可以得出 R。

x = R,是嗎?



但如果是鈍角三角形,這樣的 R 似乎又太大了,

考慮退化三角形,線段 ((此時 R 為無窮大)),只要線段通過圓洞就可以了。

x = max(a/2, b/2, c/2)

鈍角三角形判斷可以利用餘弦定理,

a^2 = b^2 + c^2 - 2bc cos(A),當 A > 90度,cos(A) < 0,

此時 a^2 > b^2 + c^2,a 為最長邊,x = a/2。

((大角對大邊,不會有第二個角 > 90 度,因為三角形內角和 180 度))

https://github.com/Meng-Gen/UVa/blob/master/UVa/acm_11281.cc



加強版類似題,TopCoder TVTower (SRM 183 Division I Level 2)

http://community.topcoder.com/stat?c=problem_statement&pm=2260&rd=4735

Divide and conquer

UVa 12302 -- Nine-Point Circle


簡單題。

九點圓問題看似複雜,但因為通過 the midpoint of each side of the triangle,

也就是說,算出三中點坐標,例如 AB 中點坐標就是 ((Ax + Bx)/2, (Ay + By)/2)

有三中點,就能直接算出九點圓的圓心坐標跟半徑。

http://uva.onlinejudge.org/external/123/12302.html



程式碼也是短短的:

https://github.com/Meng-Gen/UVa/blob/master/UVa/acm_12302.cc

圓的算法在 http://mathforum.org/library/drmath/view/55239.html

這可以減少浮點數計算誤差,簡單說就是聰明解,

(h-x1)^2 + (k-y1)^2 = r^2
(h-x2)^2 + (k-y2)^2 = r^2
(h-x3)^2 + (k-y3)^2 = r^2

雖然有二次項,但只要兩兩相減,不僅消掉 h^2, k^2,一併也把 r^2 消掉,

變成純 h, k 的二元一次連立方程式,這個解就簡單了。



跟 UVa 190 幾乎一樣,不過 UVa 190 比較機車,需要用心處理 output format

UVa 11164 -- Kingdom Division


簡單題,不過很少人 submit。

要衝高名次,除了讓演算法比別人快,最好還是 submit 很少人寫的題目。

如果某題沒有人 AC,你 AC 了,肯定是第一名無誤。



http://uva.onlinejudge.org/external/111/11164.html

這題是數學題,拉出輔助線 AX 利用面積比例關係,國中水準數學就能解題。

底下把註解貼上來,


// Connect the line segment AX and quadrilateral AEXF is divided into
// two pieces: triangle AEX and triangle AFX.
//
// Let x = [AEX], area of triangle AEX; y = [AFX], area of triangle AFX.
//
// (1) On the line segment BE:
// [ABX] : [AEX] = BX : EX = [CBX] : [CEX]
// <=> (a+y) : x = b : c <=> bx = c(a+y).
//
// (2) On the line segment CF:
// [AFX] : [ACX] = FX : CX = [BFX] : [BCX]
// <=> y : (c+x) = a : b <=> by = a(c+x).
//
// By (1)(2), solve x and y in terms of a, b, c.
// The result will be x+y = ac(a+2b+c)/(b^2 - ac) if b^2 - ac > 0.
//
// Note that a and c are symmetric. So if we exchange a and c,
// the result will not be changed (sanity check).

某方面來說,程式的可讀性要自己來做,不能光抱怨別人。

a*c*(a + 2*b + c)/(b*b - a*c) 算是蠻不能解釋的運算。

2013年5月15日 星期三

Computational Geometry -- UVa


Computational Geometry 寫久了真的會上癮,

或許是 % AC 比較高,但還是有那種一直吃 WA 的怪題目。



解三角形原則上就三條公式:

(1) 正弦定理 (2) 餘弦定理 (3) 海龍公式求面積

以上內容高中數學肯定有教。



UVa 12300 -- Root :: Rujia Liu's Presents :: Present 4: Dedicated to Geometry and CG Lovers

雖然很簡單,不過 AC 後頗有無謂的成就感。



UVa 11281 -- 外接圓半徑 R 滿足 T = abc/(4R),T 三角形面積用海龍公式算。

注意鈍角三角形情況,用外接圓鈍角三角形反而高估了,

因為我可以找到更小的圓去套他,圓的直徑剛好是最長邊就夠了。

說到鈍角判斷,餘弦定理用一下,a^2 > b^2 + c^2,感覺就是超順的。

再不行就 Google,這玩意肯定可以找到。



Source code: 



2013年5月13日 星期一

一個專案的目標?


Stocktotal Project: https://github.com/Meng-Gen/stocktotal

主要精神來自郭恭克老大的聖經《獵豹財務長給投資新手的第一堂課》。



一個專案的成敗,到底該以甚麼為目標呢?

打廣告建立品牌?或者是挹注實際收益?沒有絕對答案,

今天下午公司 World Cafe 給我許多好點子,究竟專案的意義是甚麼?



回頭看 Stocktotal。


這是剛開始的記錄,老實說專案沒有問題

是自己一廂情願的解釋害了自己,這是很寶貴的一課,

甚麼是真正的問題?通常是人錯了。

當然專案也有一點問題,例如撈 database 資料撈到 NULL,沒有檢查資料的完整性。



經過一般調整之後,今天砍光,原因寫在《獵豹財務長給投資新手的第一堂課》,

裡面談到營收跟實務如何結合。


這樣就是成功的專案嗎?我想並不是。

因為根本沒有所謂的成功或失敗

更何況專案能不能賺錢,很多因素不如想像中的好控制,做生意真的好困難。



((後見之明?))

((今天下午討論很實在,即使是天馬行空的亂想,也有那麼一點的真實))

2013年5月12日 星期日

Dynamic Programming -- Maximum subarray problem


WIKI: http://en.wikipedia.org/wiki/Maximum_subarray_problem



仔細想想 Kadane's algorithm 為什麼正確?為什麼 T(n) = O(n)

如果將 array 1D 維度推廣到 matrix 2D 維度,

可以將問題化成 O(n^2) 個 maximum subarray problems,

因此 T(n) = O(n^3)。





2013年5月6日 星期一

投機心理書籍介紹


一。安德烈‧科斯托蘭尼,三部曲,

《一個投機者的告白》

《一個投機者的告白》之金錢遊戲

《一個投機者的告白》之證券心理學

分享裡面一個題目,對於長年有經驗但無成就的股票族的意見,我認為

(a) 很重要 

(b) 不怎麼重要

(c) 根本不重要

答案很簡單,只要知道心理學在投機的角色就可以了。

看對還要做對,最重要的就是心理因素。所以答案是 (a)。

還有一題,人們能贏回輸掉的錢嗎?

(a) 根本不會

(b) 有時有可能

理論上根本不會,心理上卻是很難接受輸掉,只想再贏回來。



二。蘇黎士投機定律

最受用的一條定律:當船開始下沈時,不要禱告,趕快脫身。

這還是一樣,心理很難接受失敗的事實。

買進的理由消失,我會不計成本用跌停價賣掉,

我只在意對錯,而不在意成本價到底多少,雖說如此,

帳戶數字仍是十分殘忍,特別是空頭很多人根本不願計算自己賠了多少,

或多或少也有禱告的影子在吧。



三。華爾街1901

昨天剛買覺得不錯。

根據書中第一個故事,絕對不要建議任何朋友股票標的


2013年5月4日 星期六

UVa Online Judge -- 100 Submission


不是解題數。裡面寫超多 Ad Hoc 無腦簡單題,熟悉一下寫程式的感覺。


2013年5月2日 星期四

旭軟獲利股利雙登頂 今股價跳空漲停開出創2年新高

旭軟獲利股利雙登頂 今股價跳空漲停開出創2年新高

2013/05/02 09:35 鉅亨網 記者張欽發 台北

上櫃軟板廠旭軟電子 (3390) 2012年財報有佳績,全年稅後盈餘2.86億元,每股稅後盈餘達5.15元,30日經董事會通過對去年股利配發4元的現金股息,包括旭軟電子的去年盈餘及股利發放額度都創下歷史新高;而旭軟股價今天受此激勵也以跳空漲停47.9元開出,創24個月來新高。

在觸控產品、手持式產品市場大量推出新產品上市的挹注之下,旭軟電子在對新產品、新客戶的交貨量挺升之下,旭軟電子2013年第1季的業績表現亮麗,其營收3.27億元達到去年第4季旺季的水準;同時,旭軟董事會通過第1季財報稅後盈餘8956萬元,每股稅後盈餘也達1.47元。

旭軟電子董事會先前敲定6月14日召開股東會,而對於去年的盈餘分派,則在30日董事會敲定配發4元現金,以今天旭軟的開盤價47.9元計算,其配發4元的現金股息現金殖利率高達8.35%。

旭軟電子在對新產品、新客戶的交貨量自去年以來挺升,而旭軟電子2013年第1季的業績表現亮麗,其營收3.27億元達到去年第4季旺季的水準;旭軟2013年第1季財報稅後盈餘8956萬元,每股稅後盈餘也達1.47元。

而台郡科技 (6269) 2013年第1季每股稅後盈餘為2.02元。




Comments: 繼續觀察。

DFS 應用 -- 找 bipartite graph


Example: UVa 10004

完全沒有其他變化。



Source code (AC):
https://bitbucket.org/Menggen/uva/src/17251700c3506f8b3dbb52e9af85940698f5b297/UVa/acm_10004.cc?at=master

TopCoder 類似題 Marketing: https://bitbucket.org/Menggen/topcoder/src/e6eb73ba1909b6efb9fcbbe10e5de944479bf8af/TopCoder/GraphPractice/Marketing.cs?at=master