码迷,mamicode.com
首页 >  
搜索关键字:val    ( 23217个结果
【瞎搞】 HDU 3101 The Heart of the Country
比赛时愣是没读懂 题意:有N 个城市 每个城市都有 val 个 士兵 , 有几条路连接 当敌方攻击你的某个城市时 该城市以及与该城市相连接的城市的士兵总数 要大于 K  不大于 K 该城市就被攻陷,士兵被俘虏 则不能支援别的城市 求最后一共有多少城市不被攻陷,以及士兵总数 思路:先计算该点能支援到的总士兵数 然后将  总数小于 K  的取出     减去相连的城市上的总士兵数 ...
分类:其他好文   时间:2014-10-06 23:05:11    阅读次数:267
leetCode Symmetric Tree
非递归解法 /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2014-10-06 12:54:00    阅读次数:211
Python基础学习笔记
1.Python程序结构:输入-处理-输出输出语句:print()函数format格式化函数format(val,‘m.nf‘)m.nf,m是占位符,例如:print(format(12.243,‘3.2f‘))->_12.24 print(format(0.1245,‘2.2%‘))->12.45%输入语句:raw_input([promot])返回的是字符串re=raw_input() type(re)-&..
分类:编程语言   时间:2014-10-06 02:19:11    阅读次数:289
使用jQuery练习全选-取消-反选-显示选择内容等功能代码
部长练习全选-取消-反选-显示选择内容等功能代码: 部长练习全选-取消-反选-显示选择内容等功能 $(document).ready(function(e) { //实现全选功能 $(':input[value=全选]').click(function(){ //alert($(this).val()); $('for...
分类:Web程序   时间:2014-10-05 17:52:58    阅读次数:196
栈和堆的地址哪个高
我们都知道,堆是向到高地址扩展的,栈是向低地址扩展的,那么堆和栈的地址那个高呢?int _tmain(int argc, _TCHAR* argv[]){ int stack_val = 0; int* heap_ptr = new int(2); printf("stack ad...
分类:其他好文   时间:2014-10-04 22:33:17    阅读次数:208
leetcode Linked List Cycle
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool hasCycl...
分类:其他好文   时间:2014-10-04 15:09:06    阅读次数:187
Leetcode Binary Tree Preorder Traversal
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Soluti...
分类:其他好文   时间:2014-10-04 15:07:46    阅读次数:162
C++ Variables and Basic Types Notes
1. Type conversion:If we assign an out-of-range value to an object of unsigned type, the result is the remainder of the value modulo the number of val...
分类:编程语言   时间:2014-10-03 18:53:04    阅读次数:198
leetcode - Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis...
分类:其他好文   时间:2014-10-03 17:21:45    阅读次数:167
leetcode - Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * ...
分类:其他好文   时间:2014-10-03 15:40:04    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!