fzu 1675 The Seventy-seven Problem】的更多相关文章

给你长度为 10^5~10^6长度,由数字组成的串 其中有4位不见了 补全该串 使得在该串能整除 77的同时 尽可能大// 先计算出每个 n*10^m 模 77 的循环节 n=0,1,2..,9// 然求出串的每位 mod 77 累加 抹黑的4为另外处理 #include <iostream> #include <algorithm> #include <queue> #include <vector> #include <math.h> #in…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2224 同hdu5869 //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #inc…
博弈,$SG$函数,规律,线段树. 这个问题套路很明显,先找求出$SG$函数值是多少,然后异或起来,如果是$0$就后手赢,否则先手赢.修改操作和区间查询的话可以用线段树维护一下区间异或和. 数据那么大,一看就知道$SG$有规律...... 先写个小数据的$SG$找规律: ]; ]; int SG(int x) { memset(f,,sizeof f); ;i>=x/;i--) { if(x-i>i) break; f[sg[i]]=; } ;i<=;i++) { ) continue;…
Chinese Postman Problem is a very famous hard problem in graph theory. The problem is to find a shortest closed path or circuit that visits every edge of a (connected) undirected graph. When the graph has an Eulerian Circuit (a closed walk that cover…
公式. $a×C_{m + i - 1}^m + d×C_{m + i - 1}^{m + 1}$. 推导过程可以看http://blog.csdn.net/queuelovestack/article/details/52260127 #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #…
题目列表:     ID Origin Title 10 / 15 Problem A FZU 2152 文件系统   0 / 16 Problem B FZU 2153 A simple geometric problems 9 / 17 Problem C FZU 2154 YesOrNo   4 / 18 Problem D FZU 2155 盟国 10 / 20 Problem E FZU 2156 Climb Stairs   5 / 11 Problem F FZU 2157 Pro…
http://acm.fzu.edu.cn/problem.php?pid=2214   Problem Description Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is less than or equal to a given limit B a…
题目:http://acm.fzu.edu.cn/problem.php?pid=2148 题意:给出n个点,判断可以组成多少个凸四边形. 思路: 因为n很小,所以直接暴力,判断是否为凸四边形的方法是: 如果4个点中存在某个点D,Sabd + Sacd + Sbcd = Sabc,则说明是凹四边形. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #inc…
题目:http://acm.fzu.edu.cn/problem.php?pid=2140 题意: 题目大意:给出n,要求找出n个点,满足: 1)任意两点间的距离不超过1: 2)每个点与(0,0)点的距离不超过1: 3)有n对点之间的距离刚好为1: 4)n个点组成的多边形面积大于0.5: 5)n个点组成的多边形面积小于0.75: 思路:只要有4个点以上就是,构造时先找出四个点,再在半径为1的圆上找点就行. 很巧妙的一道题目呀.... #include <iostream> #include &…
http://acm.fzu.edu.cn/problem.php?pid=2037 思路:找规律,找出递推公式f[n]=f[n-1]*n+(n-1)!,另一个的结果也是一个递推,s[n]=s[n-1]+1/n; #include <cstdio> #include <cstring> #include <algorithm> #define maxn 1000010 #define ll long long using namespace std; ; ll f[ma…