摘要: https://www.cnblogs.com/kma093/p/9747300.html 阅读全文
posted @ 2019-11-10 14:14 Gold_stein 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 哇这道题我真的是被机惨了。。。 太真实了。。 #include<bits/stdc++.h> #define R register int using namespace std; const int N=2005,inf=0x3f3f3f3f,M=10005; inline int read() 阅读全文
posted @ 2019-11-06 15:30 Gold_stein 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 啊我沙雕了,竟然以为DJ的邻接矩阵不用初始化。。 阅读全文
posted @ 2019-11-04 13:36 Gold_stein 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #include #define R register int using namespace std; const int inf=0x3f3f3f3f; inline int read() { int x=0,f=1;char ch=getchar(); while(ch'9') if(ch=='-') f=-1,ch=getchar(); while(ch>='0'... 阅读全文
posted @ 2019-11-04 13:16 Gold_stein 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 在序列中寻找大于等于x的最小值 在序列中寻找小于等于x的最大值 阅读全文
posted @ 2019-11-02 13:19 Gold_stein 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 不得不说之前的差分我真的是掌握的不好。。 一维差分确实简单一看就会,但是学会了之后却并不能灵活的运用。 而二维的差分我甚至还琢磨了很长时间 懒得画图所以没有图。。对于二维差分的定义,百度百科是这么说的 顾名思义,就是在矩阵中,一行(一列)的元素与上一行(上一列)对应元素的差值,依次排列在上一行(上一 阅读全文
posted @ 2019-11-01 15:50 Gold_stein 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 算法竞赛进阶指南上说据说只有10%的程序员能写对二分,而我这种蒟蒻。。所以虽然这是一道非常基础的二分,但我觉得对我来说还是有必要写一篇博客来总结一下,也在写的过程中检验一下自己. 一开始看到这道题我还傻乎乎的想要通过看这个数字之前或者之后是否与自己相同来作为判断条件。。后来才发现这种想法实在愚蠢。。 阅读全文
posted @ 2019-10-30 15:54 Gold_stein 阅读(138) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; const int N = 100010; int q[N]; void quick_sort(int q[], int l, int r) { if (l >= r) return; int i = l - 1, j = r + 1, x = q[l + r >> 1]; while (i < j) { do i 阅读全文
posted @ 2019-10-29 15:59 Gold_stein 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; double h,s1,v,k,l; int n,ans; int main() { cin>>h>>s1>>v>>l>>k>>n; double t_max=sqrt(h/5), t_min=sqrt((h- 阅读全文
posted @ 2019-10-25 12:35 Gold_stein 阅读(376) 评论(1) 推荐(0) 编辑
摘要: #include using namespace std; const int maxn=105; int n,sum,a[maxn]; int main() { int i,j,step=0; cin>>n; for(i=1;i1&&a[j]==0) j--; while(i<j) {a[i+1]+=a[i]; a[i]=0; ... 阅读全文
posted @ 2019-10-24 20:36 Gold_stein 阅读(185) 评论(0) 推荐(0) 编辑