cocohkx
码龄7年
关注
提问 私信
  • 博客:19,026
    19,026
    总访问量
  • 20
    原创
  • 1,485,457
    排名
  • 0
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:浙江省
  • 毕业院校: 浙江大学
  • 加入CSDN时间: 2017-11-30
博客简介:

kocoro的博客

查看详细资料
个人成就
  • 获得12次点赞
  • 内容获得3次评论
  • 获得29次收藏
创作历程
  • 3篇
    2023年
  • 17篇
    2022年
成就勋章
TA的专栏
  • Pat
    16篇
  • 计算机网络
    1篇
  • 算法
    1篇
  • c++基础知识
    1篇
创作活动更多

如何做好一份技术文档?

无论你是技术大神还是初涉此领域的新手,都欢迎分享你的宝贵经验、独到见解与创新方法,为技术传播之路点亮明灯!

351人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

浙江大学计算机与软件学院2021年考研复试上机

优化的思想是对每次遍历之前进行循环判定,只有最长的木棍max截断后短的那根记为l1,要求max/3+1
原创
发布博客 2023.03.03 ·
238 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1080 Graduate Admission 测试点1,2

测试点1,2
原创
发布博客 2023.02.04 ·
164 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1001 A+B Format测试点3,5,6,10,11

测试点3,5,6,10,11
原创
发布博客 2023.02.02 ·
206 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

主机访问域名的过程

访问DNS域名服务器,已知域名服务器IP地址,需要知道域名服务器的MAC地址,主机广播ARP请求分组(目的MAC为全1),域名服务器与主机在一个局域网内,域名服务器收到ARP请求分组以后,对比目的IP是自己的IP地址,就发出一个单拨ARP响应分组,携带了自己的MAC地址。主机收到响应后,以客户机的身份向本地域名服务器发送DNS请求报文,本地域名服务器先是查询有两种方法查询域名对应的IP地址,分别是递归查询和递归与迭代查询,本地域名服务器将查询结果存储在本地缓存中,并返回给主机。查询www的MAC地址。...
原创
发布博客 2022.07.30 ·
4424 阅读 ·
3 点赞 ·
2 评论 ·
13 收藏

1074 Reversing Linked List 测试点5、6

测试点5:每k个反转一次,不足k的不反转。错误原因:只有第一组k个反转了,而后的几组都没反转测试用例:00100 6 200000 4 9999900100 1 1230968237 6 -133218 3 0000099999 5 6823712309 2 33218输出12309 2 0010000100 1 0000000000 4 3321833218 3 6823768237 6 9999999999 5 -1测试点6:错误原因:有些节点不在头节点指
原创
发布博客 2022.02.28 ·
726 阅读 ·
2 点赞 ·
0 评论 ·
0 收藏

关键路径、最长路径

测试用例:6 80 1 30 2 20 3 22 3 51 4 33 5 22 5 34 5 1关键路径一定是有向无环图代码段#include <cstdio>#include <cstring>#include <iostream>#include <math.h>#include <stdio.h>#include <algorithm>#include <stdlib.h>
原创
发布博客 2022.02.27 ·
1013 阅读 ·
1 点赞 ·
0 评论 ·
0 收藏

拓扑排序 c++

#include <cstdio>#include <cstring>#include <iostream>#include <math.h>#include <stdio.h>#include <algorithm>#include <stdlib.h>#include <map>#include <vector>#include <set>#include <.
原创
发布博客 2022.02.27 ·
543 阅读 ·
1 点赞 ·
0 评论 ·
1 收藏

最长公共子串 字符串hash法

算法笔记P450#include <cstdio>#include <cstring>#include <iostream>#include <math.h>#include <stdio.h>#include <algorithm>#include <stdlib.h>#include <map>#include <vector>#include <set>#i
原创
发布博客 2022.02.25 ·
328 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

素数的判定

