上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页
摘要: Little Petya likes to play a lot. Most of all he likes to play a game «Holes». This is a game for one person with following rules: There are N holes l 阅读全文
posted @ 2018-02-26 22:36 euzmin 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 题目大意 给定一个含有N个数的序列,要求你对一些数减掉或者加上某个值,使得序列变为非递减的,问你加减的值的总和最少是多少? 题解 一个很显然的结果就是,变化后的每一个值肯定是等于原来序列的某个值,因为只需要变为非递减的,所以对于某个数要么不变,要么变成左右附件的某个值。这样我们就可以根据前述条件得出 阅读全文
posted @ 2018-02-25 21:49 euzmin 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 凑平方数 把0~9这10个数字,分成多个组,每个组恰好是一个平方数,这是能够办到的。 比如:0, 36, 5948721 再比如: 1098524736 1, 25, 6390784 0, 4, 289, 15376 等等... 注意,0可以作为独立的数字,但不能作为多位数字的开始。 分组时,必须用 阅读全文
posted @ 2018-02-25 18:28 euzmin 阅读(478) 评论(0) 推荐(0) 编辑
摘要: 题意: 题解: 1 #include<cstdio>//s=l/2+n-1; 2 #include<cmath> 3 #include<cstdlib> 4 int a,b,c,d,e,f; 5 int area(){ 6 return abs((a*d+c*f+b*e-a*f-b*c-d*e)/2 阅读全文
posted @ 2018-02-25 11:05 euzmin 阅读(879) 评论(0) 推荐(0) 编辑
摘要: 互质模板 1 #include <iostream> 2 using namespace std; 3 4 int Extended_Euclid(int a,int b,int &x,int &y) //扩展欧几里得算法 5 { 6 int d; 7 if(b==0) 8 { 9 x=1;y=0; 阅读全文
posted @ 2018-02-25 10:42 euzmin 阅读(304) 评论(0) 推荐(1) 编辑
摘要: 一、除法取模逆元 如果我们要通过一个前面取过模的式子递推出其他要取模的式子,而递推式里又存在除法 那么一个很尴尬的事情出现了,假如a[i-1]=100%31=7 a[i]=(a[i-1]/2)%31 a[i]=50%31=19 ,但我们现在只知道a[i-1]=7,如何计算出a[i]=19呢? a[i 阅读全文
posted @ 2018-02-25 10:26 euzmin 阅读(950) 评论(0) 推荐(0) 编辑
摘要: 1 int digit_stirling(int n) 2 { 3 double PI=acos(double(-1));// PI的值=反余弦函数 -1.0为Pi, 1为0。 4 double e=exp(double(1));//e的值 5 return floor(log10(sqrt(2*P 阅读全文
posted @ 2018-02-07 18:42 euzmin 阅读(238) 评论(0) 推荐(0) 编辑
摘要: E. Connected Components? time limit per test 2 seconds time limit per test memory limit per test 256 megabytes memory limit per test input standard in 阅读全文
posted @ 2018-02-07 18:37 euzmin 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 太难了,学不会。看了两天都会背了,但是感觉题目稍微变下就不会了。dp还是摸不到路子。 附ac代码: 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<vector> 阅读全文
posted @ 2018-02-03 14:45 euzmin 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 求出LCIS并输出其路径。 1 #include <iostream> 2 #include <cstdio> 3 #include <string> 4 #include <cstring> 5 #include <fstream> 6 #include <algorithm> 7 #includ 阅读全文
posted @ 2018-02-01 18:25 euzmin 阅读(294) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 22 下一页