or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
進階STL:
priorty_queue set pair
2021/12/03 電算社第十堂社課
萬能標頭檔
存取概念
循序存取 (Sequential Access)

V.S.
隨機存取 (Random Access)
priority_queue
會依照大小順序排列的queue(由大排到小)
標頭檔
宣告
功能
greater(由小到大)
set
數學上的 set:

一堆東西,不重複、沒有順序
C++ 裡的 set:會自己排序好
標頭檔
pair
類似數對,但裡面可以存不是數字的東西
可以搭配其他STL使用(如vector)
標頭檔
宣告
初始化
功能
p.first
p.second
多層pair
pair x vector x algorithm
OJ練習
考完期中考了:D
在考完當天,1892班只出了數學一科的成績,
好勝的同學們想要排出誰的分數高,誰的分數低!
因次,他們決定使用c++ sort的方式進行。
他們想要製作出一張表,裡面記錄這20位同學,的座號和分數,
並且按照成績由小到大排序。
輸入說明:20位同學的座號(左)以及數學成績(右)
輸出說明:排列完的座號以及成績
我是防雷頁:D