0是NULL的一个实现,但NULL不是0。 指针的数值是其所指向的内存的地址。很多时候我们需要标明“这个指针当前为无效指针,它不指向任何可以使用的内存空间”,因为不能在指针外附加一个标志位,所以就需要设定一个特别的值,当指针的数值是这个值时,我们就认为这个指针当前是无效指针因为内存从0开始的一段区域 ...
分类:
其他好文 时间:
2017-06-26 21:15:26
阅读次数:
118
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1080 1080 - Binary Simulation PDF (English) Statistics Forum Time Limit: 2 second(s) Memory ...
分类:
其他好文 时间:
2017-06-26 19:02:02
阅读次数:
252
都从1开始计数。 高度从下往上数。 深度从上往下数。 对于整棵树来说,最深的叶结点的深度就是树的深度;树根的高度就是树的高度。这样树的高度和深度是相等的。 对于树中相同深度的每个结点来说,它们的高度不一定相同,这取决于每个结点下面的叶结点的深度。 ...
分类:
其他好文 时间:
2017-06-26 18:04:29
阅读次数:
116
#include #include #include #include #include #include using namespace std; priority_queue,greater > Q; int main(){ int n; int res; int a,b; while(scan... ...
分类:
其他好文 时间:
2017-06-26 16:08:40
阅读次数:
171
#include #include #include #include #include #include using namespace std; map opmap; string s; struct obj{ double num; char op; bool isnum; }; stack ... ...
分类:
其他好文 时间:
2017-06-26 12:39:10
阅读次数:
178
#include #include using namespace std; char str[110]; char res[110]; int main(){ while(scanf("%s",str)!=EOF){ stack S; int i; for(i=0;str[i]!=0;i++){ ... ...
分类:
其他好文 时间:
2017-06-25 20:47:18
阅读次数:
131
#include #include int book[205]; int buf[205]; int main(){ int n,m; int tmp; while(scanf("%d %d",&n,&m)!=EOF){ memset(book,0,sizeof(book)); for(int i=... ...
分类:
其他好文 时间:
2017-06-25 20:23:22
阅读次数:
164
贪心,每次选择浓度最低的。 注意浮点数比较的问题。 AC如下: 上面这行代码会导致WA,因为相当于< 改成这样,AC. 因为相当于<= ...
分类:
其他好文 时间:
2017-06-25 18:33:10
阅读次数:
152
#include #include using namespace std; const double eps=1e-8; bool greater(double x){ if(x>eps) return 1; else return 0; } struct Goods{ double price;... ...
分类:
其他好文 时间:
2017-06-25 17:45:07
阅读次数:
183
#include #include using namespace std; struct Program{ int s; int e; bool operator < (const Program &A) const{ return e<A.e; } }program[105]; int main... ...
分类:
其他好文 时间:
2017-06-25 17:41:49
阅读次数:
97