for循环 跳出本次循环continue,继续下次循环 var arr = [1,2,3,4,5,6,7,8] for(var i=0, len = arr.length ; i< len ; i++){ if(i == 2){ continue; } console.log(i); } //0 / ...
分类:
Web程序 时间:
2020-07-09 22:43:32
阅读次数:
97
题目链接:http://poj.org/problem?id=3321 题目大意:给定一棵树,某些节点上有苹果,多次询问各子树上的节点数,并且在询问的中途随时可能新增和删除苹果。 Sample Input 3 1 2 1 3 3 Q 1 C 2 Q 1 Sample Output 3 2 emmm, ...
分类:
移动开发 时间:
2020-07-09 19:37:43
阅读次数:
84
Description Given an array of integers A, find the number of triples of indices (i, j, k) such that: 0 <= i < A.length 0 <= j < A.length 0 <= k < A.le ...
分类:
其他好文 时间:
2020-07-09 19:24:31
阅读次数:
58
一、今日学习内容 1、JAVA运算符 (1)算术运算符:加号(+)、减号(-)、乘号(*)、除号(/)、除余(%)、自增(++a,a++) 1 public class VTest{ 2 public static void main(String[] args){ 3 int a=0; 4 a++ ...
分类:
其他好文 时间:
2020-07-08 19:57:47
阅读次数:
65
| break | case | catch | continue | do | | delete | default | false | finally | for | |fuction | function| if | in | inscanceof | | new | null | retur ...
分类:
编程语言 时间:
2020-07-07 13:32:07
阅读次数:
112
需要调试器 任何编程语言中最简单的调试形式是使用打印语句/日志并写入标准输出。这肯定可以工作,但是当我们的应用程序规模增加并且逻辑变得更加复杂时,它变得极其困难。将打印语句添加到应用程序的每个代码路径都不容易。这是调试器派上用场的地方。调试器可帮助我们使用断点和许多其他功能来跟踪程序的执行路径。De ...
分类:
其他好文 时间:
2020-07-07 12:49:45
阅读次数:
56
112. 路径总和 给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和。 说明: 叶子节点是指没有子节点的节点。 示例: 给定如下二叉树,以及目标和 sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1 返回 ...
分类:
编程语言 时间:
2020-07-07 09:23:38
阅读次数:
102
dfs序 void dfs(int u,int fa) { dfs_[++len]=u; int sz=g[u].size(); for(int i=0;i<sz;i++) if(g[u][i]!=fa) dfs(g[u][i],u); } 所以对于一棵树的dfs序来说,这个点和他所有的子节点会被存 ...
分类:
其他好文 时间:
2020-07-06 18:11:54
阅读次数:
62
Break与continue //break退出整个循环 //continue跳过本次尚未执行的操作 public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<100){ i++; Sy ...
分类:
其他好文 时间:
2020-07-06 18:05:04
阅读次数:
42
http://acm.hdu.edu.cn/showproblem.php?pid=1059 多重背包题; 如果sum奇数直接continue;不是奇数则判断dp[sum/2]能不能到达; 即dp[sum/2]的方案数是否为0; 注意输出格式!!! 1 #include<bits/stdc++.h> ...
分类:
其他好文 时间:
2020-07-05 22:54:20
阅读次数:
81