摘要: Description You are the manager of a small soccer team. After seeing the shameless behavior of your team during the match, you are mad at all of the c 阅读全文
posted @ 2017-05-15 20:07 蟹脑板 阅读(255) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/794/problem/C Description Oleg the client and Igor the analyst are good friends. However, sometimes they argue over litt 阅读全文
posted @ 2017-05-13 22:07 蟹脑板 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 其实是大一还不会GUI时闲着无聊写的。都是硬编码,也不支持自定义棋盘大小,现在看看这代码惨不忍睹。下载地址:http://download.csdn.net/download/xienaoban/9835259 实现 输入P x y 模拟插下小旗,输入I x y 模拟点下去,输入O x y 模拟探测 阅读全文
posted @ 2017-05-06 18:17 蟹脑板 阅读(1547) 评论(0) 推荐(0) 编辑
摘要: 学校组织的计算机技能大赛,题目解八皇后并做程序演示,顺便就贴博客上来。 八皇后问题 简述:8 8的棋盘,有八个皇后,每个皇后不能在同一行同一列同一斜线上,问有多少种可能的摆法。答案是92,这大家都知道。 解法与优化 首先肯定是遍历嘛,关键是要剪枝。 1.暴力枚举 8个子所有点遍历一遍,8个嵌套for 阅读全文
posted @ 2017-05-06 17:33 蟹脑板 阅读(666) 评论(0) 推荐(0) 编辑
摘要: https://code.google.com/codejam/contest/3274486/dashboard Problem The kitchen at the Infinite House of Pancakes has just received an order for a stack 阅读全文
posted @ 2017-05-01 12:02 蟹脑板 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 长期更新。快速幂lld pow_mod(lld a, lld b, const int &pr){ lld ans = 1; while (b) { if (b & 1) ans = ans * a % pr; b >>= 1; ... 阅读全文
posted @ 2017-04-07 21:23 蟹脑板 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 卷积给定向量:a=(a0,a1,...,an−1),b=(b0,b1,...,bn−1)向量和:a+b=(a0+b0,a1+b1,...,an−1+bn−1) 数量积(内积、点积):a⋅b=a0b0+a1b1+...+an−1bn−1 卷积:a⊗b=(c0,c1,...,c2n−2... 阅读全文
posted @ 2017-04-06 21:35 蟹脑板 阅读(1327) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/786/ADescriptionRick and Morty are playing their own version of Berzerk (which has nothing in common... 阅读全文
posted @ 2017-04-03 22:05 蟹脑板 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Description一个数组,要求先对前n个数字排序(以方便后续操作);又要求对前n+i个数字排序;又要求对前n+j … 前n+k个数字排序(i、j、k的大小远小于n,且i、j、k间没有大小关系)。总之就是对一个不定的范围内数据要进行频繁的按大小顺序调用,但是这个范围边界变化不大... 阅读全文
posted @ 2017-03-27 16:33 蟹脑板 阅读(375) 评论(0) 推荐(0) 编辑
摘要: DescriptionThere are n cities in Berland, each of them has a unique id — an integer from 1 to n, the capital is the one with id 1. Now there ... 阅读全文
posted @ 2017-03-26 20:25 蟹脑板 阅读(184) 评论(0) 推荐(0) 编辑