--- title: 進階組(A) tags: 活動 --- # 進階組(A) 主要面相修過資料結構與演算法、包含但不侷限於資工與應數二年級之學生, 或是想以CPE 3題以上、NCPU銅牌以上為目標者。 > 競賽時長:4小時 > 題目數量:6~8題 題型涵蓋: * **資料結構(Data Structure):** * 佇列(Queue)、堆疊(Stack)、映射(Map)、集合(Set)、優先佇列(Priority Queue)、 鏈結串列(Linked-List)、樹(Tree) * **基礎演算法(Simple Algorithms):** * 排序(Sorting)、遞迴(Recursion)、搜尋(Search)、貪婪法(Greedy) * **分治法(Divide & Conquer):** * 逆序數對(Inversions)、DFS、BFS、二元搜尋(Binary Search)、三元搜尋(Ternary Search) * **數論(Number Theory):** * GCD/LCM、因數(Factor)、質數(Prime)、模運算(Modular Arithmetic)、費氏數列(Fibonacci) * **數學(Mathematics):** * 巴斯卡三角形(Pascal Triangle)、計算幾何(Computational Geometry)、機率(Capability)、 位元運算(Bitwise Operation) 題目特別設計: 因為部分題目屬於資結與演算法尚未教到之內容,所以大部分題目會採用引導式作答 --- # Easy 範題 ─ 括弧配對 給定一個僅帶有括弧的字串,其僅由以下3種成對括弧所組成:`()[]{}`, **Input** > 第一行僅輸入一正整數 $T$,代表測資數量,接下來會有 $T$ 行,每行輸入僅有括弧的字串 $S$ > $T\leq1000$, $|S|\leq1000$ ( $|S|$ : 字串長度 ) > **Output** > 對於每組輸入,請依據題意判斷該括弧字串 $S$ 是否皆配對成功, > 若有該字串能成功配對,輸出`"It's perfect!"`,否則輸出:`Something goes wrong...` | Sample Input | Output | | -------- | -------- | | `()()`<br>`[(])`<br>`{([()])}` | `It's perfect!`<br>`Something goes wrong...`<br>`It's perfect!`| ###### **type:** `Loop`, `Logical Operation`, `Stack`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up