![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
洛谷
Oligey Oligey
这个作者很懒,什么都没留下…
展开
-
python实现洛谷P1319 压缩技术
把每一行的0或1用bool值表示List = list(map(int, input().split()))Count = 0k = 1Bool = False #因为矩阵内是0与1,所以我认为用bool类型方便点while k < len(List): for i in range(0, List[k]): #List[k]存放0或1的连续次数 prin...原创 2020-03-26 20:37:42 · 858 阅读 · 0 评论 -
python洛谷P1317 低洼地
N = int(input())groundHighList = list(map(int, input().split()))i = 1j = i + 1count = 0while i < len(groundHighList) - 1:#头尾为0且不可能为低洼地 while j < len(groundHighList) and groundHighList[i...原创 2020-03-25 21:11:30 · 1167 阅读 · 1 评论 -
python实现洛谷入门P1914 小书童——密码
def change(k, char): x = ord(char) + k #运用字符的ascii码计算,'a'为97,'z'为122 while x > ord('z'): #若x在 ord('a') 到 ord('z') 这个区间内,则符合题意,否则要继续计算 x = x - ord('z') + or...原创 2020-03-22 11:59:31 · 419 阅读 · 0 评论