04 2017 档案
摘要:Vance and Shackler like playing games. One day, they are playing a game called "arcane numbers". The game is pretty simple, Vance writes down a finite
阅读全文
摘要:解题关键:最大面积即4个点都在其外接圆上时的面积。 $p = (a + b + c + d)/2$ $s = \sqrt {(p - a)(p - b)(p - c)(p - d)}$ 设四边形的四个点分别为A,B,C,D,四条边为a,b,c,d $s = \frac{1}{2}ab\sin \al
阅读全文
摘要:D. Mike and distribution time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Mike and dis
阅读全文
摘要:C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Mike and gcd
阅读全文
摘要:Problem F Dogs of Qwordance Senior Backend R&D Engineers 问题描述 那年夏天,锘爷和杰师傅漫步在知春公园的小道上。他们的妻子、孩子牵 着狗在前面嬉戏,二人笑语盈盈,他们不深究一个小的编程问题,而是对整个 Qwordance (四字舞蹈)公司的发
阅读全文
摘要:time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output time limit per test 2 seconds time limit
阅读全文
摘要:http://acm.xidian.edu.cn/problem.php?id=1187 问题重述:给一个无向图,求其中包含 3 个结点的环的个数。 题解 暴力玄学,枚举边然后双指针扫描两个端点的邻集。注意用结点的顺序 关系去重,最后除以 3 会超时的。时间复杂度应该是 O(nm),不知道怎么过的。
阅读全文
摘要:http://acm.xidian.edu.cn/problem.php?id=1046
阅读全文
摘要:原理: $\left( {\begin{array}{*{20}{c}}{{F_{n + 2}}}\\{{F_{n + 1}}}\end{array}} \right) = \left( {\begin{array}{*{20}{c}}1&1\\1&0\end{array}} \right)\lef
阅读全文
摘要:呜啦啦啦啦啦啦~~!!SNNU首届女装T走秀大赛开始了! 本次比赛共有N名队员希望参加比赛;ddjing希望这次比赛尽可能的吸睛,因此他决定对N名队员进行一次海选; 多亏ddjing有一双发现美的眼睛,他发现,每个人都有一个乃至多个的个性,ddjing把这些个性编号为1~M(1<=M<=10);此外
阅读全文
摘要:L3-002. 堆栈 大家都知道“堆栈”是一种“先进后出”的线性结构,基本操作有“入栈”(将新元素插入栈顶)和“出栈”(将栈顶元素的值返回并从堆栈中将其删除)。现请你实现一种特殊的堆栈,它多了一种操作叫“查中值”,即返回堆栈中所有元素的中值。对于N个元素,若N是偶数,则中值定义为第N/2个最小元;若
阅读全文
摘要:http://acm.xidian.edu.cn/problem.php?cid=1028&pid=5 题目描述 给N个字符串,请将他们以相同的组成元素(即组成的元素种类相同,每种元素的个数也一样)来分类,分类后按照原本出现的顺序输出! 给N个字符串,请将他们以相同的组成元素(即组成的元素种类相同,
阅读全文
摘要:bsgs算法 主要用来解决${A^x} = B(\bmod C)$(c是质数),都是整数,已知A、B、C求x。 例:poj 2417 Discrete Logging 具体步骤如下: 先把$x = i*m - j$,其中$m = ceil(\sqrt C )$,(ceil是向上取整)。 这样原式就变
阅读全文
摘要:一笔画问题 时间限制:3000 ms | 内存限制:65535 KB 难度:4 一笔画问题 时间限制:3000 ms | 内存限制:65535 KB 难度:4 zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。 规定,所有的边都只能画一次,
阅读全文
摘要:硬币游戏2 挑战程序设计竞赛P315 1堆的情况: n堆的情况:
阅读全文