摘要: 欧拉筛法 1 vector<int> Prime(int n){ // 求解n以内(含n)的素数 2 bool flag[n + 1]; // 标记数组,flag[i]==0表示i为素数,flag[i]==1表示i为合数 3 memset(flag, 0, sizeof(flag)); 4 vect 阅读全文
posted @ 2022-09-03 19:17 剩下的交给时间就好 阅读(3) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/shifting-letters-ii/ 1 class Solution { 2 public: 3 string shiftingLetters(string s, vector<vector<int>>& shifts) { 4 int 阅读全文
posted @ 2022-09-03 19:09 剩下的交给时间就好 阅读(3) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/shu-zu-zhong-de-ni-xu-dui-lcof/ 逆序对 区间更新+lazy标记 单点更新+无lazy标记 https://www.luogu.com.cn/problem/P3372 区间更新+lazy标记 离散化核心 用有序 阅读全文
posted @ 2022-08-20 17:37 剩下的交给时间就好 阅读(3) 评论(0) 推荐(0) 编辑
摘要: ps 可以一次性给出当前系统中进程状态,但使用此方式得到的信息缺乏时效性 ps工具标识进程的5种状态码: D 不可中断 uninterruptible sleep (usually IO) R 运行 runnable (on run queue) S 中断 sleeping T 停止 traced 阅读全文
posted @ 2022-05-16 14:10 剩下的交给时间就好 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 服务器demo 测试路由 浏览器url输入不能测试POST请求!!!看清楚是get请求再测 login:1 GET http://127.0.0.1:8080/douyin/user/login 404 (Not Found) 2. 修改完代码要马上重启服务 3. 这是一个结构体(go里省略分号), 阅读全文
posted @ 2022-05-16 13:10 剩下的交给时间就好 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 第三次课 运行main.go之和终端输入 go tool pprof -http=:8080 "http://localhost:6060/debug/pprof/goroutine" 浏览器访问 http://127.0.0.1:6060/debug/pprof/ 运行main.go之和终端输入 阅读全文
posted @ 2022-05-16 13:09 剩下的交给时间就好 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 第二次课 项目里会报错gin,先安装gin框架,之后根据代码波浪线提示导入代码,删除import里多余的代码。 命令行 curl 127.0.0.1:8080/community/page/get/1 应该是我给项目文件夹配置了GOPATH,GoLand编译器里也可以用curl了 浏览器输入 htt 阅读全文
posted @ 2022-05-16 13:09 剩下的交给时间就好 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 第一次课 猜数游戏 input = strings.TrimSuffix(input, "\r\n") // windows 环境下需要\r\n 在线词典 报错 Did you press "Copy as cURL (cmd)" instead of "Copy as cURL (bash)"? 阅读全文
posted @ 2022-05-16 13:08 剩下的交给时间就好 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 环境变量配置 GoROOT是go的安装包,GOPATH是项目路径,比如hello.go所在项目的路径 工程结构是 project bin pkg src main.go bin是输出目录,src是工作目录 代码里注意package main 1 package main 2 3 import "fm 阅读全文
posted @ 2022-04-29 12:01 剩下的交给时间就好 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 547. 省份数量 - 力扣(LeetCode) (leetcode-cn.com) 1 class Solution { 2 public: 3 vector<int>father; 4 int find(int x){ 5 if(father[x]==x) 6 return x; 7 retur 阅读全文
posted @ 2022-04-25 10:19 剩下的交给时间就好 阅读(12) 评论(0) 推荐(0) 编辑