Skip to content

Commit

Permalink
e200: Add hpscotch 3
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Sep 18, 2024
1 parent 6495c62 commit 1d31dde
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 8 deletions.
1 change: 0 additions & 1 deletion leetcode

This file was deleted.

1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
2. 第二部分: 算法
3. 第三部分: 专题
4. 第四部分: leetcode 题解
5. 华为 OD 机试题解

## 反馈问题

Expand Down
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
- [最大相连男生数/学生方阵](od/2024e200/adjacent-schoolboys/index.md)
- [数字游戏](od/2024e200/digit-game/index.md)
- [寻找符合要求的最长子串 - 滑动窗口](od/2024e200/longest-substring/index.md)
- [跳格子3 - 动态规划](od/2024e200/hopscotch3/index.md)
- [二叉树计算 - 树](od/2024e200/calculate-binary-tree/index.md)
- [猴子吃桃/爱吃蟠桃的孙悟空 - 二分查找](od/2024e200/monkey-eats-peach/index.md)
- [机器人活动区域 - DFS](od/2024e200/moving-area-of-robot/index.md)
Expand Down
3 changes: 0 additions & 3 deletions src/od/.gitignore

This file was deleted.

7 changes: 7 additions & 0 deletions src/od/2024e200/hopscotch3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "e200-hopscotch3"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
3 changes: 3 additions & 0 deletions src/od/2024e200/hopscotch3/assets/input1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
6
1 -1 -6 7 -17 7
2
1 change: 1 addition & 0 deletions src/od/2024e200/hopscotch3/assets/output1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
38 changes: 38 additions & 0 deletions src/od/2024e200/hopscotch3/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 跳格子3

## 题目描述

小明和朋友们一起玩跳格子游戏, 每个格子上有特定的分数 score = [1, -1, -6, 7, -17, 7],

从起点score[0]开始, 每次最大的步长为k, 请你返回小明跳到终点 score[n-1] 时, 能得到的最大得分.

### 输入描述

- 第一行输入总的格子数量 n
- 第二行输入每个格子的分数 score[i]
- 第三行输入最大跳的步长 k

备注:

- 格子的总长度 n 和步长 k 的区间在 [1, 100000]
- 每个格子的分数 score[i][-10000, 10000] 区间中

### 输出描述

输出最大得分.

### 示例1

输入:

```text
{{#include assets/input1.txt}}
```

输出:

```text
{{#include assets/output1.txt}}
```

## 题解
3 changes: 3 additions & 0 deletions src/od/2024e200/hopscotch3/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
9 changes: 5 additions & 4 deletions src/od/2024e200/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
13. [最大相连男生数/学生方阵](adjacent-schoolboys/index.md)
14. [数字游戏](digit-game/index.md)
15. [寻找符合要求的最长子串 - 滑动窗口](longest-substring/index.md)
16. [二叉树计算 - 树](calculate-binary-tree/index.md)
17. [猴子吃桃/爱吃蟠桃的孙悟空 - 二分查找](monkey-eats-peach/index.md)
18. [机器人活动区域 - DFS](moving-area-of-robot/index.md)
19. [简易压缩算法/一种字符串压缩表示的解压 - 字符串](compress-string/index.md)
16. [跳格子3 - 动态规划](hopscotch3/index.md)
17. [二叉树计算 - 树](calculate-binary-tree/index.md)
18. [猴子吃桃/爱吃蟠桃的孙悟空 - 二分查找](monkey-eats-peach/index.md)
19. [机器人活动区域 - DFS](moving-area-of-robot/index.md)
20. [简易压缩算法/一种字符串压缩表示的解压 - 字符串](compress-string/index.md)

0 comments on commit 1d31dde

Please sign in to comment.