01 2021 档案

摘要:题目链接:http://codeforces.com/contest/1478/problem/C 题意: 有一个数组a,由$2n$个不同的整数组成,对于每个$a_i$都有一个$a_j$使得$a_i=-a_j(1<=i,j<=2n)$。有数组d,\(d_i=\sum _{j=1}^{2n}\left 阅读全文
posted @ 2021-01-29 22:00 一个只会爆零的小菜鸡 阅读(138) 评论(0) 推荐(0)
摘要:导入模块 import urllib.request 打开并爬取网页 file=urllib.request.urlopen("http://www.baidu.com") 读取内容 data=file.read() file.read()读取全部内容 file.readlines()读取全部内容, 阅读全文
posted @ 2021-01-23 10:20 一个只会爆零的小菜鸡 阅读(135) 评论(0) 推荐(0)
摘要:获取列表中的一部分元素 1 #List[L:R]得到下标为[L,R)的列表 2 List=[0,1,2,3,4,5] 3 print(List[1:3]) 4 print(List[:3]) 5 print(List[1:]) 6 print(List[:]) 7 #[1, 2] 8 #[0, 1, 阅读全文
posted @ 2021-01-22 15:07 一个只会爆零的小菜鸡 阅读(86) 评论(0) 推荐(0)
摘要:函数 1 def check(x,y): 2 if x<0 or x>n or y>m or y<0: 3 return False 4 else : 5 return True 类似C的 1 int check(int x,int y) 2 { 3 if(x<0 || x>n || y>m || 阅读全文
posted @ 2021-01-18 15:03 一个只会爆零的小菜鸡 阅读(1296) 评论(0) 推荐(0)