上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
  2020年6月5日
摘要: #include <iostream> #include <string> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define SWAP(a,b) auto c=a;a=b;b=c; int main() 阅读全文
posted @ 2020-06-05 12:37 Ricochet! 阅读(176) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define SWAP(a,b) auto c=a;a=b;b=c; int main() 阅读全文
posted @ 2020-06-05 12:12 Ricochet! 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { int n = 0, m; while(cin >> n){ m = n + 1; n % 2 == 0? n /= 2: m /= 2; cout << m * n << endl << e 阅读全文
posted @ 2020-06-05 11:39 Ricochet! 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 3 int main(){ 4 int a, b; 5 while(scanf("%d%d",&a,&b)!=EOF) 6 printf("%d\n",a+b); 7 return 0; 8 } 注意要求,其实是有多个输入的,需要以此输出结果。 阅读全文
posted @ 2020-06-05 11:34 Ricochet! 阅读(185) 评论(0) 推荐(0) 编辑
  2020年4月2日
摘要: Apr 1st This is the first day of April 2020. As what I decided before, in following 3 days, I will try my best to collect all information for Postgrad 阅读全文
posted @ 2020-04-02 02:19 Ricochet! 阅读(116) 评论(0) 推荐(0) 编辑
  2019年2月26日
摘要: 先挖坑,补上几个大佬的代码 第一个代码,用的是双指针法,思想靠近于2Sum。 首先,对数组进行排序。 然后,对于以下三种情况,可以直接判断无解: 长度为0(其实可以说长度小于3) 最小数字大于0,即数组全大于0 最大数字小于0,即数组全小于0 接着我们对数组进行遍历。当我们选定了当前点,例如,num 阅读全文
posted @ 2019-02-26 22:27 Ricochet! 阅读(150) 评论(0) 推荐(0) 编辑
  2018年11月22日
摘要: 1.一个满二叉树的定义是,所有的节点要么有两个子节点,要么没有子节点。定义Bn为:n个节点的满二叉树,对应的二叉树数量。对称的两个树分别计算。求证:Bn∈Ω(2n) 比如,B1=1,B3=1,B5=2。 这题的关键在于求出Bn的递推式。多画几次就能发现,实际上对于一颗Bn树,包含的情况有一边子树为B 阅读全文
posted @ 2018-11-22 03:16 Ricochet! 阅读(542) 评论(0) 推荐(1) 编辑
摘要: 首先,安装git。安装方法自行搜索。 然后,打开一个目录,用git init将这里初始化为git仓库: 在这个文件夹里添加文件,git就会感知到。如果你准备在git中(而不是文件系统中)暂存这些修改,就用git add 要提交这些暂存的修改,就用git commit -m "message",-m代 阅读全文
posted @ 2018-11-22 01:22 Ricochet! 阅读(199) 评论(0) 推荐(0) 编辑
  2018年11月5日
摘要: 要用BeautifulSoup,需要先下载pip。这个应该不难。然后 然后import之。因为要打开网页所以还要用到urllib.request。 接下来,设置url,并提取网页源代码。 在src里面保存的就是网页源代码了。不建议直接打印出来,不然idle会卡死。 然后,可以开始动用美汤了。 现在S 阅读全文
posted @ 2018-11-05 20:51 Ricochet! 阅读(334) 评论(0) 推荐(0) 编辑
  2018年9月5日
摘要: d={} def T(level, ball): if d.get((level, ball)): return d[(level, ball)] if ball is 1: return level elif level is 1: return 1 elif level is 0: return ... 阅读全文
posted @ 2018-09-05 23:11 Ricochet! 阅读(292) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页