bai-python-hwc 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bai_python_hwc/__init__.py +46 -0
- bai_python_hwc/answers/hwc101.py +38 -0
- bai_python_hwc/answers/hwc103.py +52 -0
- bai_python_hwc/answers/hwc104.py +45 -0
- bai_python_hwc/answers/hwc105.py +45 -0
- bai_python_hwc/answers/hwc106.py +56 -0
- bai_python_hwc/answers/hwc107.py +49 -0
- bai_python_hwc/answers/hwc108.py +45 -0
- bai_python_hwc/answers/hwc109.py +50 -0
- bai_python_hwc/answers/hwc110.py +42 -0
- bai_python_hwc/answers/hwc111.py +47 -0
- bai_python_hwc/answers/hwc112.py +42 -0
- bai_python_hwc/answers/hwc113.py +58 -0
- bai_python_hwc/answers/hwc114.py +58 -0
- bai_python_hwc/answers/hwc115.py +38 -0
- bai_python_hwc/answers/hwc116.py +44 -0
- bai_python_hwc/answers/hwc117.py +46 -0
- bai_python_hwc/answers/hwc118.py +47 -0
- bai_python_hwc/answers/hwc119.py +44 -0
- bai_python_hwc/answers/hwc120.py +41 -0
- bai_python_hwc/answers/hwc121.py +50 -0
- bai_python_hwc/answers/hwc122.py +54 -0
- bai_python_hwc/answers/hwc123.py +43 -0
- bai_python_hwc/answers/hwc124.py +41 -0
- bai_python_hwc/answers/hwc125.py +52 -0
- bai_python_hwc/answers/hwc126.py +40 -0
- bai_python_hwc/answers/hwc127.py +41 -0
- bai_python_hwc/answers/hwc128.py +39 -0
- bai_python_hwc/answers/hwc130.py +46 -0
- bai_python_hwc/answers/hwc131.py +46 -0
- bai_python_hwc/answers/hwc132.py +38 -0
- bai_python_hwc/answers/hwc133.py +61 -0
- bai_python_hwc/answers/hwc134.py +45 -0
- bai_python_hwc/answers/hwc135.py +49 -0
- bai_python_hwc/answers/hwc136.py +43 -0
- bai_python_hwc/answers/hwc201.py +47 -0
- bai_python_hwc/answers/hwc202.py +47 -0
- bai_python_hwc/answers/hwc203.py +48 -0
- bai_python_hwc/answers/hwc204.py +61 -0
- bai_python_hwc/answers/hwc205.py +56 -0
- bai_python_hwc/answers/hwc206.py +53 -0
- bai_python_hwc/answers/hwc207.py +43 -0
- bai_python_hwc/answers/hwc208.py +57 -0
- bai_python_hwc/answers/hwc209.py +42 -0
- bai_python_hwc/answers/hwc210.py +46 -0
- bai_python_hwc/answers/hwc211.py +62 -0
- bai_python_hwc/answers/hwc212.py +58 -0
- bai_python_hwc/answers/hwc213.py +54 -0
- bai_python_hwc/answers/hwc214.py +55 -0
- bai_python_hwc/answers/hwc215.py +53 -0
- bai_python_hwc/answers/hwc216.py +50 -0
- bai_python_hwc/answers/hwc217.py +38 -0
- bai_python_hwc/answers/hwc218.py +44 -0
- bai_python_hwc/answers/hwc219.py +49 -0
- bai_python_hwc/answers/hwc220.py +58 -0
- bai_python_hwc/answers/hwc221.py +49 -0
- bai_python_hwc/answers/hwc222.py +48 -0
- bai_python_hwc/answers/hwc223.py +39 -0
- bai_python_hwc/answers/hwc224.py +47 -0
- bai_python_hwc/answers/hwc225.py +50 -0
- bai_python_hwc/answers/hwc226.py +41 -0
- bai_python_hwc/answers/hwc227.py +40 -0
- bai_python_hwc/answers/hwc228.py +41 -0
- bai_python_hwc/answers/hwc229.py +51 -0
- bai_python_hwc/answers/hwc230.py +41 -0
- bai_python_hwc/answers/hwc231.py +39 -0
- bai_python_hwc/answers/hwc232.py +44 -0
- bai_python_hwc/answers/hwc233.py +49 -0
- bai_python_hwc/answers/hwc234.py +52 -0
- bai_python_hwc/answers/hwc235.py +45 -0
- bai_python_hwc/answers/hwc236.py +53 -0
- bai_python_hwc/answers/hwc237.py +56 -0
- bai_python_hwc/answers/hwc238.py +52 -0
- bai_python_hwc/answers/hwc239.py +60 -0
- bai_python_hwc/answers/hwc240.py +45 -0
- bai_python_hwc/answers/hwc241.py +48 -0
- bai_python_hwc/answers/hwc242.py +50 -0
- bai_python_hwc/answers/hwc243.py +61 -0
- bai_python_hwc/answers/hwc244.py +61 -0
- bai_python_hwc/answers/hwc245.py +47 -0
- bai_python_hwc/answers/hwc246.py +52 -0
- bai_python_hwc/answers/hwc247.py +76 -0
- bai_python_hwc/answers/hwc301.py +44 -0
- bai_python_hwc/answers/hwc302.py +53 -0
- bai_python_hwc/answers/hwc303.py +63 -0
- bai_python_hwc/answers/hwc304.py +56 -0
- bai_python_hwc/answers/hwc305.py +59 -0
- bai_python_hwc/answers/hwc306.py +60 -0
- bai_python_hwc/answers/hwc307.py +50 -0
- bai_python_hwc/answers/hwc308.py +59 -0
- bai_python_hwc/answers/hwc309.py +48 -0
- bai_python_hwc/answers/hwc310.py +38 -0
- bai_python_hwc/answers/hwc311.py +48 -0
- bai_python_hwc/answers/hwc312.py +49 -0
- bai_python_hwc/answers/hwc313.py +54 -0
- bai_python_hwc/answers/hwc314.py +49 -0
- bai_python_hwc/answers/hwc315.py +63 -0
- bai_python_hwc/answers/hwc316.py +65 -0
- bai_python_hwc/answers/hwc317.py +57 -0
- bai_python_hwc/answers/hwc318.py +55 -0
- bai_python_hwc/answers/hwc319.py +50 -0
- bai_python_hwc/answers/hwc320.py +84 -0
- bai_python_hwc/answers/hwc321.py +49 -0
- bai_python_hwc/answers/hwc322.py +49 -0
- bai_python_hwc/answers/hwc323.py +69 -0
- bai_python_hwc/answers/hwc324.py +66 -0
- bai_python_hwc/answers/hwc325.py +49 -0
- bai_python_hwc/answers/hwc326.py +53 -0
- bai_python_hwc/answers/hwc327.py +38 -0
- bai_python_hwc/answers/hwc328.py +50 -0
- bai_python_hwc/answers/hwc329.py +59 -0
- bai_python_hwc/answers/hwc330.py +45 -0
- bai_python_hwc/answers/hwc332.py +57 -0
- bai_python_hwc/answers/hwc401.py +50 -0
- bai_python_hwc/answers/hwc402.py +43 -0
- bai_python_hwc/answers/hwc403.py +73 -0
- bai_python_hwc/answers/hwc404.py +51 -0
- bai_python_hwc/answers/hwc405.py +62 -0
- bai_python_hwc/answers/hwc406.py +66 -0
- bai_python_hwc/answers/hwc407.py +49 -0
- bai_python_hwc/answers/hwc408.py +67 -0
- bai_python_hwc/answers/hwc409.py +51 -0
- bai_python_hwc/answers/hwc410.py +52 -0
- bai_python_hwc/answers/hwc411.py +57 -0
- bai_python_hwc/answers/hwc412.py +53 -0
- bai_python_hwc/answers/hwc413.py +65 -0
- bai_python_hwc/answers/hwc414.py +50 -0
- bai_python_hwc/answers/hwc415.py +61 -0
- bai_python_hwc/answers/hwc416.py +69 -0
- bai_python_hwc/answers/hwc418.py +47 -0
- bai_python_hwc/answers/hwc419.py +62 -0
- bai_python_hwc/answers/hwc421.py +51 -0
- bai_python_hwc/answers/hwc424.py +48 -0
- bai_python_hwc/answers/hwc501.py +63 -0
- bai_python_hwc/answers/hwc502.py +69 -0
- bai_python_hwc/answers/hwc503.py +75 -0
- bai_python_hwc/answers/hwc504.py +52 -0
- bai_python_hwc/answers/hwc505.py +63 -0
- bai_python_hwc/answers/hwc506.py +61 -0
- bai_python_hwc/answers/hwc508.py +60 -0
- bai_python_hwc/answers/hwc509.py +85 -0
- bai_python_hwc/answers/hwc510.py +56 -0
- bai_python_hwc/answers/hwc511.py +52 -0
- bai_python_hwc/answers/hwc513.py +63 -0
- bai_python_hwc/answers/hwc514.py +74 -0
- bai_python_hwc/answers/hwc515.py +83 -0
- bai_python_hwc/answers/hwc516.py +67 -0
- bai_python_hwc/answers/hwc517.py +46 -0
- bai_python_hwc/answers/hwc520.py +54 -0
- bai_python_hwc/answers/hwc526.py +58 -0
- bai_python_hwc/attachments/hwc424.pdf +0 -0
- bai_python_hwc/attachments/hwc501.pdf +0 -0
- bai_python_hwc/questions/hwc101.txt +17 -0
- bai_python_hwc/questions/hwc103.txt +27 -0
- bai_python_hwc/questions/hwc104.txt +22 -0
- bai_python_hwc/questions/hwc105.txt +23 -0
- bai_python_hwc/questions/hwc106.txt +26 -0
- bai_python_hwc/questions/hwc107.txt +29 -0
- bai_python_hwc/questions/hwc108.txt +18 -0
- bai_python_hwc/questions/hwc109.txt +24 -0
- bai_python_hwc/questions/hwc110.txt +16 -0
- bai_python_hwc/questions/hwc111.txt +25 -0
- bai_python_hwc/questions/hwc112.txt +13 -0
- bai_python_hwc/questions/hwc113.txt +28 -0
- bai_python_hwc/questions/hwc114.txt +35 -0
- bai_python_hwc/questions/hwc115.txt +15 -0
- bai_python_hwc/questions/hwc116.txt +13 -0
- bai_python_hwc/questions/hwc117.txt +14 -0
- bai_python_hwc/questions/hwc118.txt +25 -0
- bai_python_hwc/questions/hwc119.txt +18 -0
- bai_python_hwc/questions/hwc120.txt +23 -0
- bai_python_hwc/questions/hwc121.txt +26 -0
- bai_python_hwc/questions/hwc122.txt +21 -0
- bai_python_hwc/questions/hwc123.txt +21 -0
- bai_python_hwc/questions/hwc124.txt +19 -0
- bai_python_hwc/questions/hwc125.txt +31 -0
- bai_python_hwc/questions/hwc126.txt +18 -0
- bai_python_hwc/questions/hwc127.txt +17 -0
- bai_python_hwc/questions/hwc128.txt +14 -0
- bai_python_hwc/questions/hwc130.txt +23 -0
- bai_python_hwc/questions/hwc131.txt +19 -0
- bai_python_hwc/questions/hwc132.txt +16 -0
- bai_python_hwc/questions/hwc133.txt +39 -0
- bai_python_hwc/questions/hwc134.txt +22 -0
- bai_python_hwc/questions/hwc135.txt +29 -0
- bai_python_hwc/questions/hwc136.txt +20 -0
- bai_python_hwc/questions/hwc201.txt +20 -0
- bai_python_hwc/questions/hwc202.txt +25 -0
- bai_python_hwc/questions/hwc203.txt +26 -0
- bai_python_hwc/questions/hwc204.txt +32 -0
- bai_python_hwc/questions/hwc205.txt +28 -0
- bai_python_hwc/questions/hwc206.txt +28 -0
- bai_python_hwc/questions/hwc207.txt +16 -0
- bai_python_hwc/questions/hwc208.txt +27 -0
- bai_python_hwc/questions/hwc209.txt +15 -0
- bai_python_hwc/questions/hwc210.txt +28 -0
- bai_python_hwc/questions/hwc211.txt +35 -0
- bai_python_hwc/questions/hwc212.txt +29 -0
- bai_python_hwc/questions/hwc213.txt +27 -0
- bai_python_hwc/questions/hwc214.txt +27 -0
- bai_python_hwc/questions/hwc215.txt +28 -0
- bai_python_hwc/questions/hwc216.txt +22 -0
- bai_python_hwc/questions/hwc217.txt +17 -0
- bai_python_hwc/questions/hwc218.txt +18 -0
- bai_python_hwc/questions/hwc219.txt +22 -0
- bai_python_hwc/questions/hwc220.txt +28 -0
- bai_python_hwc/questions/hwc221.txt +18 -0
- bai_python_hwc/questions/hwc222.txt +20 -0
- bai_python_hwc/questions/hwc223.txt +18 -0
- bai_python_hwc/questions/hwc224.txt +23 -0
- bai_python_hwc/questions/hwc225.txt +26 -0
- bai_python_hwc/questions/hwc226.txt +18 -0
- bai_python_hwc/questions/hwc227.txt +15 -0
- bai_python_hwc/questions/hwc228.txt +16 -0
- bai_python_hwc/questions/hwc229.txt +20 -0
- bai_python_hwc/questions/hwc230.txt +18 -0
- bai_python_hwc/questions/hwc231.txt +13 -0
- bai_python_hwc/questions/hwc232.txt +19 -0
- bai_python_hwc/questions/hwc233.txt +21 -0
- bai_python_hwc/questions/hwc234.txt +27 -0
- bai_python_hwc/questions/hwc235.txt +18 -0
- bai_python_hwc/questions/hwc236.txt +23 -0
- bai_python_hwc/questions/hwc237.txt +28 -0
- bai_python_hwc/questions/hwc238.txt +25 -0
- bai_python_hwc/questions/hwc239.txt +28 -0
- bai_python_hwc/questions/hwc240.txt +21 -0
- bai_python_hwc/questions/hwc241.txt +25 -0
- bai_python_hwc/questions/hwc242.txt +23 -0
- bai_python_hwc/questions/hwc243.txt +35 -0
- bai_python_hwc/questions/hwc244.txt +25 -0
- bai_python_hwc/questions/hwc245.txt +24 -0
- bai_python_hwc/questions/hwc246.txt +28 -0
- bai_python_hwc/questions/hwc247.txt +51 -0
- bai_python_hwc/questions/hwc301.txt +23 -0
- bai_python_hwc/questions/hwc302.txt +26 -0
- bai_python_hwc/questions/hwc303.txt +32 -0
- bai_python_hwc/questions/hwc304.txt +32 -0
- bai_python_hwc/questions/hwc305.txt +31 -0
- bai_python_hwc/questions/hwc306.txt +31 -0
- bai_python_hwc/questions/hwc307.txt +29 -0
- bai_python_hwc/questions/hwc308.txt +30 -0
- bai_python_hwc/questions/hwc309.txt +25 -0
- bai_python_hwc/questions/hwc310.txt +15 -0
- bai_python_hwc/questions/hwc311.txt +23 -0
- bai_python_hwc/questions/hwc312.txt +19 -0
- bai_python_hwc/questions/hwc313.txt +26 -0
- bai_python_hwc/questions/hwc314.txt +27 -0
- bai_python_hwc/questions/hwc315.txt +21 -0
- bai_python_hwc/questions/hwc316.txt +36 -0
- bai_python_hwc/questions/hwc317.txt +28 -0
- bai_python_hwc/questions/hwc318.txt +27 -0
- bai_python_hwc/questions/hwc319.txt +26 -0
- bai_python_hwc/questions/hwc320.txt +42 -0
- bai_python_hwc/questions/hwc321.txt +27 -0
- bai_python_hwc/questions/hwc322.txt +26 -0
- bai_python_hwc/questions/hwc323.txt +24 -0
- bai_python_hwc/questions/hwc324.txt +40 -0
- bai_python_hwc/questions/hwc325.txt +21 -0
- bai_python_hwc/questions/hwc326.txt +25 -0
- bai_python_hwc/questions/hwc327.txt +16 -0
- bai_python_hwc/questions/hwc328.txt +15 -0
- bai_python_hwc/questions/hwc329.txt +26 -0
- bai_python_hwc/questions/hwc330.txt +27 -0
- bai_python_hwc/questions/hwc332.txt +26 -0
- bai_python_hwc/questions/hwc401.txt +25 -0
- bai_python_hwc/questions/hwc402.txt +24 -0
- bai_python_hwc/questions/hwc403.txt +37 -0
- bai_python_hwc/questions/hwc404.txt +23 -0
- bai_python_hwc/questions/hwc405.txt +29 -0
- bai_python_hwc/questions/hwc406.txt +34 -0
- bai_python_hwc/questions/hwc407.txt +24 -0
- bai_python_hwc/questions/hwc408.txt +28 -0
- bai_python_hwc/questions/hwc409.txt +25 -0
- bai_python_hwc/questions/hwc410.txt +23 -0
- bai_python_hwc/questions/hwc411.txt +34 -0
- bai_python_hwc/questions/hwc412.txt +29 -0
- bai_python_hwc/questions/hwc413.txt +28 -0
- bai_python_hwc/questions/hwc414.txt +27 -0
- bai_python_hwc/questions/hwc415.txt +27 -0
- bai_python_hwc/questions/hwc416.txt +36 -0
- bai_python_hwc/questions/hwc418.txt +25 -0
- bai_python_hwc/questions/hwc419.txt +28 -0
- bai_python_hwc/questions/hwc421.txt +23 -0
- bai_python_hwc/questions/hwc424.txt +20 -0
- bai_python_hwc/questions/hwc501.txt +23 -0
- bai_python_hwc/questions/hwc502.txt +41 -0
- bai_python_hwc/questions/hwc503.txt +36 -0
- bai_python_hwc/questions/hwc504.txt +18 -0
- bai_python_hwc/questions/hwc505.txt +25 -0
- bai_python_hwc/questions/hwc506.txt +32 -0
- bai_python_hwc/questions/hwc508.txt +24 -0
- bai_python_hwc/questions/hwc509.txt +42 -0
- bai_python_hwc/questions/hwc510.txt +25 -0
- bai_python_hwc/questions/hwc511.txt +23 -0
- bai_python_hwc/questions/hwc513.txt +25 -0
- bai_python_hwc/questions/hwc514.txt +35 -0
- bai_python_hwc/questions/hwc515.txt +46 -0
- bai_python_hwc/questions/hwc516.txt +26 -0
- bai_python_hwc/questions/hwc517.txt +20 -0
- bai_python_hwc/questions/hwc520.txt +27 -0
- bai_python_hwc/questions/hwc526.txt +36 -0
- bai_python_hwc-1.0.0.dist-info/METADATA +41 -0
- bai_python_hwc-1.0.0.dist-info/RECORD +305 -0
- bai_python_hwc-1.0.0.dist-info/WHEEL +5 -0
- bai_python_hwc-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:小行星碰撞
|
|
13
|
+
|
|
14
|
+
给定一个整数数组 asteroids,表示在同一行的小行星。
|
|
15
|
+
对于该数组中的每一个元素,其绝对值表示小行星的大小,正负表示小行星的移动方向(正表示向右移动,负表示向左移动)。
|
|
16
|
+
|
|
17
|
+
碰撞规则:
|
|
18
|
+
1.每一颗小行星以相同的速度移动。
|
|
19
|
+
2.两个小行星相互碰撞,较小的小行星会爆炸。
|
|
20
|
+
3.如果两颗小行星大小相同,则两颗小行星都会爆炸。
|
|
21
|
+
4.两颗移动方向相同的小行星,永远不会发生碰撞。
|
|
22
|
+
|
|
23
|
+
请你找出碰撞后剩下的所有小行星。
|
|
24
|
+
|
|
25
|
+
示例 1:
|
|
26
|
+
|
|
27
|
+
输入:asteroids = [5,10,-5]
|
|
28
|
+
输出:[5,10]
|
|
29
|
+
解释:10 和 -5 碰撞后只剩下 10 。 5 和 10 永远不会发生碰撞。
|
|
30
|
+
|
|
31
|
+
示例 2:
|
|
32
|
+
|
|
33
|
+
输入:asteroids = [8,-8]
|
|
34
|
+
输出:[]
|
|
35
|
+
解释:8 和 -8 碰撞后,两者都发生爆炸。
|
|
36
|
+
|
|
37
|
+
示例 3:
|
|
38
|
+
|
|
39
|
+
输入:asteroids = [10,2,-5]
|
|
40
|
+
输出:[10]
|
|
41
|
+
解释:2 和 -5 发生碰撞后剩下 -5 。10 和 -5 发生碰撞后剩下 10 。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:
|
|
13
|
+
|
|
14
|
+
给你一个大小为 m x n 的二进制矩阵 grid 。
|
|
15
|
+
岛屿 是由一些相邻的 1 (代表土地) 构成的组合,这里的「相邻」要求两个 1 必须在水平或者竖直的四个方向上相邻。
|
|
16
|
+
你可以假设 grid 的四个边缘都被 0(代表水)包围着。
|
|
17
|
+
岛屿的面积是岛上值为 1 的单元格的数目。请返回所有岛屿中的最大面积;若不存在岛屿,返回 0。
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
示例 1:
|
|
22
|
+
输入: grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],
|
|
23
|
+
[0,0,0,0,0,0,0,1,1,1,0,0,0],
|
|
24
|
+
[0,1,1,0,1,0,0,0,0,0,0,0,0],
|
|
25
|
+
[0,1,0,0,1,1,0,0,1,0,1,0,0],
|
|
26
|
+
[0,1,0,0,1,1,0,0,1,1,1,0,0],
|
|
27
|
+
[0,0,0,0,0,0,0,0,0,0,1,0,0],
|
|
28
|
+
[0,0,0,0,0,0,0,1,1,1,0,0,0],
|
|
29
|
+
[0,0,0,0,0,0,0,1,1,0,0,0,0]]
|
|
30
|
+
输出: 6
|
|
31
|
+
解释: 答案不应该是 11 ,因为岛屿只能包含水平或垂直这四个方向上的 1 。
|
|
32
|
+
|
|
33
|
+
示例 2:
|
|
34
|
+
|
|
35
|
+
输入: grid = [[0,0,0,0,0,0,0,0]]
|
|
36
|
+
输出: 0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:下一个数
|
|
13
|
+
给定一个正整数,找出与其二进制表达式中1的个数相同且大小最接近的那两个数(一个略大,一个略小)。
|
|
14
|
+
输出一个包含两个整数的列表。
|
|
15
|
+
|
|
16
|
+
示例:
|
|
17
|
+
输入:num = 2
|
|
18
|
+
输出:[4, 1]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:逆波兰表达式计算器
|
|
13
|
+
|
|
14
|
+
逆波兰表达式是一种数学表达式的表示方法,其中操作符在操作数的后面。例如,表达式 2 + 3 的逆波兰表示法是 2 3 +。逆波兰表达式具有以下特点:
|
|
15
|
+
|
|
16
|
+
逆波兰表达式不需要使用括号,因为操作符的位置已经明确表示了运算的优先级。
|
|
17
|
+
逆波兰表达式可以直接由计算机进行计算,而无需解析表达式。
|
|
18
|
+
编写一个 Python 程序,接受一个包含逆波兰表达式的字符串作为输入,计算并输出表达式的结果。
|
|
19
|
+
|
|
20
|
+
编写一个函数 TEST_DO_NOT_CHANGE(expression),它接受一个逆波兰表达式字符串 expression 作为参数,返回表达式的计算结果。
|
|
21
|
+
|
|
22
|
+
表达式只包含整数和 +、-、*、/ 四种二元运算符,记号之间以空格分隔;除法按真实数值计算,
|
|
23
|
+
表达式保证合法且除数不为 0。若输入不符合上述语法,函数应抛出 ValueError。
|
|
24
|
+
|
|
25
|
+
例如,如果输入字符串是 "2 3 +",程序应该返回 5,如果输入字符串是 "3 4 + 2 *",程序应该返回 14。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:给你一个字符串 s,找到 s 中最长的回文子串。
|
|
13
|
+
请注意,回文子串是指正着读和反着读都相同的字符串。
|
|
14
|
+
如果存在多个等长的最长回文子串,返回其中任意一个即可。
|
|
15
|
+
|
|
16
|
+
示例 1:
|
|
17
|
+
|
|
18
|
+
输入:s = "babad"
|
|
19
|
+
输出:"bab"
|
|
20
|
+
解释:"aba" 同样是符合题意的答案。
|
|
21
|
+
示例 2:
|
|
22
|
+
|
|
23
|
+
输入:s = "cbbd"
|
|
24
|
+
输出:"bb"
|
|
25
|
+
示例 3:
|
|
26
|
+
|
|
27
|
+
输入:s = "a"
|
|
28
|
+
输出:"a"
|
|
29
|
+
示例 4:
|
|
30
|
+
|
|
31
|
+
输入:s = "ac"
|
|
32
|
+
输出:"a"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:
|
|
13
|
+
|
|
14
|
+
给定一个由 0 和 1 组成的矩阵 mat ,请输出一个大小相同的矩阵,
|
|
15
|
+
其中每一个格子是 mat 中对应位置元素到最近的 0 的距离。两个相邻元素间的距离为 1 。
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
示例 1:
|
|
19
|
+
输入: mat = [[0,0,0],[0,1,0],[0,0,0]]
|
|
20
|
+
输出: [[0,0,0],[0,1,0],[0,0,0]]
|
|
21
|
+
|
|
22
|
+
示例 2:
|
|
23
|
+
输入: mat = [[0,0,0],[0,1,0],[1,1,1]]
|
|
24
|
+
输出: [[0,0,0],[0,1,0],[1,2,1]]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:
|
|
13
|
+
|
|
14
|
+
在给定的网格中,每个单元格可以有以下三个值之一:
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
值 0 代表空单元格;
|
|
18
|
+
值 1 代表新鲜橘子;
|
|
19
|
+
值 2 代表腐烂的橘子。
|
|
20
|
+
每分钟,任何与腐烂的橘子(在 4 个正方向上)相邻的新鲜橘子都会腐烂。
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
返回直到单元格中没有新鲜橘子为止所必须经过的最小分钟数。如果不可能,返回 -1
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
示例 1:
|
|
30
|
+
输入: [[2,1,1],[1,1,0],[0,1,1]]
|
|
31
|
+
输出: 4
|
|
32
|
+
|
|
33
|
+
示例 2:
|
|
34
|
+
输入: [[2,1,1],[0,1,1],[1,0,1]]
|
|
35
|
+
输出: -1
|
|
36
|
+
解释: 左下角的橘子(零基坐标为第 2 行、第 0 列,即自然语言中的第 3 行第 1 列)永远不会腐烂,因为腐烂只会发生在 4 个正方向上。
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
示例 3:
|
|
40
|
+
输入: [[0,2]]
|
|
41
|
+
输出: 0
|
|
42
|
+
解释: 因为 0 分钟时已经没有新鲜橘子了,所以答案就是 0 。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:
|
|
13
|
+
给你一个字符串 s,请你将 s 分割成一些子串,使每个子串都是 回文串 。返回 s 所有可能的分割方案。
|
|
14
|
+
注意,回文串 是正着读和反着读都一样的字符串。
|
|
15
|
+
当 s 为空字符串时,返回包含一个空分割方案的列表 `[[]]`。
|
|
16
|
+
|
|
17
|
+
示例 1:
|
|
18
|
+
|
|
19
|
+
输入:s = "aab"
|
|
20
|
+
输出:[["a","a","b"],["aa","b"]]
|
|
21
|
+
|
|
22
|
+
示例 2:
|
|
23
|
+
|
|
24
|
+
输入:s = "a"
|
|
25
|
+
输出:[["a"]]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:移掉 K 位数字
|
|
13
|
+
给你一个以字符串表示的非负整数num和一个整数k,移除这个数中的k位数字,使得剩下的数字最小。请你以字符串形式返回这个最小的数字
|
|
14
|
+
|
|
15
|
+
示例:
|
|
16
|
+
输入:num = "1432219", k = 3
|
|
17
|
+
输出:"1219"
|
|
18
|
+
解释:移除掉三个数字 4, 3, 和 2 形成一个新的最小的数字 1219 。
|
|
19
|
+
|
|
20
|
+
提示:
|
|
21
|
+
1 <= k <= num.length <= 105
|
|
22
|
+
num仅由若干位数字(0 - 9)组成
|
|
23
|
+
除了0本身之外,num不含任何前导零
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:复原IP地址
|
|
13
|
+
有效 IP 地址 正好由四个整数(每个整数位于 0 到 255 之间组成,且不能含有前导 0),整数之间用 '.' 分隔。
|
|
14
|
+
给定一个只包含数字的字符串 s ,用以表示一个 IP 地址,返回所有可能的有效 IP 地址,这些地址可以通过在 s 中插入 '.' 来形成。
|
|
15
|
+
|
|
16
|
+
注意:
|
|
17
|
+
1.你 不能 重新排序或删除 s 中的任何数字。
|
|
18
|
+
2.你可以按 任何 顺序返回答案。
|
|
19
|
+
|
|
20
|
+
例如:s = "101023"输出的结果为['1.0.10.23', '1.0.102.3', '10.1.0.23', '10.10.2.3', '101.0.2.3']
|
|
21
|
+
|
|
22
|
+
请分别复原以下几个字符串:
|
|
23
|
+
s1 = "25525511135"
|
|
24
|
+
s2 = "0000"
|
|
25
|
+
s3 = "192168101"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:
|
|
13
|
+
被围绕的区域:给你一个 m x n 的矩阵 board,由若干字符 'X' 和 'O',
|
|
14
|
+
找到所有被 'X' 围绕的区域,并将这些区域里所有的 'O' 用 'X' 填充,最后返回修改后的 board。
|
|
15
|
+
|
|
16
|
+
示例 1:
|
|
17
|
+
输入: board = [["X","X","X","X"],
|
|
18
|
+
["X","O","O","X"],
|
|
19
|
+
["X","X","O","X"],
|
|
20
|
+
["X","O","X","X"]]
|
|
21
|
+
输出: [["X","X","X","X"],
|
|
22
|
+
["X","X","X","X"],
|
|
23
|
+
["X","X","X","X"],
|
|
24
|
+
["X","O","X","X"]]
|
|
25
|
+
解释: 被围绕的区间不会存在于边界上,换句话说,任何边界上的 'O' 都不会被填充为 'X'。
|
|
26
|
+
任何不在边界上,或不与边界上的 'O' 相连的 'O' 最终都会被填充为 'X'。
|
|
27
|
+
如果两个元素在水平或垂直方向相邻,则称它们是“相连”的。
|
|
28
|
+
|
|
29
|
+
示例 2:
|
|
30
|
+
输入: board = [["X"]]
|
|
31
|
+
输出: [["X"]]
|
|
32
|
+
|
|
33
|
+
示例 3:
|
|
34
|
+
输入: board = [['O', 'O'], ['O', 'O']]
|
|
35
|
+
输出: [['O', 'O'], ['O', 'O']]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:公共钥匙盒
|
|
13
|
+
|
|
14
|
+
有一个学校的老师共用N个教室,按照规定,所有的钥匙都必须放在公共钥匙盒里,老师不能带钥匙回家。
|
|
15
|
+
每次老师上课前,都从公共钥匙盒里找到自己上课的教室的钥匙去开门,上完课后,再将钥匙放回到钥匙盒中。
|
|
16
|
+
钥匙盒一共有N个挂钩,从左到右排成一排,用来挂N个教室的钥匙。
|
|
17
|
+
一串钥匙没有固定的悬挂位置,但钥匙上有标识,所以老师们不会弄混钥匙。
|
|
18
|
+
每次取钥匙的时候,老师们都会找到自己所需要的钥匙将其取走,而不会移动其他钥匙。
|
|
19
|
+
每次还钥匙的时候,还钥匙的老师会找到最左边的空的挂钩,将钥匙挂在这个挂钩上。
|
|
20
|
+
如果有多位老师还钥匙,则他们按钥匙编号从小到大的顺序还。
|
|
21
|
+
如果同一时刻既有老师还钥匙又有老师取钥匙,则老师们会先将钥匙全还回去再取出。
|
|
22
|
+
今天开始的时候钥匙是按编号从小到大的顺序放在钥匙盒里的。
|
|
23
|
+
有K位老师要上课,给出每位老师所需要的钥匙、开始上课的时间和上课的时长,假设下课时间就是还钥匙时间,
|
|
24
|
+
请问最终钥匙盒里面钥匙的顺序是怎样的?
|
|
25
|
+
|
|
26
|
+
列表 lst 的长度 K 即教师人数;lst 中每行三个整数 w, s, c,分别表示一位老师要使用的钥匙编号、开始上课的时间和上课的时长。
|
|
27
|
+
可能有多位老师使用同一把钥匙,但是老师使用钥匙的时间不会重叠。
|
|
28
|
+
|
|
29
|
+
输出格式
|
|
30
|
+
输出一行包含N个整数的列表,依次表示每个挂钩上挂的钥匙编号。
|
|
31
|
+
|
|
32
|
+
示例:
|
|
33
|
+
|
|
34
|
+
输入:N=5
|
|
35
|
+
lst=[[4,3,3],[2,2,7]]
|
|
36
|
+
输出:
|
|
37
|
+
[1,4,3,2,5]
|
|
38
|
+
解释:
|
|
39
|
+
共有5个挂钩,编号从1到5。
|
|
40
|
+
第一位老师从时刻3开始使用4号教室的钥匙,使用3单位时间,所以在时刻6还钥匙。
|
|
41
|
+
第二位老师从时刻2开始使用钥匙,使用7单位时间,所以在时刻9还钥匙。
|
|
42
|
+
每个关键时刻后的钥匙状态如下(X表示空):
|
|
43
|
+
时刻2后为1X345;
|
|
44
|
+
时刻3后为1X3X5;
|
|
45
|
+
时刻6后为143X5;
|
|
46
|
+
时刻9后为14325。
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:计算水域大小
|
|
13
|
+
你有一个用于表示一片土地的整数矩阵land,该矩阵中每个点的值代表对应地点的海拔高度。若值为0则表示水域。
|
|
14
|
+
由垂直、水平或对角连接的水域为池塘。池塘的大小是指相连接的水域的个数。编写一个方法来计算矩阵中所有池塘的大小,
|
|
15
|
+
返回值需要从小到大排序。
|
|
16
|
+
|
|
17
|
+
示例:
|
|
18
|
+
|
|
19
|
+
输入:
|
|
20
|
+
[
|
|
21
|
+
[0,2,1,0],
|
|
22
|
+
[0,1,0,1],
|
|
23
|
+
[1,1,0,1],
|
|
24
|
+
[0,1,0,1]
|
|
25
|
+
]
|
|
26
|
+
输出: [1,2,4]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:零钱兑换
|
|
13
|
+
给你一个整数数组coins,表示不同面额的硬币,以及一个整数amount,表示总金额。
|
|
14
|
+
计算并返回可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,返回-1。
|
|
15
|
+
你可以认为每种硬币的数量是无限的。
|
|
16
|
+
重复的硬币面额按同一种面额处理;amount=0 时返回 0,无解时返回 -1。
|
|
17
|
+
|
|
18
|
+
示例:
|
|
19
|
+
输入:coins = [1, 2, 5], amount = 11
|
|
20
|
+
输出:3
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目
|
|
13
|
+
给你一个未排序的整数数组 nums ,请你找出其中没有出现的最小的正整数。
|
|
14
|
+
|
|
15
|
+
示例 1:
|
|
16
|
+
输入:nums = [1,2,0]
|
|
17
|
+
输出:3
|
|
18
|
+
|
|
19
|
+
示例 2:
|
|
20
|
+
输入:nums = [3,4,-1,1]
|
|
21
|
+
输出:2
|
|
22
|
+
|
|
23
|
+
示例 3:
|
|
24
|
+
输入:nums = [7,8,9,11,12]
|
|
25
|
+
输出:10
|
|
26
|
+
|
|
27
|
+
本题采用标准的 First Missing Positive 定义:返回数组中没有出现的最小正整数。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
请只在 "
|
|
2
|
+
##########start下面可以改动
|
|
3
|
+
|
|
4
|
+
##########end上面可以改动 "
|
|
5
|
+
|
|
6
|
+
中间部分作答,作答行数自由调整
|
|
7
|
+
|
|
8
|
+
请不要使用 input() 函数
|
|
9
|
+
|
|
10
|
+
此题在期中考试考察范围内,作业需提交,注意期中考试有卷面分,请认真作答。
|
|
11
|
+
|
|
12
|
+
题目:使所有字符相等的最小成本
|
|
13
|
+
|
|
14
|
+
给你一个下标从 0 开始、长度为 n 的二进制字符串 s ,你可以对其执行两种操作:
|
|
15
|
+
1.选中一个下标 i 并且反转从下标 0 到下标 i(包括下标 0 和下标 i )的所有字符,成本为 i + 1 。
|
|
16
|
+
2.选中一个下标 i 并且反转从下标 i 到下标 n - 1(包括下标 i 和下标 n - 1 )的所有字符,成本为 n - i 。
|
|
17
|
+
返回使字符串内所有字符 相等 需要的 最小成本 。
|
|
18
|
+
|
|
19
|
+
反转 字符意味着:如果原来的值是 '0' ,则反转后值变为 '1' ,反之亦然。
|
|
20
|
+
|
|
21
|
+
示例 1:
|
|
22
|
+
|
|
23
|
+
输入:s = "0011"
|
|
24
|
+
输出:2
|
|
25
|
+
解释:执行第二种操作,选中下标 i = 2 ,可以得到 s = "0000" ,成本为 2 。可以证明 2 是使所有字符相等的最小成本。
|
|
26
|
+
|
|
27
|
+
示例 2:
|
|
28
|
+
|
|
29
|
+
输入:s = "010101"
|
|
30
|
+
输出:9
|
|
31
|
+
解释:执行第一种操作,选中下标 i = 2 ,可以得到 s = "101101" ,成本为 3 。
|
|
32
|
+
执行第一种操作,选中下标 i = 1 ,可以得到 s = "011101" ,成本为 2 。
|
|
33
|
+
执行第一种操作,选中下标 i = 0 ,可以得到 s = "111101" ,成本为 1 。
|
|
34
|
+
执行第二种操作,选中下标 i = 4 ,可以得到 s = "111110" ,成本为 2 。
|
|
35
|
+
执行第一种操作,选中下标 i = 5 ,可以得到 s = "111111" ,成本为 1 。
|
|
36
|
+
使所有字符相等的总成本等于 9 。可以证明 9 是使所有字符相等的最小成本。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bai-python-hwc
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python 编程练习题库与可运行的参考答案
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Topic :: Education
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# Python 练习题库
|
|
11
|
+
|
|
12
|
+
共收录 149 道带 `hwc` 编号的题。每道题有原题文本和可运行的 Python 参考答案,保留原编号。需要 Python 3.10 或更新版本,无需安装第三方运行依赖。
|
|
13
|
+
|
|
14
|
+
## 安装与查题
|
|
15
|
+
|
|
16
|
+
在含有 wheel 文件的目录里运行以下命令。
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
python -m pip install .\bai_python_hwc-1.0.0-py3-none-any.whl
|
|
20
|
+
python
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
在标准 Python 解释器里输入以下代码。
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from bai_python_hwc import bank
|
|
27
|
+
|
|
28
|
+
print(bank[101].q) # 原题
|
|
29
|
+
print(bank[101].a) # 原题与参考答案
|
|
30
|
+
print(list(bank)) # 已收录的题号
|
|
31
|
+
print(bank[501].pdf) # hwc501 的 PDF 附件位置
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`bank[424].pdf` 和 `bank[501].pdf` 提供原 PDF 附件。Python 源码项目的 `src/bai_python_hwc/questions/` 存放纯题目文本,`src/bai_python_hwc/answers/` 存放带原题和 `TEST_DO_NOT_CHANGE` 函数的可运行脚本。
|
|
35
|
+
|
|
36
|
+
PyPI 发布后可通过 `python -m pip install bai-python-hwc` 安装。
|
|
37
|
+
|
|
38
|
+
## 题库说明
|
|
39
|
+
|
|
40
|
+
- 保留原题的编号和文字。题干或样例存在冲突时,参考答案通过注释明确采用的规则。
|
|
41
|
+
- `hwc501` 的解答包含图形边界、蒙特卡洛采样条件和误差验收标准。
|