有些內容使用中英雙語,有些只有英文或中文。歡迎使用與分享任何內容,但先來信告知並標示此部落格為出處。
Some parts use both Chinese and English, but some parts use only one language. Feel free to share, but please contact me first and list this blog as your reference.

2014年3月15日 星期六

Python 學習小筆記 (一) - Python Syntax and Tip Calculator

Python 學習小筆記 for Codecademy Python

用於自我複習跟快速入門,因我對C, C++, JAVA更有經驗,所以這份筆記是以學過前述語言的角度所撰,如果以前學過這三種語言之一,可能會看得比較順,如果沒有請去找正規一點的教學吧XD

前往 Python 學習小筆記 (二) - Strings & Console Output


1.          statement結尾不用加上Ex: tmp_int = 5

2.          變數不用宣告,直接用
3.          變數型態有: int, float, bool (True, False 而非true, false)
4.          變數命名。Ex: variable_bool = True

5.          # 來加上一行的註解(不是用//開頭)
6.          """"""來加上多行的註解 (不是使用 /* …. */,是使用三個雙引號)

7.          基本IO: 輸出,直接打 printEx: print variavle_name

8.          運算式,加(+) (-) (*) (/) modulo求餘數(%)都一樣
   開方不同,使用兩個* Ex: 2 ** 3 à23次方 (不是 2^3)


9.          Function 不使用{},用縮排(tab or 空格)來表示
  Function EX:

  def spam():
      eggs = 12
      return eggs
  print spam()

2014年3月13日 星期四

Codeforces - 401A Vanya and Cards

The following program is my ACcepted code for Codeforces -401A .
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃Codeforces 401A 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

2014年3月12日 星期三

[中譯題目] Codeforces - 379A New Year Candles

379 A. New Year Candles

時間限制: 每個 test case 1 秒
記憶體限制: 每個 test case 256 M

Vasily 這個程式設計師非常喜歡浪漫,所以今年他打算用蠟燭來點亮他的房間!

Vasily 有 a 個蠟燭。每當 Vasily 點燃一個新蠟燭,它會燃燒一個小時才熄滅。Vasily 非常聰明,他把 b 個熄滅的蠟燭組合成一個新的蠟燭! 這個組合而成的新蠟燭使用方法就跟其他新蠟燭一樣。

現在 Vasily 想知道: 如果他操作得當,他的蠟燭最多能照亮他的房間多久呢?

請你幫幫他找到答案吧!

Codeforces - 379A New Year Candles

The following program is my ACcepted code for Codeforces -379A .
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃Codeforces 379A 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )


2014年3月11日 星期二

Codeforces - 1A Theatre Square

The following program is my ACcepted code for Codeforces -1A.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃Codeforces 1A的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )


a有可能是1 ,所以當長*寬時可能會超過int的範圍,要使用long long int
a could be 1 so the result maybe over the range of int. Then we use long long int.

[OJ] 各個Online Judge(線上評測系統) 介紹

我將我從2014年開始重新解決的新、舊程式題目貼上來。
可以從部落格左方點依照不同OJ點進去,或是用右上角的 search 框框搜尋!
或是點進去 AC record 看我在不同OJ解決的各個題目。

ACM 國際大學生程序設計競賽(ACM International Collegiate Programming Contest, ICPC)是由美國計算機協會(ACM)主辦的,旨在展示大學生創新能力、團隊精神和在壓力下編寫程序、分析和解決問題能力的年度競賽。

ACM-ICPC 帶動了演算法程式設計的風氣。世界上許多大專院校的資訊系所,仿照 ACM-ICPC 的比賽模式,自行開發出即時線上比賽系統,能夠自動評分、計時、統計。學生藉由網路,就可切磋程式設計。這些系統大家普遍稱呼為「 Online Judge System 」、「 Online Judge 」。


下面介紹一些Online Judge 給大家做參考~

日語文法筆記 (二) - 指示代名詞、人稱代名詞

我有作成投影片,請點進來觀看。 :D

前往筆記 (一) - 肯定句、否定句、疑問句
前往筆記 (三) - 等待製作中 
    
第二課介紹下列:

1.     指示代名詞
これ、それ、あれ、どれ 
2.     人稱代名詞
你、我、他、誰
3.     我的、你的、他的、誰的
4.     指示代名詞
この、その、あの、どの

2014年3月10日 星期一

UVa OJ - 11984 A Change in Thermal Unit

The following program is my ACcepted code for UVA-11984.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃UVA 11984 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

點這裡看題目 Click here to see this Problem!

d = F1 - F2
-> 因為d是差距,所以在兩個F相減下會把32抵銷
-> Because d is the difference, the 2 F will balance the 32
-> C =  d * 5 / 9

Introduction to 3D Technology - 介紹3D科技

This is my presentation PowerPoint for the English course in 2nd college year.
It's a group presentation in English.
The topic is "3D Technology"

下面是我們組別在英文課時所製作的報告投影片
這份主題是 3D 科技!
由於是英文報告,所以大部分投影片內容沒有中文,不過有些英文難字還是有中文解釋。


2014年3月9日 星期日

NTHU OJ - 7654 - PE - 交換次數

The following program is my ACcepted code for NTHU-7654.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃NTHU 7654的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

點這裡看題目 Click here to see this Problem!

UVa OJ - 10810 Ultra-QuickSort

The following program is my ACcepted code for UVA-10810 .
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃UVA 10810 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )