Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hanyuyu patch 1 #75

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3d7b877
Update CNAME
Hanyuyu Feb 11, 2019
cfd1902
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 11, 2019
8bec3ae
Update _config.yml
Hanyuyu Feb 11, 2019
e51f5e5
Update _config.yml
Hanyuyu Feb 11, 2019
202b392
Update _config.yml
Hanyuyu Feb 11, 2019
8be19b5
Update index.html
Hanyuyu Feb 11, 2019
65fa26d
Update about.md
Hanyuyu Feb 11, 2019
55e4be7
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 11, 2019
0e19dcc
Update _config.yml
Hanyuyu Feb 11, 2019
c869a45
Update _config.yml
Hanyuyu Feb 11, 2019
2336293
Update _config.yml
Hanyuyu Feb 11, 2019
9c6b138
Update about.md
Hanyuyu Feb 11, 2019
e27b962
Update about.md
Hanyuyu Feb 11, 2019
cae9049
Update about.md
Hanyuyu Feb 11, 2019
a749086
Update about.md
Hanyuyu Feb 11, 2019
9a6a4f3
Update about.md
Hanyuyu Feb 11, 2019
dc14f04
Update about.md
Hanyuyu Feb 11, 2019
9cf97cc
Update about.md
Hanyuyu Feb 11, 2019
86ce2bf
Update about.md
Hanyuyu Feb 11, 2019
5384c3c
Update about.md
Hanyuyu Feb 11, 2019
b08f52f
Update about.md
Hanyuyu Feb 11, 2019
349bca8
Update favicon.png
Hanyuyu Feb 11, 2019
bf54ba7
Update favicon.ico
Hanyuyu Feb 11, 2019
ac31745
Update _config.yml
Hanyuyu Feb 12, 2019
fd40168
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 12, 2019
7dba229
Create 第二篇.md
Hanyuyu Feb 12, 2019
99536cd
Update about.md
Hanyuyu Feb 12, 2019
6009a9d
Update about.md
Hanyuyu Feb 12, 2019
a6f7eb8
Update _config.yml
Hanyuyu Feb 12, 2019
03a4b4b
Update _config.yml
Hanyuyu Feb 12, 2019
bdef4d0
Update about.md
Hanyuyu Feb 12, 2019
c0c9e11
Update about.md
Hanyuyu Feb 14, 2019
a5f01f2
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 14, 2019
2f9cd85
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 14, 2019
ed5f5f2
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 14, 2019
b976a20
Update about.md
Hanyuyu Feb 15, 2019
799acba
Update about.md
Hanyuyu Feb 15, 2019
f2a5835
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 15, 2019
b55fee8
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 15, 2019
f662930
Update 2015-03-02-how-to-write.md
Hanyuyu Feb 15, 2019
bd82f0b
Update _config.yml
Hanyuyu Feb 25, 2019
2926c20
Update footer.html
Hanyuyu Feb 25, 2019
9ff9ed1
Update _config.yml
Hanyuyu Feb 25, 2019
01bcb66
Update footer.html
Hanyuyu Feb 25, 2019
6d59843
Update _config.yml
Hanyuyu Feb 25, 2019
82411e8
Delete 第二篇.md
Hanyuyu Feb 26, 2019
cb0572d
Create python ccf题解 201809-1 卖菜.md
Hanyuyu Feb 26, 2019
1c29552
Create python ccf题解 201803-1 跳一跳.md
Hanyuyu Feb 26, 2019
d37671b
Delete 2015-03-02-how-to-write.md
Hanyuyu Feb 26, 2019
de3c087
Update python ccf题解 201803-1 跳一跳.md
Hanyuyu Feb 26, 2019
05c00af
Update python ccf题解 201809-1 卖菜.md
Hanyuyu Feb 26, 2019
0de2d02
Update python ccf题解 201803-1 跳一跳.md
Hanyuyu Feb 26, 2019
04ed7b4
Delete python ccf题解 201803-1 跳一跳.md
Hanyuyu Feb 26, 2019
73a9d98
Create 2015-03-02-how-to-write.md
Hanyuyu Feb 26, 2019
9c17b80
Create 1.md
Hanyuyu Feb 28, 2019
21d76cd
Create 2.md
Hanyuyu Feb 28, 2019
3c10f6f
Create 3.md
Hanyuyu Feb 28, 2019
290cecb
Delete 1.md
Hanyuyu Mar 10, 2019
c934d43
Delete 2.md
Hanyuyu Mar 10, 2019
f928cf3
Delete 3.md
Hanyuyu Mar 10, 2019
c39be4e
Create 2019.md
Hanyuyu Mar 10, 2019
eb0180b
Update python ccf题解 201809-1 卖菜.md
Hanyuyu Mar 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cnfeat.com
stevenhy.com
25 changes: 13 additions & 12 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Site settings
title: 博客名字 # 你的博客名字,可以定义修订
title: Stevenhy's pocket # 你的博客名字,可以定义修订
header-img: "img/green.jpg"
tagline: "cn"
description: "这是我的博客" # 一句话描述你的博客
tagline: "目明心亮,立心力行"
description: "目明心亮,立心力行" # 一句话描述你的博客
baseurl: ""
url: "http://cnfeat" # 此处填写你的博客地址
url: "http://www.stevenhy.com" # 此处填写你的博客地址

