Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in ...
分类:
其他好文 时间:
2019-09-25 09:18:05
阅读次数:
102
2019ICPC南京网络赛A题 The beautiful values of the palace https://nanti.jisuanke.com/t/41298 Here is a square matrix of n n n ? n , each lattice has its valu ...
分类:
其他好文 时间:
2019-09-24 21:27:39
阅读次数:
142
为了1天4题的flag不倒所以开新坑... B. 考虑把这棵树直接建出来,f[i]表示i最少的比赛次数,然后按照定义转移就行了。 //Love and Freedom. #include<cstdio> #include<algorithm> #include<cstring> #include<c ...
分类:
其他好文 时间:
2019-09-24 17:36:36
阅读次数:
76
malloc与free是C++/C语言的标准库函数,new/delete是C++的运算符。它们都可用于申请动态内存和释放内存。对于非内部数据类型的对象而言,光用maloc/free无法满足动态对象的要求。对象在创建的同时要自动执行构造函数,对象在消亡之前要自动执行析构函数。由于malloc/free ...
分类:
编程语言 时间:
2019-09-24 14:19:44
阅读次数:
85
注:因为不了解Dart,所以本文不对flutter相关内容进行阐述, 实在抱歉 其实写这篇文章的时候,我就知道,肯定有人问我:为什么不写flutter?抱歉了,flutter的大名我当然知道,可我只是一个写JS的,同时了解一些Java的知识,而flutter采用的编程语言,我暂时没有碰过,所以自然不 ...
分类:
移动开发 时间:
2019-09-23 10:07:49
阅读次数:
135
Leetcode 69. Sqrt(x) Easy https://leetcode.com/problems/sqrtx/ Implement int sqrt(int x). Compute and return the square root of x, where x is guarante ...
分类:
其他好文 时间:
2019-09-22 21:43:35
阅读次数:
118
现在,有一个计算面积的需求,其中一种实现如下: 现在,有一个计算面积的需求,其中一种实现如下: class Square{ public $side; } class Geometry{ public function area($shape){ if($shape instanceof Squar ...
分类:
其他好文 时间:
2019-09-22 19:55:48
阅读次数:
87
这三个都是自 JDK1.5 开始加入到 java.util.concurrent.atomic 下面的。他们都可以在 lock-free 的情况下以原子的方式更新对象引用。 一、AtomicReference 以原子方式更新对象引用。 二、AtomicStampedReference 解决了 Ato ...
分类:
其他好文 时间:
2019-09-22 13:08:48
阅读次数:
94
void merge(LNode *A,LNode *B,LNode *&C) //此处C指针为引用型 { LNode *p=A->next; LNode *q=B->next; LNode *r; //r是尾指针 C=A; C->next=NULL; r=C; free(B); //释放B的头结点 ...
分类:
编程语言 时间:
2019-09-20 21:11:12
阅读次数:
68
原型: 用法:#include 有些编译器需要#include 功能:改变mem_address所指内存区域的大小为newsize长度。 说明:如果重新分配成功则返回指向被分配内存的指针,否则返回空指针NULL。 当内存不再使用时,应使用free()函数将内存块释放。 注意:这里原始内存中的数据还是 ...
分类:
编程语言 时间:
2019-09-20 18:37:48
阅读次数:
78