码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
二分法的拓展与应用
#include<cstdio> const double eps = 1e-5; double f(double x) { return x * x; } double calSqrt() { double mid,left=1,right=2; while (right - left > eps ...
分类:其他好文   时间:2021-04-20 14:03:49    阅读次数:0
PAT 乙级 1057.数零壹 C++/Java
题目来源 给定一串长度不超过 1 的字符串,本题要求你将其中所有英文字母的序号(字母 a-z 对应序号 1-26,不分大小写)相加,得到整数 N,然后再分析一下 N 的二进制表示中有多少 0、多少 1。例如给定字符串 PAT (Basic),其字母序号之和为:16+1+20+2+1+19+9+3=7 ...
分类:编程语言   时间:2021-04-19 16:06:23    阅读次数:0
C for,while,do while 代码实现
这里用go to 来模拟汇编他们的区别 while 代码 int i = 0; while (i < 100) { i++; } goto 实现while int i = 0; WHILE_BEGIN: if (i < 100) { goto WHILE_END; } i++; goto WHILE ...
分类:其他好文   时间:2021-04-19 15:45:52    阅读次数:0
POJ1631 - Bridging signals - LIS优化 - 二分+dp - nlogn
##题意 求最长上升子序列长度 ##思路 本题直接用dp写,会超时,需要优化 优化办法:二分+dp ##AC代码 //4test n //6 p //4 2 6 3 1 5 ->3 //10 //2 3 4 5 6 7 8 9 10 1 ->9 //8 //8 7 6 5 4 3 2 1 ->1 / ...
分类:其他好文   时间:2021-04-19 14:47:09    阅读次数:0
HDU1160 - FatMouse's Speed - 最长上升子序列的变形+记录路径
##思路 最长上升子序列的变形+记录路径 ##AC代码 #include<iostream> #include<cmath> #include<string.h> #include<algorithm> #include<stdio.h> #include<iomanip> #define inf ...
分类:其他好文   时间:2021-04-19 14:43:51    阅读次数:0
变量,元字符,流程判断if,while、for循环
一: shell编程介绍 1、一个shell脚本运行必须要拥有r和x权限; chamod u+x 1.txt 2、运行一个shell脚本的3个步骤: (1)启动bash解释器 (2)bash把文件内容从硬盘读入内存 (3)bash把读入到内存的内容进行语法解释,控制操作系统执行shell代码 写脚本 ...
分类:其他好文   时间:2021-04-16 12:25:54    阅读次数:0
模拟cpu/mem/io使用率
模拟cpu使用率 脚本: 可以将1个cpu-core打满 k.c #include <stdlib.h> int main() { while(1); return 0; } gcc -o out k.c ./out 查看top可以看到将1个cpu-core打满,可以根据需要,并发启动多个进程将多个 ...
分类:其他好文   时间:2021-04-16 12:03:28    阅读次数:0
nginx响应超时upstream timed out (110: Connection timed out) while reading response header from upstream
问题描述后台server服务响应时间正常,但是请求没有打到服务器,在nginx很慢才看到error日志,如下: 2018/07/26 10:17:42 [error] 45762#0: *7489 upstream timed out (110: Connection timed out) whil ...
分类:其他好文   时间:2021-04-15 12:25:45    阅读次数:0
Cannot deserialize instance of `java.util.ArrayList<org.jeecg.modules.face.entity.FaceDevice>` out of START_OBJECT token
远程调用出现json解析异常 操作失败,Error while extracting response for type [java.util.List<org.jeecg.modules.face.entity.FaceDevice>] and content type [application/ ...
分类:编程语言   时间:2021-04-14 12:42:30    阅读次数:0
单向链表为什么要用一个辅助变量遍历
对于链表添加操作,假如不考虑按序号添加,则可以写一个简单的方法: public void add(HeroNode heroNode) { //因为head节点不能动,因此我们需要一个辅助变量遍历 HeroNode temp = head; //遍历链表,找到最后 while (true) { // ...
分类:其他好文   时间:2021-04-14 12:35:54    阅读次数:0
29426条   上一页 1 ... 18 19 20 21 22 ... 2943 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!