# About/contact
owner:
name: "作者名字" # 填写作者信息:名字
email: X@gmail.com # 填写作者信息:邮箱
bio: "你的博客描述" # 填写作者信息:博客描述
name: "韩宇" # 填写作者信息:名字
email: steven_hanyu@163.com # 填写作者信息:邮箱
bio: "目明心亮,立心力行" # 填写作者信息:博客描述

# Data
gavatar: img/favicon.png # 浏览器地址栏小图标,可自定义更改
favicon: img/favicon.png # 浏览器地址栏小图标,可自定义更改

douban_username: # 你的豆瓣id
twitter_username:
github_username:
github_username: hanyuyu
facebook_username:
weibo_username:
zhihu_username:
zhihu_username: #han-yu-70-54-23

# Build settings
# use Github Flavored Markdown !important
Expand All @@ -43,16 +43,16 @@ defaults:
type: "posts"
values:
layout: "post"
author: "你的名字" # 你的名字
author: "韩宇" # 你的名字
header-img: "img/green.jpg" # We don't want posts without a header image, that whould mean white on white

# Comments
comments :
provider : disqus # 使用 disqus 评论模块,读者翻墙才能看见
duoshuo :
short_name : # 填写你的 disqus id
short_name :steven # 填写你的 disqus id
disqus :
short_name : # 填写你的 disqus id
short_name :steven # 填写你的 disqus id

# Analytics and webmaster tools stuff goes here
google_analytics: # 填写你 google_analytics id
Expand All @@ -61,3 +61,4 @@ google_verify:
bing_verify:

# Links to include in footer navigation

91 changes: 69 additions & 22 deletions _posts/2015-03-02-how-to-write.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
---
layout: post
title: 这是一篇博客文章模板
date: 2015-3-02
categories: blog
tags: [标签一,标签二]
description: 文章金句。
---

这里是博客正文。












---
layout: post
title: python ccf题解 201803-1 跳一跳
date: 2019-2-22
categories: blog
tags: [ccf csp,python]
description: python参加ccf csp考试
---

201803-1跳一跳
====
问题描述
----


试题编号 | 201703-1
试题名称 | 跳一跳
时间限制 | 1.0s
内存限制 | 256m
问题描述 |近来,跳一跳这款小游戏风靡全国,受到不少玩家的喜爱。
  简化后的跳一跳规则如下:玩家每次从当前方块跳到下一个方块,如果没有跳到下一个方块上则游戏结束。
  如果跳到了方块上,但没有跳到方块的中心则获得1分;跳到方块中心时,若上一次的得分为1分或这是本局游戏的第一次跳跃则此次得分为2分,否则此次得分比上一次得分多两分(即连续跳到方块中心时,总得分将+2,+4,+6,+8...)。
  现在给出一个人跳一跳的全过程,请你求出他本局游戏的得分(按照题目描述的规则)。

