自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 Unix时间戳转换成日期

C语言实现timestamp时间戳与可读时间转换

2023-09-03 09:51:03 379

原创 高效C++ Effective C++

Effective C++ 55条

2022-11-20 22:02:01 743

原创 C++多线程

C++多线程和mutex简单介绍和示例

2022-11-19 14:56:57 583

原创 CORDIC

CORDIC算法的C语言实现

2022-07-16 13:13:45 315

原创 方阵原地转置(C语言)

假设一个方阵按行优先储存在一维数组matrix中,将其原地转置:void SqrMaTranspose(double * matrix, int n){ double temp = 0.0; for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){ temp = matrix[i*n+j]; matrix[i*n+j] =

2022-04-06 09:57:22 456

原创 蒙特卡洛模拟-蚂蚁爬格子

An ant is trying to get from pointAto pointBin a grid; see Figure 2. The coordinates of pointAis(1,1)(this is top left corner), and the coordinates of pointBis(n,n)(this is bottom right corner,nis the size of the grid).Once the ant starts m...

2022-03-04 10:06:59 492

原创 C语言伪随机序列生成函数Pseudo-random sequence generation functions

C语言标准ISO/IEC 9899中的说明:1. The rand functionSynopsis#include<stdlib.h>int rand(void);DescriptionThe rand function computes a sequece of pseudo-random integers in the range 0 to RAND_MAX.rand函数生成大小在0到RAND_MAX之间伪随机整数序列。The rand function i

2022-03-03 10:39:50 987

原创 Leetcode第647题 回文子串(中心扩展法+Manacher算法)

/* Leetcode第647题 回文子串 *给定一个只由小写英文字母组成的字符串s, 统计并返回这个字符串中回文子串的数目。 *子字符串是字符串中的由连续字符组成的一个序列。 *具有不同开始位置或结束位置的子串,即使是由相同的字符组成,也会被视作不同的子串。 *示例:输入s="aaa",输出6,6个回文子串为"a","a","a","aa","aa","aaa" */ #include<iostream> #include&...

2022-02-24 21:56:31 186

原创 LeetCode第1996题 游戏中弱角色的数量(C++)

#include<iostream>#include<algorithm>#include<vector>using namespace std;class Solution{ public: int numberOfWeakCharacters(vector<vector<int>>& properties){ int res = 0; sort(properties.beg...

2022-01-28 13:36:44 2612

原创 DCT离散余弦变换(C语言)

MATLAB Image Processing Toolbox中自带有dct2函数实现离散余弦变换,帮助文档解释如下:C语言版本实现如下:/*Remind: The caller must call free to release memory !!!*/#include<stdlib.h>#include<math.h> //必须使用math库#define PI acos(-1) //预定义PI值,C语言没有自带PIfloat ** dct2

2022-01-27 16:44:32 853 1

原创 按字节输出int类型变量(C语言)

#include<stdio.h>int main(void){ int a = -12; int mSize = sizeof(a); printf("a=%d, sizeof(a)=%d.\n", a, mSize); printf("size of int is %ld.\n", sizeof(int)); unsigned char *p = (unsigned char*) &a; //一定要用unsigned char * !!!.

2022-01-26 19:53:56 2692

原创 LeetCode第378题 有序矩阵中第K小的元素

LeetCode第378题 有序矩阵中第K小的元素

2022-01-21 14:33:20 353

原创 C++类的理解

C++类的关键概念理解

2022-01-20 11:09:49 564

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除