int add(long long &x,long long y) { x+=y; x%=MOD; } Matrix mutil(Matrix x,Matrix y) { Matrix z; memset(z.a,0,sizeof(z.a)); for(int i=0;i<X;i++) { for(... ...
分类:
其他好文 时间:
2017-03-22 21:26:15
阅读次数:
162
人见人爱A-B Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 79892 Accepted Submission(s): 22268 Prob ...
分类:
其他好文 时间:
2017-03-22 19:06:04
阅读次数:
200
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1314 题意: 给n个点,及m根pipe,每根pipe用来流躺液体的,单向的,每时每刻每根pipe流进来的物质要等于流出去的物质,要使得m条pipe组成一个循环体,里面流 ...
分类:
其他好文 时间:
2017-03-21 11:09:25
阅读次数:
182
总共4个编程题,分别是10,20,30,40分。 水题AC代码: 第二题: 第三题: 并查集,秒A 第四题: 规约成构造回文串的题,A了81% ...
分类:
其他好文 时间:
2017-03-21 11:01:32
阅读次数:
241
void *memset(void *s, int ch, size_t n); 函数解释:将s中当前位置后面的n个字节 (typedef unsigned int size_t )用 ch 替换并返回 s 。 memset:作用是在一段内存块中填充某个给定的值,它是对较大的结构体或数组进行清零操作 ...
分类:
其他好文 时间:
2017-03-20 19:08:34
阅读次数:
145
矩形面积并 线段树-扫描线裸题 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<math.h> 5 using namespace std; 6 const int maxm=2e3+5; 7 con ...
分类:
其他好文 时间:
2017-03-19 11:05:48
阅读次数:
249
In mathematics, Fibonacci numbers or Fibonacci series or Fibonacci sequence are the numbers of the following integer sequence: 1, 1, 2, 3, 5, 8, 13, 2 ...
分类:
其他好文 时间:
2017-03-19 02:41:52
阅读次数:
900
1 #include 2 #include 3 4 #define MAX_N 10000000 5 6 using namespace std; 7 8 bool flag[MAX_N]; 9 int prime[MAX_N]; 10 11 void solve() 12 { 13 memset(... ...
分类:
其他好文 时间:
2017-03-18 23:43:50
阅读次数:
254
思路: 多重背包变形。 楼天城男人八题的第六题。 http://www.cnblogs.com/dramstadt/p/3439725.html 实现: ...
分类:
其他好文 时间:
2017-03-18 23:38:44
阅读次数:
270
很简洁的题目。求出x^2%n=1的所有x<=n的值。 n<=2e9. 直接枚举x一定是超时的。 看看能不能化成有性质的式子。 有 (x+1)(x-1)%n==0,设n=a*b,那么一定有x+1=k1a,x-1=k2b. 不妨设a<=b.那么就能O(sqrt(n))枚举a。 然后再枚举x,验证x是否满 ...
分类:
其他好文 时间:
2017-03-17 18:47:05
阅读次数:
194