UVA 11256 - Repetitive Multiple
题目链接
题意:找出一个最小值满足: 是n的倍数, 是重复数字(根据题目中的定义)
思路:如果是重复数字,形式必然是100010001这类形式乘上一个对应位数的数字,所以可以枚举这样形式的数字,和n取gcd,如果剩下的数字位数满足小于位数,那么就乘上一个数字使得等于最小满足位数,这样不断记录最小值即可
代码:
...
分类:
其他好文 时间:
2014-09-05 18:16:10
阅读次数:
161
1. 文档DTD文档类型定义(Document Type Definition,简称DTD)它包含了元素的定义规则、元素间关系的定义规则,元素可使用的属性、可使用的实体或符号规则。没有DTD定义的时候,IE6/7/8会触发怪异模式,firefox依然是标准模式。为了让所有浏览器都以统一的标准去解析和...
分类:
其他好文 时间:
2014-09-05 14:11:11
阅读次数:
147
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:
其他好文 时间:
2014-09-05 12:53:01
阅读次数:
260
一开始的思路是:中序遍历+判断遍历后的数组,时间空间都不是最优果然超时了 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:
其他好文 时间:
2014-09-04 23:35:50
阅读次数:
393
递归 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode...
分类:
其他好文 时间:
2014-09-04 22:16:00
阅读次数:
228
重新写了下,代码看着清爽多了 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x...
分类:
其他好文 时间:
2014-09-04 20:54:00
阅读次数:
162
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
/**
* Definition for singly-lin...
分类:
其他好文 时间:
2014-09-04 19:12:40
阅读次数:
201
link($name)会使用..get$name...即有hasmany和hasone... // update lazily loaded related objects if (!$relation->multiple) { $this->_related[$name] =...
分类:
其他好文 时间:
2014-09-04 09:39:38
阅读次数:
203
1.打开eclipse,选择【文件】|【新建】|【项目】2.选择【Tomcat Project】后单击下一步,输入项目名【TestTomcat】,选择下一步,将【Can update context definition】打钩,点击完成。3.创建servlet类:在导航器中右击【TestTomcat...
分类:
系统相关 时间:
2014-09-03 16:19:06
阅读次数:
365
1. DDL(Data Definition
Language)
数据库定义语言statements
are used to define the database structure or schema。用于定义数据库的三级结构,包括外模式、概念模式、内模式及其相互之间的映像,定义数据的完整性、安全控制等约束。DDL不需要commit。
DDL的操作包含:
CREATE...
分类:
数据库 时间:
2014-09-03 11:23:46
阅读次数:
226