这个专栏开始介绍一些<ACM国际大学生程序设计竞赛题解>上的竞赛题目,读者可以配合zju/poj/uva的在线测评系统提交代码(今天zoj貌似崩了). 其实看书名也能看出来这本书的思路,就是一本题解书,简单暴力的通过题目的堆叠来提升解决编程问题的能力. 那么下面开始探索吧. poj1037: Description Background For years, computer scientists have been trying to find efficient solutions to…
华东师范大学第十届ECNU Coder程序设计竞赛 浮点数模运算 solution 转成整数然后取模. 时间复杂度:\(O(1)\) 数螃蟹 solution 找出公差出现次数最多的作为公差,然后找出最长的符号公差的连续序列,其它数以该序列为基准进行修改. 时间复杂度:\(O(n)\) 面向对象程序设计 solution 做一次\(dfs\),在\(dfs\)的过程中每个函数维护一个栈即可. 时间复杂度:\(O(n)\) 无聊的数学题 solution 答案是\(2^{2^n-n}-(k==0)…
1195: OS Job Scheduling Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 106  Solved: 35 [id=1195" style="color:rgb(26,92,200); text-decoration:none">Submit][Status][Web Board] Description OS(Operating System) is to help user solve the pr…
目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 http://acm.fzu.edu.cn/problem.php?pid=2295 http://acm.fzu.edu.cn/problem.php?pid=2295 Catalog Problem:Portal传送门  原题目描述在最下面.  题意就是很裸的最大权闭合子图.  推荐阅读:胡伯涛<最小割模型在信息学竞赛中的应用>  完完全全的模板题:新疆大学五月月赛-D-勤奋的杨老师…
题意:RT,给你四个数\(a,b,c,d\),求\(x+y+z=k\)的方案数. 题解:我们可以先枚举\(x\)的值,然后\(x+y\)能取到的范围一定是\([x,x+b]\),也就是说这个区间内每个数都有一个贡献,所以我们可以通过枚举\(a\)并且利用差分来求出\(x+y\)的贡献,然后再复原前缀和,同理再枚举\(x+y\),即枚举\(a+b\)并加上\(c\),来求出\(x+y+z\)的贡献,再复原前缀和,最后枚举\(d\)将每个点的方案数加给答案即可. 代码: ll a,b,c,d; ll…
from:piaocoder Common Tangents(两圆之间的公公切线) 题目链接: http://acm.fzu.edu.cn/problem.php?pid=2213 解题思路: 告诉你两个圆的圆心与半径,要你找出他们的公共切线的个数. 套模板即可. http://blog.csdn.net/piaocoder/article/details/41649089 #include <iostream> #include <cstdio> #include <cma…
Pku 1143: Description Christine and Matt are playing an exciting game they just invented: the Number Game. The rules of this game are as follows. The players take turns choosing integers greater than 1. First, Christine chooses a number, then Matt ch…
pku 1107: Description Weird Wally's Wireless Widgets, Inc. manufactures an eclectic assortment of small, wireless, network capable devices, ranging from dog collars, to pencils, to fishing bobbers. All these devices have very small memories. Encrypti…
Poj1068: Description Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2...pn where pi is the number of left parentheses before the ith right parenthesis in S (P-seque…
这篇文章来介绍一些模拟题,即一类按照题目要求将现实的操作转换成程序语言. zoj1003: On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV.   The rule is very simple.  On the ground there are 100 labeled  balloons, with the numbers 1 to 100.  Afte…