码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
运算符穷举
namespace 运算符穷举{ class Program { static void Main(string[] args) { //123()45()68=100; 在括号里面添加+-使等式成立 int a; int b; for (int i = 0; i < 2; i++)//有0 和.....
分类:其他好文   时间:2015-04-16 00:59:18    阅读次数:216
首尾相连最大子数组和(2)
#includeusing namespace std;#define Nu 5int main(){ int a[Nu]={2,-2,4,-6,1}; cout0) { b=a[j%Nu]; if(jb) ...
分类:编程语言   时间:2015-04-16 00:57:14    阅读次数:161
兔子生兔子函数递归
namespace 兔子生兔子函数递归{ class Program { static void Main(string[] args) { Console.WriteLine("请输入你想知道兔子哪个月的数量:"); int m = Convert.ToInt32(Console.ReadLine...
分类:其他好文   时间:2015-04-16 00:56:28    阅读次数:188
一些递归程序
代码一:#include using namespace std; void ten_to_two(int num); int main() { int num=10; ten_to_two(num); return 0; } void ten_to_two(int num) { if(num!=0){ int m=num%2; num=num/2; ten_to_two(n...
分类:其他好文   时间:2015-04-15 23:29:12    阅读次数:154
基数排序
//基数排序 #include #include #include #include #define maxn 100 using namespace std; int a[maxn]; int n=0; int bits=0; vector  barrel[10]; int bitnum(int n) {     int result=0;     while...
分类:编程语言   时间:2015-04-15 23:23:56    阅读次数:208
【动态规划】bzoj3992 [Sdoi2015]序列统计 10分
#includeusing namespace std;#define MOD 1004535809int a[8001],f[1001][101],n,m,x,S;int main(){ scanf("%d%d%d%d",&n,&m,&x,&S); for(int i=1;i<=S;++i) .....
分类:其他好文   时间:2015-04-15 23:18:37    阅读次数:183
树链剖分
先来LCA的: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define REP(i, s, n) for(int i = s; i = s; i --) 8 using namespace std; 9 const ...
分类:其他好文   时间:2015-04-15 22:55:26    阅读次数:193
hdu 1269 tarjan求强连通分量
tarjan求强连通分量的裸题复习,直接上代码: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 10001; 7 const int M = 100000; 8 int dfn[N], lo...
分类:其他好文   时间:2015-04-15 22:46:52    阅读次数:175
POJ 3061
#include #include #include #include #include using namespace std; #define maxn 100000 #define INF 0x7ffffff int n, S, a[maxn]; void solve() { int s = 0, t = 0; int res = INF; int s...
分类:其他好文   时间:2015-04-15 21:28:40    阅读次数:105
【USACO】Sorting a Three-Valued Sequence(思路)
拼了老命用一种贪心的思想把它A了,但是代码写的太烂了,而且时间复杂度为 n ^ 2,我就不多说了,太烂了 之后上网找了一个规律,时间复杂度为 nlogn,而且思路很明确,又写了一遍 代码:(贪心) /* ID: 18906421 LANG: C++ PROG: sort3 */ #include #include #include #include using namespace std; ...
分类:其他好文   时间:2015-04-15 21:26:29    阅读次数:119
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!