自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 MAC OpenGL报错

MAC OpenGL报错

2022-07-21 12:36:26 501 1

原创 ffmpeg安装

在ffmpeg安装中碰到两种报错

2022-06-26 10:55:45 1957

原创 Pytorch3D环境血泪安装史

避免一些列pytorch3d导致的依赖冲突

2022-06-25 20:29:24 1322 1

原创 路径追踪原理及实现

路径追踪(Path Tracing)原理及实现一. 渲染方程Lo(p,wo)=Le(p,wo)+∫ΩLi(p,wi)fs(p,wi,wo)(n⋅wi)dwiL_o(p,w_o) = L_e(p,w_o) + \int_\Omega{L_i(p,w_i)f_s(p,w_i,w_o)(n\cdot w_i)dw_i}Lo​(p,wo​)=Le​(p,wo​)+∫Ω​Li​(p,wi​)fs​(p,wi​,wo​)(n⋅wi​)dwi​其中Le(p,wo)L_e(p,w_o)Le​(p,wo​)​表示自

2021-11-22 21:37:47 2054

原创 数字图像处理绪论

数字图像处理绪论1. 数字图像数字图像是一个二元函数f(x,y)f(x,y)f(x,y)​,且x,yx,yx,y​和fff​值都是离散的。同时数字图像也是一个(x,y,f)(x,y,f)(x,y,f)的三元组集合,每个元素被称为像素。2. 图像处理vs图像分析vs计算机视觉初级->中级->高级3. 数字图像处理技术应用领域从目标分类:人类解译:图像增强,复原等机器感知:计算机从图像中提取信息从图像源分类:声波,电子束,计算机成像4.图像处理系统...

2021-07-26 20:47:13 112

原创 201604-4 游戏

#include <iostream>using namespace std;const int N = 1010;bool in[N];bool isk(int num, int k){ return num % k == 0 || num % 10 == k;}int main() { int n,k; cin >> n >> k; for (int i = 0; i < n; i++) {

2021-07-19 17:30:39 87 1

原创 201809-2 买菜

双指针问题#include <iostream>#define N 2010using namespace std;int a[N];int b[N];int c[N];int d[N];int cal(int ai, int bi, int ci, int di){ if(di <= ai || bi <= ci){ return 0; } else if(ai <= ci && di <= bi)

2021-07-19 01:07:25 95

原创 201903-2 二十四点

先算乘除法,再算加减法,将计算过的操作符和左右操作数进行删除#include <cstdio>#define N 510using namespace std;int num[4];char oper[3];int cal(int a , int b, char t){ if(t == '+'){ return a +b; } else if(t == '-'){ return a -b; } else if(t == '

2021-07-19 00:13:20 66

原创 202009-2 风险人群筛查

复杂的n*t#include <iostream>using namespace std;int sum[2];int main() { int n,k,t,xl,yd,xr,yu; cin >> n >> k >> t >>xl >>yd >>xr >> yu; for (int i = 0; i < n; i++) { bool flag =

2021-07-17 20:12:51 72

原创 202006-2 稀疏向量

注意数据内积可能溢出,需要使用long long#include <iostream>#include <unordered_map>using namespace std;int main() { int n,a,b; cin >> n >> a >>b; unordered_map<int,int> a_map; int index,value; for (int i = 0

2021-07-17 19:49:15 205

原创 201912-2 回收站选址

暴力解法#include <iostream>#define N 1010using namespace std;int x[N];int y[N];int stat[5];int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } int flag,score;

2021-07-17 18:57:41 60

原创 201604-1 折点计数

#include <iostream>using namespace std;int box[1010];int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> box[i]; } int count = 0; for (int i = 0; i < n; i++) { if(i !=

2021-07-16 19:34:16 65

原创 202006-1 线性分类器

202006-1 线性分类器#include <iostream>#include <vector>#define N 1010using namespace std;int x[N];int y[N];int t[N]; // A 0; B;1int main() { int n , m; cin >> n >>m; for (int i = 0; i <n ; i++) { stri

2021-07-16 17:58:40 76

原创 2021-05-22

