原创 UVA 202 Repeating Decimals

Problem https://uva.onlinejudge.org/external/2/202.pdf Thinking 直式除法(詳細TODO) Solution #include<iostream> #include<cstdi

原创 UVA 1225 Digit Counting

Problem 第一個輸入為testcase次數 第二個數字為n代表從1寫到n寫在一起總共有幾個0-9總共出現多少次, example: 1. n = 3, 123這串數字裡0-9總共出現多少次 2. n = 13, 123

原创 ITSA [C_SO41-中] 撲克牌排序

Problem http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=20772 Thinking TODO Solution #include<iostream>

原创 UVA 10018 Reverse and Add

Problem https://uva.onlinejudge.org/external/100/10018.pdf Solution 主要是reverse函數, 完成了就差不多了 注意!! : 此題的數字範圍需要用到unsigned

原创 UVA 1368 DNA Consensus String

Problem http://write.blog.csdn.net/postlist Thinking 題意為給定很多個字串, 找出一個字串跟這些字串hamming distance的加總最小, 並印出此hamming distanc

原创 UVA 10062 Tell me the frequencies!

Problem https://uva.onlinejudge.org/external/100/10062.pdf Solution //UVa 10062 Tell me the frequencies! #include<iostr

原创 UVA 10474 Where is the Marble?

Problem https://uva.onlinejudge.org/external/104/10474.pdf Solution #include<iostream> #define MAX_NUM 10005 // 最大數字為10

原创 ITSA [C_SO06-中] 考試成績排名

Problem http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=2271 Thinking 對於排序, C++有內建兩種分別是 1. std::sor

原创 ITSA [C_MM058-中] 二項式求解

Problem http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?a=1005 Thinking TODO Solution #include <iostream> #

原创 online-judge 參考解答

當不出來的時候,去參考別人的code,去模仿也是好的學習方式,現在只有少少幾個,因為我還是初學,之後用到別的會在補上 zerojudge網站 Zerojudge ghaouse’s site <<高中生解題系統-參考答案>> zeroj

原创 Counting Sort 其實很簡單

準備工作 首先,先把自己當成小學生,盡量把自己變得笨一點不要想太多, counting sort沒有任何奇淫技巧, 小學畢業就行 開始 今天我去上小學, 老師給了你一堆數字, 叫你把這些數字個別計數有多少個, 因為我記憶力不好, 所以最簡

原创 ITSA [C_MM115-中] 奇妙數列

Problem http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=2969 Thinking TODO Solution #include <iostream>

原创 zerojudge b367: 翻轉世界

Problem http://zerojudge.tw/ShowProblem?problemid=b367 Thinking version1 矩陣翻轉180度其實就是上下翻轉之後,左右翻轉,最直覺的做法就是在做一個矩陣轉180度,然

原创 ITSA [C_ST53-易] 矩陣數字顯示

Problem http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=8018 Solution 這題的技巧我一開始想不到,我是參考這裡的,看到才恍然大悟原來這麼簡單

原创 zerojudge b374: [福州19中]衆數

Problem http://zerojudge.tw/ShowProblem?problemid=b374 Thinking 開一個表格計數所有數字出現的個數,然後從表格找出最常出現的數,因為可能會有出現次數一樣的問題,在最後要再檢查其