摘要:
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 阅读全文
摘要:
http://codeforces.com/contest/794/problem/C Description Oleg the client and Igor the analyst are good friends. However, sometimes they argue over litt 阅读全文
摘要:
其实是大一还不会GUI时闲着无聊写的。都是硬编码,也不支持自定义棋盘大小,现在看看这代码惨不忍睹。下载地址:http://download.csdn.net/download/xienaoban/9835259 实现 输入P x y 模拟插下小旗,输入I x y 模拟点下去,输入O x y 模拟探测 阅读全文
摘要:
学校组织的计算机技能大赛,题目解八皇后并做程序演示,顺便就贴博客上来。 八皇后问题 简述:8 8的棋盘,有八个皇后,每个皇后不能在同一行同一列同一斜线上,问有多少种可能的摆法。答案是92,这大家都知道。 解法与优化 首先肯定是遍历嘛,关键是要剪枝。 1.暴力枚举 8个子所有点遍历一遍,8个嵌套for 阅读全文
摘要:
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 阅读全文
摘要:
长期更新。快速幂lld pow_mod(lld a, lld b, const int &pr){ lld ans = 1; while (b) { if (b & 1) ans = ans * a % pr; b >>= 1; ... 阅读全文
摘要:
卷积给定向量: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... 阅读全文
摘要:
http://codeforces.com/problemset/problem/786/ADescriptionRick and Morty are playing their own version of Berzerk (which has nothing in common... 阅读全文
摘要:
Description一个数组,要求先对前n个数字排序(以方便后续操作);又要求对前n+i个数字排序;又要求对前n+j … 前n+k个数字排序(i、j、k的大小远小于n,且i、j、k间没有大小关系)。总之就是对一个不定的范围内数据要进行频繁的按大小顺序调用,但是这个范围边界变化不大... 阅读全文
摘要:
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 ... 阅读全文