自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

陈见夏的学习小站

<!-- 早睡早起身体好-->

  • 博客(26)
  • 资源 (1)
  • 收藏
  • 关注

原创 《深入理解计算机系统》 读书笔记

第一部分 计算机系统漫游1.信息就是位+上下文 源程序实际上就是一个由值 0和 1组成的位(又称为比特)序列,8 个位被组织成一组,称为字节。每个字节表示程序中的某些文本字符。 hello.c的表示方法说明一个基本思想:系统中所有的信息——包括磁盘文件,存储墙中的程序、数据以及网络数据,都是由一串位表示的。而区别不同数据对象的唯一

2018-01-06 13:02:54 406

原创 codeforces 651A python

若两个操纵杆的·电量都为1的话,那么持续时间为0因此需要特别判断:一个操纵杆电量必须大于1,另一个>=1joystick = map(int,raw_input().split())result = 0while True: if (joystick[0] >= 1 and joystick[1] > 1) or (joystick[0]>1 and joy

2017-11-12 11:05:13 239

原创 codeforces 471A

拼动物,大象、小熊还是外星人需要先判断是否有四个一样的脚(相同数字的个数>=4)若有,再判断剩余两个数的大小def get_different(li): d = {} for i in range(6): if li[i] not in d: d[li[i]] = 1 else: d

2017-11-10 12:44:49 263

原创 codeforces 560A【python】

只要判断list里面有没有1即可n = int(raw_input())line = map(int,raw_input().split())if 1 in line: print -1else: print 1

2017-11-05 18:55:52 214

原创 codeforces 151A【python】

题目不难直接贴代码n, k, l, c, d, p, nl, np = map(int,raw_input().split())line = []every1 = k*l / nlevery2 = c*devery3 = p/npline.append(every1)line.append(every2)line.append(every3)line = sorted(l

2017-11-05 18:54:36 283

原创 codeforces706B 【python】

第一版写法(如下)TLE了,所以得用二分啊def get_result(wine_price,today_money): for i in range(len(wine_price)): if wine_price[i] > today_money: return i return len(wine_price)

2017-10-28 16:29:45 229

原创 自己写的小网站

啦啦啦 虽然很简单,但是自己写完还是很开心~~~ css project My Simple Blog

2017-10-28 14:54:22 268

原创 codeforces551A 【python】

用dictionaryn = int(raw_input())d = {}old_line = map(int,raw_input().split())decrease_line = sorted(old_line)decrease_line = decrease_line[::-1]new_line = old_linefor i in range(n):

2017-10-26 12:36:19 154

原创 codeforces 731A【python】

需要考虑顺时针与逆时针转换的数字大小,并要在输入的string前加上"a"line = raw_input()line = "a" + linereal_distance = 0total_distance = 0for i in range(1,len(line)): distance1 = abs(ord(line[i]) - ord(line[i-1]))

2017-10-25 22:33:15 354

原创 codeforces 719A 【python】

因为list里的数字都是连续的,所以题目并不难,但要特殊判断结尾的15和0n = int(raw_input())themoon = map(int,raw_input().split())if len(themoon) == 1: if themoon[0] == 15: print "DOWN" elif themoon[0] == 0:

2017-10-18 22:48:38 165

原创 codeforces 570A【python】

思路:先找出每个城市里票数最多的人的下标(小函数),在输入时可得到每一行的最大数下标,并将其放入一个新的list之中(every-line-max)。接着就需要用到dictionary了,判断每个下标出现的次数(key),接着再循环次数(key),找出所对应的value等于max-num的最靠前的key。(记得输出时要+1)http://codeforces.com/contest/570/p

2017-10-17 20:00:41 359

原创 《HTML & CSS Design and Build Websites Jon DuCkeTT》读书笔记

小伙伴安利的书,待啃========================

2017-10-17 19:57:30 540

原创 codeforces 349A

题目并不难,不过要整理好思路 (依次判断25的个数、50的个数),依然需要一个true 和false的判断变量。n = int(raw_input())money = map(int,raw_input().split())price_25 = 0price_50 = 0price_100 = 0result = Truefor item in money: if i

2017-10-17 19:51:48 276

原创 leetcode 20. Valid Parentheses

在学习数据结构中看到栈,因此回想起之前做leetcode时遇到的一题:Given a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct o

2017-10-13 17:18:21 161

原创 codeforces 742A

求1378的n次方的最后一个数字可以发现规律为:8 4 2 6 但需注意:n == 1时,需特判n = int(raw_input())if n == 0: print 1else: if n%4 == 1: print 8 elif n%4 == 2: print 4 elif n%4 == 3: p

2017-10-13 17:14:12 225

原创 《大话数据结构 》阅读笔记 1-4章

第一张 数据结构1.数据的逻辑结构、存储结构和操作关系 2.数据其实就是符号,可以输入到计算机里,也可以被计算机程序处理(而声音、图像和视频可以通过编码的手段变成字符数据)3.数据结构:相互之间存在一种或多种关系的数据元素的集合4.数据结构——逻辑结构和物理结构逻辑结构(1)集合结构:所有元素平等地属于一个集合 (2)线性结构:一对一 (3)树形结构:一对多 (4)图形结构:多对多物理结构(

2017-10-11 10:16:33 309

原创 codeforces701A

题目:n个人玩牌,需要每个人手中的牌数之和相等并为最大值思路:每人手中的最大牌数之和为target-sum(总牌数和/n*2)          小函数内循环找到一个数下标构成target-sum,并添加至pair的配对list里         注意:为了避免重复使用,所以已配对的数不可再用(用False和True作为标记)def get_pair(cards, star

2017-10-10 16:42:43 202

原创 《图解http》读书笔记

写在开始之前======= 本书共有十一个章节,打算每天看一章嘿!======第一章 了解web及网络基础1.根据 Web 浏览器地址栏中指定 的 URL,Web 浏览器从 Web 服务器端获取文件资源(resource)等信 息,从而显示出 Web 页面。 像这种通过发送请求获取服务器资源的 Web 浏览器等,都可称为 客户端( client)。Web 使用一种名为 HTTP(HyperTex

2017-10-09 11:58:40 189

原创 codeforces749A(python)

n = int(raw_input())result =[] times = n/2if n%2 == 0: for i in range(times): result.append(2) else: for i in range(times-1): result.append(2) result.append(3) p

2017-10-06 23:03:20 223

原创 【python】coedeforces 785A

题目并不难,但第一种写法所占内存过大,所以想了第二种写法第一种写法 内存13920kbn = int(raw_input())importance = []for i in range(n): importance.append(raw_input())result = 0for item in importance: if item == "Tetrahedr

2017-10-06 22:59:52 259

原创 【python】二进制转换

def convert_binary(num): result = [] if num <= 1: result.append(num) else: while True: consult = num / 2 reminder = num % 2 result.appen

2017-10-06 13:39:58 764

原创 codeforces 467B

思路: 需要将小伙伴的army数xi 先转换为二进制数convert——binary(list)(小函数)           若转换为二进制后的数字个数(list的长度)           并与fedor的二进制(list)相比较,如果不一样的个数          在主代码里计算返回True的次数(朋友的个数)def convert_binary(num): resu

2017-10-06 13:26:36 311

原创 codeforces 716A

在原list中,若下标i的数与下标i-1的差值c,则新list更新为line[I]n,c = map(int,raw_input().split())line = map(int,raw_input().split())current_list = [line[0]]for i in range(1,n): if line[i] - line[i-1] <= c:

2017-10-03 22:35:40 203

原创 codeforces 456A

需要找到性价比最高的电脑(它的价格比某台电脑低,但质量更好),因此我首先写了双重循环(小函数调用),结果显示Time limit exceeded on test 6def lalala(price,quality,start_index,n): for i in range(start_index,n): if price[start_index] qu

2017-10-01 15:54:18 292

原创 codeforces 514A

将原来的数转变为更小的数,转变方法为9-t(若9-t比t小),需注意的是,转换后的首位数字不可为0.x = int(raw_input())line = map(int,str(x))if line[0] < 9 and (9-line[0] <line[0]): line[0] = 9-line[0]for i in range(1,len(line)): if

2017-09-30 12:51:56 197

原创 codeforces439A

在演唱会中尽量穿插更多的笑话,演唱会的总时长为d,每两首歌的休息10分钟可以讲2个故事,再减去总歌长,除以5,则为除休息时间之外的笑话次数。

2017-09-29 17:17:45 203

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除