!-- 自定制样式文件 -->
摘要: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#include <set>#include <queue> 阅读全文
posted @ 2020-08-19 11:08 XzhouxxX 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 子串 str.substr(3); //返回 [3] 及以后的子串 str.substr(2, 4); //返回 str[2]~str[2+(4-1)] 子串(即从[2]开始4个字符组成的字符串) 替换 str.replace(2, 4, "sz");//返回把 [2]~[2+(4-1)] 的内容替 阅读全文
posted @ 2020-08-19 10:32 XzhouxxX 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 一个要用连通块和bfs做的题,如果他的上下左右有零的话则不是 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include 阅读全文
posted @ 2020-08-14 21:50 XzhouxxX 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 只要把他压进一个队列里就没多大问题了 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#inclu 阅读全文
posted @ 2020-08-12 21:25 XzhouxxX 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 水题,不用讲 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stack>#include <map>#include <set>#inc 阅读全文
posted @ 2020-08-12 21:21 XzhouxxX 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 这个水题竟然是普及组的。。。 首先要用到结构体,要写一个结构体必用的cmp函数。 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#include <stac 阅读全文
posted @ 2020-08-12 21:13 XzhouxxX 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 首先取出这个项链的长度x,如果他是回文数的话让项链减去一半,x减去一半,如果他不是回文数,就退出循环 上代码: #include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>#inc 阅读全文
posted @ 2020-08-12 20:50 XzhouxxX 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 首先知道路径,房顶的位置是下,x和y。 每个人上船要1分钟,下船要0.5分钟,路程是没分钟50米,要计算来回时间 公式:s+=sqrt(x*x+y*y)/50+a*1+sqrt(x*x+y*y)/50+a*0.5 上代码: #include <iostream>#include <cstdio>#i 阅读全文
posted @ 2020-08-12 10:13 XzhouxxX 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1代表百合花 0代表不能走 意思是这样的: 看一看a[i+b]是不是1,是1的话让青蛙移到这个位置上,i=i+x,进行下一步,如果不是的话让x--,看上一个是不是1 如果是的,再按d来走,x=d 上代码: #include <iostream>#include <cstdio>#include <c 阅读全文
posted @ 2020-08-11 21:42 XzhouxxX 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 题目描述 现有nn个正整数,n≤10000n≤10000,要求出这nn个正整数中的第kk个最小整数(相同大小的整数只计算一次),k≤1000k≤1000,正整数均小于3000030000。 输入格式 第一行为nn和kk; 第二行开始为nn个正整数的值,整数间 用空格隔开。 输出格式 第kk个最小整数 阅读全文
posted @ 2020-08-05 21:21 XzhouxxX 阅读(266) 评论(0) 推荐(0) 编辑