假設我們有以下權重圖,求解節點0到節點4的最短路徑。
digraph {
nodesep=1.0 // increases the separation between nodes
graph [rankdir=LR]
node [color=lightblue2, style=filled,shape=egg] //All nodes will this shape and colour
//All the lines look like this
0->1 [label=3]
0->2 [label=5]
1->3 [label=6]
1->4 [label=12]
3->4 [label=13]
2->4 [label=6]
}
在此類型問題中,或許會詢問此圖最短路徑長度為何?只要輸出11就可得到分數。若輸出11以外的數字,則為零分。
C/C++, Java, Python
作業系統:Windows 10企業版、Ubuntu 22.04.1 LTS
編譯參數:
C++17 / g++
/usr/bin/g++ -DEVAL -std=gnu++17 -O2 -pipe -static -s -o [problem name] [problem name].cpp
C11 / gcc
/usr/bin/gcc -DEVAL -std=gnu11 -O2 -pipe -static -s -o [problem name] [problem name].c -lm
Java / JDK
/usr/bin/javac [problem name].java
/bin/sh -c jar cf [problem name].jar *.class
Python 3 / CPython
/usr/bin/python3 -m compileall -b .
/bin/mv [problem name].pyc main.pyc
/usr/bin/zip [problem name].pyz main.pyc
可用之編輯器/IDE:Dev-C++、Codeblocks、vscode、vim
9:30 ~ 10:00 報到 (三樓電腦教室 教室代碼 65304)
10:00 ~ 10:30 機器測試
10:30 ~ 12:00 正式測驗
機器測試僅能攜帶文具進入試場,且須依照現場座位表入座,正式測驗時的座位亦同。
https://cplusplus.com/reference/
https://en.cppreference.com/w/
https://docs.python.org/3/reference/index.html
https://docs.oracle.com/javase/8/docs/api/java/lang/ref/Reference.html
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