输入格式

  输入包含多个数字,用空格分隔,每个数字都是1,2,0之一,1表示此次跳跃跳到了方块上但是没有跳到中心,2表示此次跳跃跳到了方块上并且跳到了方块中心,0表示此次跳跃没有跳到方块上(此时游戏结束)。

输出格式

  输出一个整数,为本局游戏的得分(在本题的规则下)。

样例输入

1 1 2 2 2 1 1 2 2 0

样例输出

22

数据规模和约定

  对于所有评测用例,输入的数字不超过30个,保证0正好出现一次且为最后一个数字。
-------------------

代码片段
====

```python
#跳一跳
score = 0
last = 1
alist = list(map(int,input().split()))
for a in alist:
if a == 0: # 若a为0则跳出循环
break
elif a == 1:
last = 1
score += a
else: # 跳到中心
if last == 1:
last = 2
else:
last = last + 2
score += last
print(score)
```
last的设置是解决本题的核心,作用类似于flag,可以起到遇1重置,遇2累加的作用
----
10 changes: 10 additions & 0 deletions _posts/2019.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: python ccf题解 201809-1 卖菜
date: 2019-2-13
categories: blog
tags: [ccf csp,python]
description: python参加ccf csp考试
---

在我们日常的生活中,其实很少接触到以下问题
68 changes: 68 additions & 0 deletions _posts/python ccf题解 201809-1 卖菜.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: post
title: python ccf题解 201809-1 哈哈
date: 2019-2-13
categories: blog
tags: [ccf csp,python]
description: python参加ccf csp考试
---

python ccf题解 201809-1 卖菜
问题描述

  在一条街上有n个卖菜的商店,按1至n的顺序排成一排,这些商店都卖一种蔬菜。<br>
  第一天,每个商店都自己定了一个价格。店主们希望自己的菜价和其他商店的一致,第二天,每 一家商店都会根据他自己和相邻商店的价格调整自己的价格。具体的,每家商店都会将第二天的 菜价设置为自己和相邻商店第一天菜价的平均值(用去尾法取整)。<br>
  注意,编号为1的商店只有一个相邻的商店2,编号为n的商店只有一个相邻的商店n-1,其他编号为i的商店有两个相邻的商店i-1和i+1。<br>
  给定第一天各个商店的菜价,请计算第二天每个商店的菜价。<br>

***输入格式***
  输入的第一行包含一个整数n,表示商店的数量。
  第二行包含n个整数,依次表示每个商店第一天的菜价。

***输出格式***

  输出一行,包含n个正整数,依次表示每个商店第二天的菜价。

样例输入

8
4 1 3 1 6 5 17 9

样例输出

2 2 1 3 4 9 10 13

数据规模和约定

对于所有评测用例,2 ≤ n ≤ 1000,第一天每个商店的菜价为不超过10000的正整数。

```python
# 卖菜
# 输入
n = int(input())
a = list(map(int, input().split()))
b = []
# 计算第二天菜价
for i in range(n):
if(i == 0):
b.append((a[0] + a[1]) // 2)
elif(i == n - 1):
b.append((a[-2] + a[-1]) // 2)
else:
b.append((a[i - 1] + a[i] + a[i + 1]) // 3)
# 输出
print(" ".join(map(str, b)))
```













19 changes: 17 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
---
layout: page
title: "About"
description: "你的博客描述 "
description: "目明心亮,立心力行 "
header-img: "img/green.jpg"
---

这一页填写你的自我介绍。
**你好!**
**欢迎!**
我是韩宇Steven,一位在读大学生,一名产品爱好者。<br>
stevenhy's pocket 是我所创建的个人博客,今后会以写作的方式记录成长<br>
我会在这里分享我的日常思考以及一些代码学习片段。<br>
欢迎关注!<br>
邮箱:<[email protected]><br><br>
> 生来平庸,也生来骄傲











Expand Down
Binary file modified img/favicon.ico
Binary file not shown.
Binary file modified img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
description: "博客页面"
description: "目明心亮,立心力行"
---

{% for post in paginator.posts %}
Expand Down