码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
atcoder abc 188 题解
A - Three-Point Shot 题目大意 两个球队现在分数分别给出,问少的一方投入三分球之后是否能翻盘. 代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define forn(i,x,n) f ...
分类:其他好文   时间:2021-01-13 10:46:21    阅读次数:0
P2486 [SDOI2011]染色
###链接 调了好久。。。 我平常写平衡树时 \(push\) \(tag\) 的操作都习惯把 \(rev\) 数组清零,但在 \(LCT\) 中不行,因为 \(rev\) 储存了节点间的父子关系,直接清零会改变树的结构。 \(\frak{code}\) #include<bits/stdc++.h ...
分类:其他好文   时间:2021-01-12 11:26:50    阅读次数:0
CF1036C Solution
题目链接 题解 很普通的数位dp题呐,$state$表示$>0$的数位个数。 AC代码 #include<bits/stdc++.h> #define int long long using namespace std; int dp[20][5],a[20],cnt; int dfs(int po ...
分类:其他好文   时间:2021-01-12 11:02:11    阅读次数:0
冒泡排序算法
冒泡排序 思想:每一趟排序,从左往右扫描数组,如果a[i]>a[i+1],就把她们交换 执行n次,数列就有序了。 正确性证明:第一次排序时,最大值将转到最右边, 第二次排序时,次大值将转到最右边......以此类推,n次之后n个数都到了指定位置 代码实现: `#include<bits/stdc++ ...
分类:编程语言   时间:2021-01-12 10:53:35    阅读次数:0
pipioj 1175: 货运费用(最短路)
1 #define IO std::ios::sync_with_stdio(0) 2 #include <bits/stdc++.h> 3 using namespace std; 4 #define mk make_pair 5 #define pb push_back 6 const int ...
分类:其他好文   时间:2021-01-06 11:49:40    阅读次数:0
题解 SP6286 【SUMMUL - Sum of products】
这题首先我们可以推出递推式: 我们先把加数个数大于等于 \(2\) 的限制去掉,最后再减回去即可。 \[ f_0=1 \] \[ f_n=\sum\limits_{i=1}^{n} j \cdot f_{i-j} \] 暴力代码: #include<bits/stdc++.h> using name ...
分类:其他好文   时间:2021-01-05 10:41:20    阅读次数:0
快速排序
#include<bits/stdc++.h> using namespace std; int n; void mysort(int a[],int l,int r)//自己写的快排 { int mid=a[(l+r)/2];//找中间的数进行2分 int i=l,j=r; do{ while(a ...
分类:编程语言   时间:2021-01-05 10:39:05    阅读次数:0
AcWing 842. 排列数字
给定一个整数n,将数字1~n排成一排,将会有很多种排列方法。 现在,请你按照字典序将所有的排列方法输出。 #include<bits/stdc++.h> using namespace std; int n,p[10]; bool k[10]; void out() { for(int i=1;i< ...
分类:Windows程序   时间:2021-01-02 11:10:23    阅读次数:0
哈希.字符串哈希.AcWing.841
code: #include<bits/stdc++.h>//xfl using namespace std; const int N = 100007; typedef unsigned long long ull; ull mis[N],sum[N]; string s; int n,m,l1, ...
分类:Windows程序   时间:2021-01-01 11:54:31    阅读次数:0
acwing 868. 筛质数
线性筛 #include<bits/stdc++.h> #define N 1000010 using namespace std; int v[N],p[N]; void pr(int n) { memset(v,0,sizeof(v)); int m=0; for(int i=2;i<=n;i+ ...
分类:Windows程序   时间:2021-01-01 11:39:00    阅读次数:0
3873条   上一页 1 ... 14 15 16 17 18 ... 388 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!