摘要: 题目描述 检查一个如下的6 x 6的跳棋棋盘,有六个棋子被放置在棋盘上,使得每行、每列有且只有一个,每条对角线(包括两条主对角线的所有平行线)上至多有一个棋子。 上面的布局可以用序列2 4 6 1 3 5来描述,第i个数字表示在第i行的相应位置有一个棋子,如下: 行号 1 2 3 4 5 6 列号 阅读全文
posted @ 2023-04-21 23:12 fun-debug 阅读(25) 评论(0) 推荐(0) 编辑
摘要: string string toupper(),将string字符串中的字符转为大写字符 string s="SADfdfsf"; s[i]=toupper(s[i]); tolower(),将string字符串中的字符转为小写字符 string s="SADfdfsf"; s[i]=toupper 阅读全文
posted @ 2023-04-21 23:06 fun-debug 阅读(4) 评论(0) 推荐(0) 编辑
摘要: C语言函数 floor函数 向下取整 floor(x) 返回的是x的整数部分。如: floor(2.5) = 2 floor(-2.5) = -3 ceil函数 向上取整ceil(x)返回的是不小于x的最小整数。如:ceil(2.5) = 3 ceil(-2.5) = -2 round(x) 返回x 阅读全文
posted @ 2023-04-21 23:06 fun-debug 阅读(12) 评论(0) 推荐(0) 编辑
摘要: stack() 头文件#include <stack> 函数 empty() 堆栈为空则返回真 pop() 移除栈顶元素 push() 在栈顶增加元素 size() 返回栈中元素数目 top() 返回栈顶元素 阅读全文
posted @ 2023-04-21 23:06 fun-debug 阅读(1) 评论(0) 推荐(0) 编辑
摘要: math.h数学函数 pow(<T> x,<T> y)//x的y次方 阅读全文
posted @ 2023-04-21 23:06 fun-debug 阅读(2) 评论(0) 推荐(0) 编辑
摘要: stack.peek()和stack.pop(); 相同点:大家都返回栈顶的值。 不同点:peek 不改变栈的值(不删除栈顶的值),pop会把栈顶的值删除。 阅读全文
posted @ 2023-04-21 23:06 fun-debug 阅读(21) 评论(0) 推荐(0) 编辑
摘要: greater和less的用法 greater使内置类型从大到小排序,而less从小到大 注意: sort用greater排序,则a[0]到a[n]有大到小排序。 priority_queue用greater排序,则先取出的是最小值。 295.数据流的中位数 中位数是有序列表中间的数。如果列表长度是 阅读全文
posted @ 2023-04-21 23:05 fun-debug 阅读(98) 评论(0) 推荐(0) 编辑
摘要: vector的remove和erase区别 erase: erase函数可以用于删除vector容器中的一个或者一段元素,在删除一个元素的时候,参数上的指针会指向原来的位置 iterator erase(iterator position); iterator erase(iterator firs 阅读全文
posted @ 2023-04-21 23:05 fun-debug 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 双指针总结 快慢指针 类似于龟兔赛跑,两个链表上的指针从同一节点出发,其中一个指针前进速度是另一个指针的两倍。利用快慢指针可以用来解决某些算法问题,比如 计算链表的中点:快慢指针从头节点出发,每轮迭代中,快指针向前移动两个节点,慢指针向前移动一个节点,最终当快指针到达终点的时候,慢指针刚好在中间的节 阅读全文
posted @ 2023-04-21 23:03 fun-debug 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 不定长字符串的输入,保存 对于输入一行随意大小的字符串求其长度并输入指定位上字符,用C++可以编程为: #include<iostream> #include<string> #include<cstring> using namespace std; int main(){ int len; st 阅读全文
posted @ 2023-04-21 23:02 fun-debug 阅读(274) 评论(0) 推荐(0) 编辑
摘要: substr()详解 #include<string> #include<iostream> using namespace std; int main() { string s("12345asdf"); string a = s.substr(0,5); //获得字符串s中从第0位开始的长度为5 阅读全文
posted @ 2023-04-21 23:01 fun-debug 阅读(89) 评论(0) 推荐(0) 编辑
摘要: kubeadm reset -f modprobe -r ipip rm -rf ~/.kube/ rm -rf /etc/kubernetes/ rm -rf /etc/systemd/system/kubelet.service.d rm -rf /etc/systemd/system/kube 阅读全文
posted @ 2023-04-21 23:01 fun-debug 阅读(109) 评论(0) 推荐(0) 编辑
摘要: keras_preprocessing.image.image_data_generator.ImageDataGenerator.flow_from_directory() 获取目录路径并生成一批增强数据。 def flow_from_directory(self, directory: Any, 阅读全文
posted @ 2023-04-21 22:27 fun-debug 阅读(89) 评论(0) 推荐(0) 编辑
摘要: keras图片生成器ImageDataGenerator keras.preprocessing.image.ImageDataGenerator(featurewise_center=False, samplewise_center=False, featurewise_std_normaliza 阅读全文
posted @ 2023-04-21 22:27 fun-debug 阅读(127) 评论(0) 推荐(0) 编辑
摘要: wsl(ubuntu20.04)+docker安装paddle 1.中文显示设置 安装语言包 sudo apt install language-pack-zh-hans 设置locale sudo vi /etc/locale.gen 找到 zh_CN.UTF-8 UTF-8 并取消注释,然后保存 阅读全文
posted @ 2023-04-21 22:26 fun-debug 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 1并行数据库 为什么要分片 如何分片 垂直分片 水平分片 主键水平分片 衍生水平分片 混合分片 分多少片 如何测试正确性 完整性 关系R分解为片段R1, R2,…,当且仅当R中的每个数据项也可以在某个Ri中找到时,Rn是完备的 重构行 如果关系R被分解为片段R1, R2,…, Rn,那么应该存在某种 阅读全文
posted @ 2023-04-21 22:24 fun-debug 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 一、Linux系统用户账号管理 1、添加新的用户账号 useradd [options] [username] 参数说明: options: -c comment 指定一段注释性描述。 -d 目录 指定用户主目录,如果此目录不存在,则同时使用-m选项,可以创建主目录。 -g 用户组 指定用户所属的用 阅读全文
posted @ 2023-04-21 22:23 fun-debug 阅读(40) 评论(0) 推荐(0) 编辑
摘要: Docker保存镜像 1.保存容器更改 将容器修改的内容保存为镜像 docker commit app docker在提交容器更改时可以附加提交信息,方便查询 docker commit -m "first init app" 2.镜像命名 通过docker tag命令可以对未命名的镜像命名,也可以 阅读全文
posted @ 2023-04-21 22:18 fun-debug 阅读(18) 评论(0) 推荐(0) 编辑