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
\(\Huge \text{🌱 Free Contest 131 - HURRYBIRD}\)
🔗 Link: https://oj.vnoi.info/problem/fc131_hurrybird
📌 Tags:
Math
,Implementation
👤 Writer: @SPyofgame
👥 Contributor: @mạnh, @kazamahoang
📋 Content:
Hướng dẫn
Nhận thấy rằng:
Gọi \(a\) là chi phí để di chuyển \(1\) bước sang ngang hoặc sang dọc
Gọi \(b\) là chi phí để di chuyển \(1\) bước sang đường chéo kề góc
Gọi \(d_x\) là số bước tối thiểu cần di chuyển để đi theo hàng \(1 \rightarrow n\), ta có \(d_x = |n - 1|\)
Gọi \(d_y\) là số bước tối thiểu cần di chuyển để đi theo cột \(1 \rightarrow m\), ta có \(d_y = |m - 1|\)
Gọi \(d_z\) là số bước ngang, dọc tối thiểu cần di chuyển thêm nếu chỉ đi theo đường chéo từ ô \((1, 1)\), ta có \(d_z = \begin{cases} 1 & d_x \equiv d_y \pmod 2 \\ 0 & d_x \not\equiv d_y \pmod 2 \end{cases}\)
Không mất tính tổng quát, ta xét \(0 \leq d_x \leq d_y\)
Khi \(d_x = 0\) thì ta không thể đi được đường chéo vì chim không được đi ra khỏi lưới, nên chỉ có thể đi đường ngang
Ngược lại, ta xét \(3\) trường hợp:
Code
Mạnh's Code
SPyofgame Code
Bonus