struct Node{ int data; Node *next;};//创建链表 输入为数字,如果输入0 链表结束(0不计)Node *creat(){ Node *head,*p,*s; int x,cycle=1; head=(Node *)malloc(siz...
分类:
其他好文 时间:
2014-08-02 20:50:24
阅读次数:
292
以保留2位小数为例,代码如下:#include#includeusingnamespacestd;intmain(){doublea;cin>>a;coutc)&&((a+c)>b&&((b+c)>a))) { p=(a+b+c)/2; s=sqrt(p*(p-a)*(p-b)*(p-c)); pr...
分类:
编程语言 时间:
2014-08-02 20:43:54
阅读次数:
1478
#include int gcd(int m,int n){if(n==0) return m;else return gcd(n,m%n);}*************变形一int gcd(int m,int n) {if(m%n==0) return m; else return gcd(n,m...
分类:
其他好文 时间:
2014-08-02 20:40:13
阅读次数:
243
问题:从起点到终点总共有多少条路径分析:f[x,y]=f[x+1,y]+f[x,y+1],用记忆化搜索就可以解决了class Solution {public: int num[110][110]; int dfs(int m,int n,int x,int y) { ...
分类:
其他好文 时间:
2014-08-02 20:39:33
阅读次数:
165
题意:二叉树的最小深度注意 1.当root为空的时候直接返回0,因为MIN赋值很大,所以如果不单独预判的话会返回MIN 2.判断树的深度应该到叶子节点,也就是左右子结点都为空的那个结点 3.树的深度的根节点深度为1class Solution {public: void dfs(...
分类:
其他好文 时间:
2014-08-02 20:39:13
阅读次数:
233
RESTClient控件返回数据集用到的控件RESTClientRESTResponseDataSetAdapterprocedure Tfrm_Main.btn_DataSet_FetchDataClick(Sender: TObject);begin ResetRESTComponentsTo....
分类:
其他好文 时间:
2014-08-02 20:38:13
阅读次数:
307
Delay Constrained Maximum Capacity Path
Time Limit:10000MS Memory Limit:65535KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Consider an undirected graph with N vert...
分类:
其他好文 时间:
2014-08-02 18:31:43
阅读次数:
313
一、JAVA部分:
二、Android部分:...
分类:
移动开发 时间:
2014-08-02 18:25:33
阅读次数:
298
E - WuKong
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
Liyuan wanted to rewrite the famous book “Journey to the West” (“Xi Yo...
分类:
其他好文 时间:
2014-08-02 18:23:43
阅读次数:
353
题目链接:点击打开链接
b的数字最多只能达到59,因为选>=60 不如选1
所以状压一下前面出现过的素数即可,在59内的素数很少
然后暴力转移。。
#include
#include
#include
#include
#include
const int Inf = (int)(1e9);
const int S = 1 << 17;
const int N = 100 + 2...
分类:
其他好文 时间:
2014-08-02 18:20:53
阅读次数:
225