码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
HDU 4609 3-idiots(FFT计数)
题意:给n(n<=100000)根棍子。每根棍子的长度是m(m<=100000),求从中任意取出三根的概率: 题解:经典FFT计数。。。枚举最长边。。然后经过一系列玄学取重就可以啦。。好神奇呀。。细节见代码。 #include<bits/stdc++.h> using namespace std; ...
分类:其他好文   时间:2017-04-10 09:24:26    阅读次数:239
Gym 100090M Jumping along the Hummocks
题意: 从 前往后跳,要么跳一步,跳到相邻的位置,要么跳到下一个数字相同的位置,求跳到最后的最少步数。 dp,但是会tle,我用map优化了一下。 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 6 const int inf = 0x ...
分类:其他好文   时间:2017-04-09 23:39:39    阅读次数:193
Gym 100090D Insomnia
从 n 变到 1,有多少种方案? 打表记忆化。 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 int n; 6 int dp[1000005]; 7 int dfs(int n) { 8 if(n==1) 9 return 1; 10 ...
分类:其他好文   时间:2017-04-09 23:36:07    阅读次数:235
01背包
乍一看,以为是最简单的01背包,但是要注意的是,这个的质量太大啦,但是发现他的价值却是非常少的,所以我们换一种思路 1 正确代码 2 #include<bits/stdc++.h> 3 using namespace std; 4 5 int maxn=100000000; 6 7 int dp[5 ...
分类:其他好文   时间:2017-04-09 15:39:32    阅读次数:183
TopCoder代码格式模板
1 $BEGINCUT$ 2 $PROBLEMDESC$ 3 $ENDCUT$ 4 #include<bits/stdc++.h> 5 using namespace std; 6 typedef long long LL; 7 typedef pair<int,int> pii; 8 9 temp ...
分类:其他好文   时间:2017-04-08 11:10:44    阅读次数:205
hdu 4609 3-idiots(FFT计数)
题目链接:hdu 4609 3-idiots 题意: 给你n条线段。问随机取三个,可以组成三角形的概率。 题解: FFT搞,具体可看kuangbin菊苣的详细题解:传送门 1 #include<bits/stdc++.h> 2 #define F(i,a,b) for(int i=a;i<=b;++ ...
分类:其他好文   时间:2017-04-07 09:30:01    阅读次数:246
欧拉筛
#include<bits/stdc++.h> using namespace std ; const int maxn = 1000000 ; bool isprime[maxn]; int prime[maxn]; int init() { int cntprime = 1 ; for( int ...
分类:其他好文   时间:2017-04-05 21:38:20    阅读次数:231
含参数的构造函数_将对象灵活的初始化
初始化过程和一般的变量相同 完整代码: 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 class student 5 { 6 private: 7 string name; 8 string id; 9 10 public: 11 stu ...
分类:其他好文   时间:2017-04-05 21:20:39    阅读次数:143
完美字符串
1 #include <bits/stdc++.h> 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0); 3 using namespace std; 4 typedef long long ll; 5 int main() 6 { 7 in ...
分类:其他好文   时间:2017-04-04 12:42:13    阅读次数:101
波特率,kbps,Mbps含义
Mbps=Mbit/s即兆比特每秒。Million bits per second的缩写 传输速率是指设备的的数据交换能力,也叫"带宽",单位是Mbps(兆位/秒),目前主流的集线器带宽主要有10Mbps、54Mbps/100Mbps自适应型、100Mbps和150Mbps四种。 ...
分类:其他好文   时间:2017-04-01 21:47:33    阅读次数:760
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!