不懂得见算法背包问题详解
代码如下:
#include
struct node
{
int cost;
double wei;
} a[10004];
double min(double a,double b)
{ return a>b? b:a;}
int main()
{
int i,j,n,m;
double dp[10004];
whil...
分类:
其他好文 时间:
2014-07-24 17:44:25
阅读次数:
235
.hnamespace xxx{ struct yyy {} stream& operater <<(stream& in,yyy& a);}.cppstream& operater <<(stream& in,yyy& a){}; //error 可以编译,但是某个地方用到这个重载的话,将会有链....
分类:
其他好文 时间:
2014-07-24 17:29:16
阅读次数:
209
#include#includeusing namespace std;typedef int ElemType;typedef struct Node{ ElemType data; struct Node* next;}*LinkList,Node;LinkList LinkList...
分类:
其他好文 时间:
2014-07-24 17:19:15
阅读次数:
224
#用到了贪心方法。
#这个贪心刚开始想错了方法,后来想到了新的方法,AC
#include
#include
#include
#include
using namespace std;
struct note
{
int x1,x2,y1,y2,x,y;
int num;
} a[5010];
int vis[5010];
bool cmp1(note aa,note...
分类:
其他好文 时间:
2014-07-24 12:26:15
阅读次数:
185
Problem Description
Paper quality and quantity have long been used to measure a research's scientific productivity and scientific impact. Citation, which is the total times a paper has been cited, is...
分类:
其他好文 时间:
2014-07-24 11:36:52
阅读次数:
260
UVA 474 - Heads / Tails Probability
题目链接
题意:给定n,求出2?n的科学计数法
思路:水水的,n最多到100w,那么先递推预处理出答案,然后输出即可
代码:
#include
#include
const int N = 1000001;
const double eps = 1e-9;
int n;
struct Ans...
分类:
其他好文 时间:
2014-07-24 10:39:54
阅读次数:
234
树状数组,果断1A啦,心情舒畅啊,哈哈
先按照y轴从小到大排序,然后一次加入并统计每个点得x坐标,这道题数据不严谨啊,在y轴相同得情况下,应该以x轴从大到小排序,可我都没排x轴就过了
#include
#include
#include
#include
using namespace std;
int Max;
struct node{
int x,y;
}a[15005];
int...
分类:
其他好文 时间:
2014-07-24 10:23:24
阅读次数:
185
/* * 动态分配存储的顺序表 */#include #include #define INIT_SIZE 100#define EXPAND_SIZE 50typedef int ElemType;typedef struct { ElemType *head; int len; //...
分类:
其他好文 时间:
2014-07-24 09:56:34
阅读次数:
172
第一道计算几何。二分一下用叉积来判。。看了DIS上说要INT64,就改INT64了。。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int Max=5050; 7 8 struct ...
分类:
其他好文 时间:
2014-07-24 09:43:32
阅读次数:
257
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace WindowsFormsApplication3.Enums{ public enum WizardButto...
分类:
数据库 时间:
2014-07-24 05:07:18
阅读次数:
211