http://www.lydsy.com/JudgeOnline/problem.php?id=4869 终于A了。。。参考了下dalao的代码。。。 拓展欧几里得定理,改了几次就不变了,但是用的时候要在快速幂里判是不是要用。 #include<bits/stdc++.h> using namesp ...
分类:
其他好文 时间:
2017-05-09 21:47:32
阅读次数:
169
BZOJ1221:http://www.lydsy.com/JudgeOnline/problem.php?id=1221 trick:将每天用完的,和要用的分来开处理,避免花费的重叠计算,也就是拆点 #include<bits/stdc++.h> using namespace std; #pra ...
分类:
其他好文 时间:
2017-05-09 20:48:33
阅读次数:
198
【题目链接】:click here 【题目大意】:计算x1^m+x2^m+..xn^m(1<=x1<=n)( 1 <= n < 1 000 000, 1 <= m < 1000) 【解题思路】:高速幂取模 代码: solution one: #include<bits/stdc++.h> #defi ...
分类:
其他好文 时间:
2017-05-09 18:57:26
阅读次数:
193
# age = 50 # v = age. # print(v) def bit_length(self): # real signature unknown; restored from __doc__ """ int.bit_length() -> int Number of bits nece ...
分类:
其他好文 时间:
2017-05-09 11:19:00
阅读次数:
168
http://www.lydsy.com/JudgeOnline/problem.php?id=2004 矩阵快速幂。。。并没有想出来。。。 理解地不是很好 先挖个坑 #include<bits/stdc++.h> using namespace std; typedef long long ll; ...
分类:
其他好文 时间:
2017-05-09 00:41:29
阅读次数:
170
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long LL; 4 const int N=1e6+10; 5 const int INF=0x3f3f3f3f; 6 int cas=1,T; 7 int c[N]; ...
分类:
其他好文 时间:
2017-05-08 23:12:31
阅读次数:
317
#include<bits/stdc++.h>usingnamespacestd;boolok;charmaze[15][15];charMap[12][12];boolvis[15][15];intx[4]={0,0,1,-1};inty[4]={1,-1,0,0};structST
{intii;intjj;
};
queue<ST>que;voidBFS(intcur_i,intcur_j)
{intdot=0;while(!que.empty())
que.pop();
STn..
分类:
其他好文 时间:
2017-05-08 18:38:18
阅读次数:
126
1 #include <bits/stdc++.h> 2 using namespace std; 3 int p,x,y,a[26]; 4 bool init(int s) 5 { 6 int i=s/50%475; 7 for (int j=0;j<25;j++) 8 { 9 i=(i*96+4 ...
分类:
其他好文 时间:
2017-05-08 16:01:51
阅读次数:
278
1 #include<bits/stdc++.h> 2 3 const int Maxn = 1000005; 4 5 #define ll long long 6 using namespace std; 7 int x[Maxn], pos[33]; 8 int main() { 9 int T ...
分类:
其他好文 时间:
2017-05-08 00:19:10
阅读次数:
180
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1215 题意: 分析: 计算出每一个数字作为最大值,最小值的范围; 然后结果就是乘法原理,因为,左右端点可以任意组合; 1 #include <bits/stdc+ ...
分类:
编程语言 时间:
2017-05-07 00:15:32
阅读次数:
223