随笔分类 - 数学
摘要:Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many p
        阅读全文
                
摘要:A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数据,每个数据的范围是[0,9],表示
        阅读全文
                
摘要:暴力出奇迹,我就知道没取余那么正当,肯定有什么奇淫怪巧,果然5分钟A掉。
        阅读全文
                
摘要:开始以为是容斥原理,想着做一下,应该是可以用容斥解决的,有空再过来写一下。题解是进制转换,开始没想到,不过很好理解。 如在10进制里: 1254= (1*10^3 + 2*10^2 + 5* 10^1+ 4*10^0) 而faulty的大小:1254= (1* 8^3 + 2* 8^2 + 4* 8
        阅读全文
                
摘要:用向量解决: 三角形面积:S=1/2*|x1*y2-x2*y1|; (粗体表示向量) 三棱锥体积:V=1/6*(OA*OB)*OC 不知道哪里去找的代码,毕竟很线性代数矩阵什么的很头疼,晚上再手动比划下。
        阅读全文
                
摘要:1207汉诺塔IIGardonGardon-DYGG Contest 2(4374/8844)49.46% 1995汉诺塔VZhousc@ECJTUECJTU 2008 Spring Contest(3281/5316)61.72% 1996汉诺塔VIZhousc@ECJTUECJTU 2008 ...
        阅读全文
                
摘要:吃糖果 Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 41705 Accepted Submission(s): 12022 Problem 
        阅读全文
                
摘要:假设有一个一维序列,现在可以相邻两两交换,把它变成有序的序列,求最小交换次数,大家都知道求逆序对。如果现在有一个围圈的序列,一样两两相邻交换,此时怎么搞?
        阅读全文
                
摘要:这些题都可以用动规或者背包做 HDU1028 HDU1398 HDU2079 HDU2082
        阅读全文
                
摘要:反证法证明得到 中点 满足题意#include#include#include#include#include#includeusing namespace std;int a[600];int ans;int main(){	int T,n,i,j;	cin>>T;	while(T--){ an...
        阅读全文
                
摘要:第一次看到这题果断放弃,毕竟几何白痴,第二次刷没做的题的时候突然想到这个三角形面积的向量法:S=|x1*y2-x2*y1| 但是此题可能是凹多边形,所以不能加绝对值,可以画个凹四边形看看。
        阅读全文
                
摘要:做多了年月日,现在基本就能水过了 18岁生日 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 33799 Accepted Submission
        阅读全文
                
摘要:整数划分问题 整数划分是一个经典的问题。 Input 每组输入是两个整数n和k。(1 <= n <= 50, 1 <= k <= n) Output 对于每组输入,请输出六行。 第一行: 将n划分成若干正整数之和的划分数。 第二行: 将n划分成k个正整数之和的划分数。 第三行: 将n划分成最大数不超
        阅读全文
                
摘要:HDU1465HDU2048HDU2049#include #include #include #include #include using namespace std; long long s[21],c[21]; void _gets() { s[0]=0;s[1]=0;s[2]=1; for(i=3;i>n; while(n--){ cin>>m; pr...
        阅读全文
                
摘要:Kinds of FuwasTime Limit: 2 Seconds Memory Limit:65536 KBIn the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the ...
        阅读全文
                
摘要:昨天做过一样的题: 平方和公式:n*(n+1)*(2n+1)/6
        阅读全文
                
摘要:ZOJ2150 快速幂,但是用递归式的好像会栈溢出。 #include<cstdio> #include<cstdlib> #include<iostream> #include<cmath> using namespace std; long long M,i; #define LL long l
        阅读全文
                
摘要:初步找大概位置,然后找精确位置,算是简单化的分块吧! #include<cstdio> #include<cstdlib> #include<iostream> using namespace std; int c[5000]; int num=0; void _get() { int k=1,m;
        阅读全文
                
                    
                
浙公网安备 33010602011771号