Eslint Vscode 新版自动格式化{ //autoFixedOnSave 设置已废弃,采用如下新的设置 "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "eslint.format.enable": true, //autoFix默认开启,只需输入字符串数组即可 "eslint.validate": ["javascript", "vue", "html"]}...

2021-05-22 15:42:09 53

转载 Pytorch Dataset构造-example

A detailed example of how to generate your data in parallel with PyTorchBy Afshine Amidi and Shervine AmidiMotivationHave you ever had to load a dataset that was so memory consuming that you wished a magic trick could seamlessly take care of that? Large

2021-03-18 21:29:09 380

原创 Pytorch 训练CIFAR10数据集分类器-example

Pytorch 训练CIFAR10数据集分类器-example项目来源于 pytorch官网项目主要分为下面5个步骤:Load and normalizing the CIFAR10 training and test datasets using torchvision 加载数据Define a Convolutional Neural Network 定义卷积神经网络类Define a loss function 定义损失函数Train the network on the trainin

2021-03-18 16:59:59 563

原创 直方图均衡化及其matlab实现

直方图均衡化(histogram equalization)一. 原理直方图均衡化是想要将聚集在某一区间内分布的灰度值,变为均匀的在所有区间内分布。为了达到这一目的,我们需要找出一个函数T,将r(原图像灰度)映射到s(新图像灰度)上。同时,由于不想将图像反转,我们需要保证函数单调不减(若需要逆运算,则要严格单调递增)s=T(r)s=T(r)s=T(r)设pr(r)p_r(r)pr​(r)为r的概率分布函数,ps(s)p_s(s)ps​(s)为s的概率分布函数,则两者关系如下ps(s)=pr(

2020-12-22 13:51:00 6286 2

原创 201709-2 公共钥匙盒

201709-2 公共钥匙盒一. 原理模拟题,按照一定标准排序二. 代码#include <iostream>#include <algorithm>#include <vector>using namespace std;struct op{ int key_id; int time; int choice;//0 back ;1 fetch op(int key_id,int time,int choice):key

2020-12-11 21:22:48 59

原创 201709-1 打酱油

201709-1 打酱油一. 原理递归求解二. 代码#include <iostream>#include <algorithm>using namespace std;int re(int count){ if(count >= 5){ int three = re(count-3)+1; int five = re(count-5)+2; return max(three,five); }e

2020-12-11 20:53:12 71

原创 201912-2 化学方程式

#include <iostream>#include <string>#include <map>#include <sstream>#include <vector>#include <algorithm>using namespace std;void add(map<string,int>& mymap,string temp,int add_num){ map<string

2020-12-11 20:42:03 131

转载 MacOS管理多版本jdk

MacOS管理多版本jdk一. 环境变量介绍首先,是对 MAC OS 配置环境变量的路径和配置文件的相关介绍~1. 要清楚什么是根目录?什么是用户主目录?这两者是完全不一样的!" / " : 根目录" ~ " : 用户主目录cd / : 跳转到根目录 -> /cd ~/: 跳转到用户主目录 -> /Users/你的用户名2. MacOS配置环境变量的文件有6个(按照加载顺序排序)1)系统级环境变量(/etc)/etc/profile : 全局(公有)配置, 建议不

2020-11-30 19:33:59 276

原创 202009-3 点亮数字人生

#include <cstdio>#include <vector>#include <queue>#include <string>#include <stack>using namespace std;struct node{ int id; int type;//input 0//NOT 1 非//AND 2 与//OR 3 或//XOR 4 异或//NAND 5 与非(先全部与后取非)

2020-11-27 16:51:53 164

原创 AC自动机

AC自动机一. 原理AC自动机是在Trie树上构建的,比Trie树要多一个失配时的失败指针。构建失败指针需要树的广度遍历。每个节点(curr)的fail 指针,是跟前其父节点的fail指针构建的。如果父节点(father)失败指针指向的节点,它(father.fail)的孩子里有当前节点(curr)的字符,则curr的失败指针指向father.fail的与curr字符匹配的孩子如果父节点(father)失败指针指向的节点,它(father.fail)的孩子里没有当前节点(curr)的字符,则继

2020-11-25 22:36:53 82

原创 Trie 前缀树原理及两种实现

Trie 前缀树一. 介绍前缀树,能用图解决问题的,就不是问题如图所示:前缀树,可以用来表示一个字符串集合。图中字符串集合的全集S为{t,A,i,to,te,tea,ted,ten,in,inn}。代表字符的为树的边,节点表示整个字符串,一个树就代表字符串集合。(树中可以有一个标志位,用来表示,该节点下的字符串是否为所定义集合中的字符串。此时,这个树就可以表示为上面S全集的子集。)原理上很简单,而实现的时候,主要是对树的存储和操作(插入&搜索)。1. 插入(insert)对于tri

2020-11-24 22:01:56 230

原创 201812-4 数据中心

#include <iostream>#include <vector>#include <queue>#include <map>//#define N 100using namespace std;struct node{ int s; int e; int dist; node(int s,int e,int dist):s(s),e(e),dist(dist){}};struct cmp{

2020-11-15 19:52:59 99

原创 JPEG无损压缩流程及简单实现

JPEG无损压缩一. 前言续接JPEG有损压缩流程实现接下来简单实现一下无损压缩的主要思想二. 流程无损压缩使用的逻辑是“预测”。由于“量化”一步骤是有损压缩中导致主要误差的一部分,因此在无损压缩中,不能够使用“量化”增大某些数值的出现频率。但是没关系,总有聪明人解决问题。无损压缩以记录误差的方式,代替真正的图像数值。无损压缩根据已知的像素点,对当前像素点的值进行预测,进而计算预测值与真实值之间的误差,并进行记录。在解压缩的时候,通过预测值减去误差,得到真实值。我们再对误差进行编码,此时误

2020-11-15 09:33:41 3030 1

原创 JPEG的简单流程实现

JPEG——分割,DCT,量化流程一. 前言近期在Coursera上了一门图像处理的课程 ”Image and Video Processing: From Mars to Hollywood with a Stop at the Hospital“目前在学习第二章图像压缩的相关内容,其中比较详细的讲到了JPEG标准的处理流程,于是自己就尝试实现用matlab了一下。二. 流程(一)灰度图像压缩要对一个仅有灰度通道的图片进行JPEG标准压缩,首先需要先进行预处理:将图片以8*8的形式进行分割

2020-11-14 22:23:14 962 1

原创 201809-2 买菜

201809-2 买菜双指针问题,分别两个指针指向两个数组,判断重叠。并根据两者的end时间,判断哪个指针向后移代码#include <iostream>#include <vector>#include <math.h>using namespace std;struct node{ int s; int e;};int main(){ int n; cin>>n; vector<

2020-11-04 19:50:35 45

原创 程序对拍

程序对拍一. 对拍程序对拍就是使用暴力解的结果和其他解的结果进行对比。这里需要三种程序:1. 随机生成数据的程序;2. 其他解程序; 3. 暴力解程序@echo off :loop create.exe > in.txt main.exe < in.txt > myout.txt test.exe < in.txt > stdout.txt fc myout.txt stdout.txtif not errorlevel 1 got

2020-11-03 17:21:56 135

原创 201812-2 小明放学

201812-2 小明放学测试数据30 3 3080 101 50 112 20 60 33 100 3这道题最开始的时候一直是30分,问题在:在处理三种情况时,没有将循环一圈后,又回到相同的灯的情况算上。初始状态为绿灯,到时候有可能是g,y,r。如果为g的情况,有可能是循环了一圈又回到g的情况;也有可能是没有循环,灯还没来得及变的情况。同理,红灯和黄灯也是相同。所以,实际上每个灯下需要处理的为4种情况。代码:#include <iostream>usi

2020-11-03 17:11:58 78

原创 201909-4 推荐系统

201909-4 推荐系统(自用,记录)测试样例2 31 32 23 183 100 1 11 0 4 33 10 2 23 10 1 12 0 13 2 1 13 1 1 1没有分,不支持c++11,用不了unordered_map#include <iostream>#include <vector>#include <unordered_map>#include <algorithm>#include <q

2020-11-01 20:52:53 102

原创 排队游戏

排队游戏总时间限制: 1000ms 内存限制: 65536kB描述在幼儿园中,老师安排小朋友做一个排队的游戏。首先老师精心的把数目相同的小男孩和小女孩编排在一个队列中,每个小孩按其在队列中的位置发给一个编号(编 号从0开始)。然后老师告诉小朋友们,站在前边的小男孩可以和他后边相邻的小女孩手拉手离开队列,剩余的小朋友重新站拢,再按前后相邻的小男孩小女孩手拉 手离开队列游戏,如此往复。由于教师精心的安排,恰好可以保证每两个小朋友都能手拉手离开队列,并且最后离开的两个小朋友是编号最小的和最大的两个小朋 友。

2020-10-30 17:19:10 662 1

原创 扩号匹配问题(递归与非递归)

扩号匹配问题总时间限制: 1000ms 内存限制: 65536kB描述在某个字符串(长度不超过100)中有左括号、右括号和大小写字母;规定(与常见的算数式子一样)任何一个左括号都从内到外与在它右边且距离最近的右括号匹配。写一个程序,找到无法匹配的左括号和右括号,输出原来字符串,并在下一行标出不能匹配的括号。不能匹配的左括号用"$“标注,不能匹配的右括号用”?“标注.输入输入包括多组数据,每组数据一行,包含一个字符串,只包含左右括号和大小写字母,字符串长度不超过100注意:cin.getline(

2020-10-30 17:11:24 238

原创 201912-1 报数

201912-1 报数代码:#include <iostream>#include <vector>using namespace std;bool jump(int num){ if(num%7 == 0){ return true; } while(num != 0){ int temp = num; num = (int)num/10; int currnum = temp

2020-10-28 13:10:51 80

原创 201909-2 小明种苹果(续)

测试用例44 74 -7 -12 -55 73 -8 -6 59 -45 76 -5 -10 60 -25 80 -6 -15 59 054 10 0 9 04 10 -2 7 02 10 04 10 -3 5 04 10 -1 8 0代码#include <iostream>#include <vector>#include <algorithm>#include <queue>#define INF 0x7ffff..

2020-10-27 21:02:05 59

原创 201903-5 317号子任务(100分)

测试用例7 6 21 0 1 0 1 1 01 4 11 2 32 4 42 3 52 5 76 7 5千辛万苦获得100分总结一下获得满分的几个条件(猜测):求取最短路径时只求行星发动机据点到所有点的最短距离;使用一个二维数组存储,distance(行星发动机据点->普通点)=distance(普通点->行星发动机据点)使用邻接链表存图使用迪杰斯特拉算法,并且使用堆优化求前k个的算法需要优化(我猜大部分60分的是没有优化这里):具体思路是使用一个大根堆,这个堆.

2020-10-27 20:07:00 617 2

原创 201903-5 317号子任务(100分优化过程)

csp 201903-5 317号子任务测试用例:7 6 21 0 1 0 1 1 01 4 11 2 32 4 42 3 52 5 76 7 530分 弗洛伊德:#include <iostream>#include <iostream>#include <vector>#include <algorithm>#include <queue>#define INF 0x7fffffffusing name

2020-10-27 19:52:21 486 1

原创 201909-2 小明种苹果

csp 201909-2 小明种苹果测试样例:3 373 -8 -6 -476 -5 -10 -880 -6 -15 02 210 -3 -115 -4 0#include <iostream>#include <vector>#include <algorithm>using namespace std;struct node{ int id; int num;};struct cmp{ bool o

2020-10-26 19:03:44 68

原创 csp 201903-2 二十四点

csp 201903-2 二十四点测试用例:109+3+4x35+4x5x57-9-9+85x6/5x43+5+7+91x1+9-91x9-5/98/5+6x96x7-3x66x4+4/5#include <iostream>#include <string>#include <vector>#include <stack>using namespace std;int main(){ int n;

2020-10-26 17:25:09 61

转载 聚类系数计算——GCC&LCC

聚类系数计算在图论中,集聚系数是图中的点倾向于集聚在一起的程度的一种度量。证据显示:在多数实际网络以及特殊的社会网络中,结点有形成团的强烈倾向,这一倾向的特征是有一个相对紧密的连接(Holland and Leinhardt, 1971[1]; Watts and Strogatz, 1998[2],后者是提出了小世界网络模型)。在实际网络中,这种可能性比随机生成的均匀网络的两个结点间连接的可能性大(Holland andLeinhardt, 1971; Watts and Strogatz, 1998)

2020-06-14 13:05:44 6564 1

空空如也

空空如也

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

TA关注的人

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