分治求等比数列和的模: 1 #include 2 using namespace std; 3 4 typedef long long ll; 5 6 ll pow_mod( ll a, ll b, ll mod ) 7 { 8 ll ans = 1, w = a % mod; 9 ...
分类:
其他好文 时间:
2015-05-01 11:51:24
阅读次数:
116
题意:求最长回文串,模板题 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MOD 100000000710 const int...
分类:
编程语言 时间:
2015-05-01 10:34:19
阅读次数:
124
1.查看当前模式 httpd -lC:\wamp\bin\apache\Apache2.2.17\bin>httpd -lCompiled in modules: core.c mod_win32.c mpm_winnt.c http_core.c mod_so.c2.修改apache/c...
分类:
其他好文 时间:
2015-05-01 07:07:00
阅读次数:
193
题目大意:给定一张地图,求生成树个数
Matrix-Tree定理直接上
不过模数是10910^9,不能直接求逆元
因此消元的时候辗转相除一下就好了#include
#include
#include
#include
#define M 110
#define MOD 1000000000
using name...
分类:
其他好文 时间:
2015-04-30 22:00:18
阅读次数:
168
实验环境:CentOS5.11finalhostname:T1.getg.comIP地址:192.168.50.138软件准备:CentOSLinux5.*系统光盘中的“Developmenttools”工具包组jdk-8u45-linux-x64.tar.gzpcre-8.36.tar.gzapr-util-1.5.4.tar.gzapr-1.5.1.tar.gzhttpd-2.4.12.tar.gzapache-tomcat-7.0.61.tar.gz..
分类:
Web程序 时间:
2015-04-30 20:22:42
阅读次数:
1957
发现自己还是看书少了,能从书上学到不少东西。
加减乘的模运算:
#include
using namespace std;
int mul_mod(int a,int b,int n){
a %= n; b %= b;
return (int)((long long)a * b % n);
}///如果n本身超int,就要用高精度了
int add_mod(int a,int ...
分类:
其他好文 时间:
2015-04-30 08:53:44
阅读次数:
185
题意: f[0]=0,f[i]=f[i-1]+a or b. 求满足L#define LL long longusing namespace std;const int MOD = (int) 1e9 + 7;const int M = 105;LL N, a, b, L, R;LL dp[...
分类:
其他好文 时间:
2015-04-30 00:49:10
阅读次数:
144
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2605A^X mod PTime Limit: 5000ms Memory limit: 65536K有疑问?点这里^_^题目描述It's easy for...
分类:
其他好文 时间:
2015-04-29 23:17:39
阅读次数:
258
题目大意:给定一张图,每条边有’=’和’<’两个属性,每个点入度最多为1,求这张图可以压成多少个用’=’和’<’连接的序列
我只贴代码~~
题解自己搜~~#include
#include
#include
#include
#define M 110
#define MOD 1000000007
using n...
分类:
其他好文 时间:
2015-04-29 21:43:17
阅读次数:
494
网址:https://leetcode.com/problems/reverse-integer/
题意:
反转数字,正负不变.
分析:
思路显而易见,
重点在有些刁钻的输入输出上.
解法:
因为无视正负,又要用到mod.
自然想到abs...
不过abs对于int并不完全适用.
使用前,判断一下是不是INT_MIN或Integer.MIN_VALUE
我又不想记住这个正负,...
分类:
其他好文 时间:
2015-04-29 19:49:22
阅读次数:
129