码迷,mamicode.com
首页 >  
搜索关键字:for while    ( 28479个结果
图的遍历
1.深度优先遍历 void dfs(Graph G,int i) { visted[i] = 1; for (int j = 0; i < G.vex; j++) { if (G.arcs[i][j]==1&&visted[j]!=1) { dfs(j); } } } 2.广度优先遍历 void b ...
分类:其他好文   时间:2020-08-18 13:20:00    阅读次数:51
HDU6856 Breaking Down News
dp[i] = max_{j ∈ [i-R,i-L]}( dp[j] + v(j+1,i) )。做前缀和后,对每种s[j]的值,开一个单调队列。每次将i-L入队、将i-R-1出队。用线段树维护每个队列的队首。转移时最区间最大值查询。 ...
分类:其他好文   时间:2020-08-17 16:57:59    阅读次数:68
C语言实现简易扫雷
C语言实现简易扫雷
分类:编程语言   时间:2020-08-15 22:38:57    阅读次数:78
retry until
do.sh #!/bin/bash repeat() { while :; do $@ && return; sleep 1; done } retryuntil() { echo $(date +%F%n%T) msg=`./job.sh 2>&1` echo $msg #echo "$msg" ...
分类:其他好文   时间:2020-08-13 22:08:35    阅读次数:50
计蒜客 T1725 国王的魔镜
首先取出这个项链的长度x,如果他是回文数的话让项链减去一半,x减去一半,如果他不是回文数,就退出循环 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#inc ...
分类:其他好文   时间:2020-08-13 12:13:39    阅读次数:53
Leetcode202 快乐数 佛洛依德循环
JAVA: public final boolean isHappy(int n) { int next = next(n); while (n != 1 && n != next) { n = next(n); next = next(next(next)); } return n == 1; } ...
分类:其他好文   时间:2020-08-12 15:41:43    阅读次数:51
2020/8/11
变量: 系统变量:全局变量、会话变量 自定义变量:用户变量、局部变量 一、系统变量 说明:变量由系统提供,不是用户定义,属于服务器层面 语法 1、查看所有的系统变量 show global | [session] variables; 2、查看满足条件的部分系统变量 show global |【se ...
分类:其他好文   时间:2020-08-12 14:04:56    阅读次数:74
skynet源码学习(一) linux无锁化编程
以下是skynet源码:structgroupnode{inthandle;structskynetcontextctx;structgroupnodenext;};structgroup{intlock;structgroupnodenode[HASHSIZE];};structgroupG=NULL;inlinestaticvoidlock(structgroupg){while(synclo
分类:Web程序   时间:2020-08-11 17:32:26    阅读次数:90
Leetcode.76 Minimum Window Substring (Java)
Leetcode.76 Minimum Window Substring Given a string S and a string T, find the minimum window in S which will contain all the characters in T in compl ...
分类:编程语言   时间:2020-08-11 15:56:40    阅读次数:64
for循环
package com.xuyifan.struct; /** * @author xyf * @create 2020-08-11-11:08 */ /** for循环最先执行初始化步骤,可以声明一种类型,但是可以初始化一个或多个初始化变量 也可以是空语句 检测布尔表达式的值,如果为true,则循 ...
分类:其他好文   时间:2020-08-11 13:06:35    阅读次数:82
28479条   上一页 1 ... 68 69 70 71 72 ... 2848 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!