码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
C#多线程的简单例子
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;//using System.Threading.Tasks;using System.I...
分类:编程语言   时间:2014-05-19 20:01:31    阅读次数:258
poj--2782
题意:贪心,排序后大数与小数相加具体代码:#include #include #include #include #include using namespace std;#define maxn 100005int n, m;int f[maxn];int cmp(int a, int b){ ....
分类:其他好文   时间:2014-05-19 19:42:31    阅读次数:233
hdu 3038 How Many Answers Are Wrong
http://acm.hdu.edu.cn/showproblem.php?pid=3038 1 #include 2 #include 3 #include 4 #define maxn 600000 5 using namespace std; 6 7 int f[maxn],d[max...
分类:其他好文   时间:2014-05-19 18:51:33    阅读次数:252
使用引用交换两个数字
#include using namespace std; //定义一个函数,用于交换两个变量的值 void swap(int &a, int &b); void main() { int i = 3, j = 5; cout<<"交换前:i="<<i<<" j="<<j<<endl; swap(i,j); cout<<"交换后:i="<<i<<" j="<<j<<endl;...
分类:其他好文   时间:2014-05-18 16:05:54    阅读次数:209
hdu 1284 钱币兑换问题
题目:     链接:点击打开链接 算法:     完全背包。     状态转移方程:    dp[j]  +=  dp[j-i];dp[j]表示钱j可以兑换的方法,,,,,i是硬币的价值1,2,3,,,个数是不限的 代码: #include #include #include using namespace std; int dp[40000]; int n; int main(...
分类:其他好文   时间:2014-05-18 15:43:08    阅读次数:265
Codeforces Round #246 (Div. 2)
A、Choosing Teams 水题 #include #include using namespace std; int main() { int n, k, ans, i, x; scanf("%d%d",&n,&k); ans = 0; for(i=0; i<n; ++i) { scanf("%d",&x);...
分类:其他好文   时间:2014-05-18 10:53:23    阅读次数:262
C++实现二叉搜索树的常用操作
实现操作 (1)二叉搜索树的建立 (2)二叉搜索树的插入 (3)二叉搜索树的三种递归遍历(前序、中序和后续) (4)二叉搜索树的三种非递归遍历(前序、中序和后续) (5)二叉搜索树的逐层打印 有时间再实现: (6)二叉搜索树的前驱和后继查找 (7)二叉搜索树的删除 源码分析: #include #include #include using namespace st...
分类:编程语言   时间:2014-05-18 10:28:47    阅读次数:492
Codeforces #246(div2)
A:A. Choosing Teams .题目就不介绍了,直接统计即可。 AC代码: #include #include #include using namespace std; int cnt[6]; int main() { int n,k,i,x; while(cin>>n>>k) { memset(cnt,0,sizeof(cnt));...
分类:其他好文   时间:2014-05-18 08:41:02    阅读次数:233
poj1655 Balancing Act 【树形DP(很弱)】
都不知道怎么分类了。 大概要求一个树中以某个结点为根的子树结点个数,还有儿子结点中以儿子结点为根的子树结点个数的最大值,用递归得到n[i],以i为根节点的子树结点个数 #include #include #include #include #include #include #include using namespace std; #define scan(a) scanf("...
分类:其他好文   时间:2014-05-18 07:26:01    阅读次数:225
数据结构与算法一
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围) #include using namespace std; const int MAX = 1000000; int getResu(int n) { int sum=0; int temp= 1; for(int i=1; i <= n; i++) { temp *= i; temp %= MAX; ...
分类:其他好文   时间:2014-05-18 03:36:19    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!