素数:只能被自己或者1整除的正整数,1不属于素数方法一:bool isPrime(int n){ if(n<=1) return false; int sqr = (int)sqrt(1.0*n); for(int i=2;i<=sqr;i++){ if(n%i==0) return false; } return true;}方法二:过筛法...
原创
发布博客 2022.02.12 ·
302 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

进制转换c++

十进制的转换int d[100];void change10ToOther(int n,int radix)//radix为目标进制{ int len =0; do{ d[len++] = n%radix; n/=radix; }while(n!=0);}//转换后的逆序存储转换为十进制int otherTo10(int n[] ,int radix){ //若输入为顺序的n int len =
原创
发布博客 2022.02.12 ·
972 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

c++中map的用法

map简单来说就是实现a到b的映射,可以自定义不同变量类型的映射头文件:#include<map>using namespace std;1. map的定义map<typename1,typename2> mp;注:字符串数组只能用string映射,不能用char数组2. map访问,与访问数组类似,直接用map[键值]访问,map中所有的键值是唯一的map<char,int> mp;mp['c'] = 20;printf("%d"
原创
发布博客 2022.02.06 ·
2100 阅读 ·
1 点赞 ·
0 评论 ·
5 收藏

1075 PAT Judge 测试点四

测试点四试了很多次是因为排序问题,把不能输出的和可以输出的记录一起排序,这里修改一下排序算法就ok了参考了知乎的文章【PAT A1075】PAT Judge(详细解决测试点4!) - 知乎 (zhihu.com)int full[10]={0};bool cmp (Student a,Student b){ if(a.total!=b.total) return a.total>b.total; else if(a.fullCount!=b.fullCount) return a.
原创
发布博客 2022.01.28 ·
889 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

c++中sort函数

头文件:#include <algorithm>using namespace std;函数://sort(数组首地址,数组尾地址+1,比较函数cmp(可省略))char a[10];sort(a,a+10,cmp);cmp比较函数伪代码bool cmp(元素A 元素B){ if(A!=B) return A>B //按元素递增次序排序}字符串比较函数strcmp#include <cstring>strcmp(char
原创
发布博客 2022.01.25 ·
273 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

一个数组复制给另一个数组 c++

#include <cstring>strcpy(目的数组, 源数组);
原创
发布博客 2022.01.25 ·
2229 阅读 ·
2 点赞 ·
1 评论 ·
6 收藏

输入 空格的陷阱

不可读入空格 char a[300]; scanf("%s",a);// 不能输入空格,即到输入到空格即止可以读入空格 char a; scanf("%c", a) //可以输入空格,和换行,注意不读入换行和空格时要用getchar()吸收 char a[300]; gets(temp); //可以输入空格,到换行即止 //注意 在pat中gets不兼容,要用cin.getline(a,size);.
原创
发布博客 2022.01.25 ·
709 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

int与char相互转换 c++

char -> intchar a= '1';int b= a - '0'; int -> char itoa函数(数字,字符串地址,进制)#include<iostream>#include<string>using namespace std;int main(){ int a = 123; char str[100]; itoa(a, str, 10); cout << str << e
原创
发布博客 2022.01.23 ·
3199 阅读 ·
2 点赞 ·
0 评论 ·
3 收藏

1065 A+B and C (64bit) 溢出问题

Given three integersA,BandCin( -,), you are supposed to tell whetherA+B>C.Input Specification:The first line of the input gives the positive number of test cases, T (≤10). Then T test cases follow, each consists of a single line containing ...
原创
发布博客 2022.01.15 ·
121 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1046 Shortest Distance 超时问题

The task is really simple: givenNexits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specification:Each input file contains one test case. For each case, the first line conta...
原创
发布博客 2022.01.14 ·
168 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1042 Shuffling Machine

dssdsShuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by performing inadequate shuffles, many casinos
原创
发布博客 2022.01.14 ·
89 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1018 锤子剪刀布 scanf(“%c“,&a)的陷阱

Pat
原创
发布博客 2022.01.14 ·
263 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多