Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are t...
分类:
其他好文 时间:
2014-10-30 15:15:01
阅读次数:
312
Multiplyand pow Function://计算 (a*b)%c. a,b都是ll的数,直接相乘可能溢出的// a,b,c = c)a %= c; b >>= 1; } return ret;}//计算 x^n %cll pow_mod(ll x,ll n...
分类:
其他好文 时间:
2014-10-30 14:57:08
阅读次数:
195
跟POJ 1465 multiple 类是。只不过多了2个条件,长度不能超过500,还有就是 可能不是十进制。
bfs+同余定理,就是用 mod 来判重。G++ 15ms
每次枚举一位,然后记录下路径然后输出就可以。
此题坑点 当n==0 的时候 如果 m个数中有0 那么答案就是0 如果没有0 就是give me the bomb please
这儿坑了我好几次...
分类:
其他好文 时间:
2014-10-30 13:32:13
阅读次数:
195
题目链接:点击打开链接
题意:
给定一个数,重新排列这个数的各个位置使得
1、无前导0
2、能被11整除
问:
有多少种组合方法
#include
#include
#include
using namespace std;
typedef long long ll;
const int mod = 1000000000 + 7;
const int N = 100+2...
分类:
其他好文 时间:
2014-10-30 13:30:41
阅读次数:
180
使用apache的重写规则来禁用OPTIONS方法。方法如下: 在apache配置文件http.conf中添加以下代码:
LoadModule rewrite_module path/to/apache/modules/mod_rewrite.so
RewriteEngine On
RewriteCo...
分类:
Web程序 时间:
2014-10-30 12:01:26
阅读次数:
2320
一直以为求模和求余是一回事,发现这两者是不同的。以下为网上转载的资料: 通常情况下取模运算(mod)和求余(rem)运算被混为一谈,因为在大多数的编程语言里,都用‘%‘符号表示取模或者求余运算。在这里要提醒大家要...
分类:
其他好文 时间:
2014-10-30 11:59:40
阅读次数:
165
一、背景介绍: 虽然使用Mod_fifo和mod_callcenter可以做呼叫中心的应用,但在实现应用中,这两个模块很难客制化需求,再此我用Lua实现了5路客服(1000-1004),一个呼叫中心号码:9958 的ADC实施方案,谨在此记录。二、流程图: 三、具体设定: 1 . /us...
分类:
其他好文 时间:
2014-10-30 09:26:55
阅读次数:
365
配置虚拟主机1.开启Apache的rewrite模块 LoadModule rewrite_module modules/mod_rewrite.so2.开启虚拟主机功能 # Virtual hosts Include conf/extra/httpd-vhosts.conf3.修改conf/ext...
分类:
Web程序 时间:
2014-10-29 21:07:36
阅读次数:
191
题目很有简单:
Description
Given a n × n matrix A and a positive integer k, find the sum
S = A + A2 + A3 + … +
Ak.
Output
S mod m
范围:n (n ≤ 30), k (k ≤ 109) and
m (m 4).
显然,暴力是不能解决问题,这题目很有意思...
分类:
其他好文 时间:
2014-10-29 19:29:27
阅读次数:
176
要求a^b^c mod p保证gcd(c,p)=1用费马小定理b:=quick_mod(b,c,p-1);c:=quick_mod(a,b,p);a^c mod p=a^(c mod phi(p)) mod p而素数的phi函数是无需计算的,即p-1推广到多个,依次降幂即可。不断应用快速幂。var ...
分类:
其他好文 时间:
2014-10-29 18:50:13
阅读次数:
198