requests模块
基本发送请求方式
1 | r = requests.get('https://api.github.com/events') |
其中 r 为Response对象。
1 | r = requests.get('https://api.github.com/events') |
其中 r 为Response对象。
刚刚好的退役贴–告别大学两年的acm生涯
大学入校就决定参加这个社团,这个组织,因为听过可以提高自己的编写代码的能力。转眼两年过去了,高高兴兴的苦逼的学了两年,总计参加了两场邀请赛,四场区域赛,拿了三铁三铜,没有银,说到底还是很遗憾的。
感觉还是很搞笑(悲伤)的,第一场ccpc哈尔滨区域赛以罚时爆炸喜获铁牌一枚,最后一场icpc焦作同样因为罚时爆炸喜获铜牌一枚,感觉都是sb题,但是不知道为什么总会去踩那些坑。
The BFS algorithm is defined as follows.
- Consider an undirected graph with vertices numbered from 1 to n. Initialize q as a new queue containing only vertex 1, mark the vertex 1 as used.
- Extract a vertex v from the head of the queue q.
- Print the index of vertex v.
- Iterate in arbitrary order through all such vertices uu that uu is a neighbor of vv and is not marked yet as used. Mark the vertex u as used and insert it into the tail of the queue q.
Niuniu has learned prefix sum and he found an interesting about prefix sum.
Let’s consider (k+1) arrays a[i] (0 <= i <= k)
The index of a[i] starts from 1.
a[i] is always the prefix sum of a[i-1].
“always” means a[i] will change when a[i-1] changes.
“prefix sum” means a[i][1]=a[i−1][1]anda[i][j]=a[i][j−1]+a[i−1][j] (j >= 2)
The coach of a football team, after suffering for years the adverse comments of the media about his tactics, decides to take his revenge by presenting his players in a line-up in such a way that the TV cameras would be compelled to zigzag in a ridiculous bobbing motion, by alternating taller and shorter players. However, the team captain objects that he must be the first of the line by protocolary reasons, and that he wants to be seen in the best possible light:
Alice and Bob are trying to communicate through the internet. Just assume that there are N routers in the internet and they are numbered from 0 to N-1. Alice is directly connected to router 0 and Bob is directly connected to router N-1. Alice initiates the connection and she wants to send S KB of data to Bob.