自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Jeremy写字的地方

随便写写

  • 博客(62)
  • 问答 (1)
  • 收藏
  • 关注

原创 C++STL容器总结(史上最全!)

STL容器vectorsize() 返回元素个数empty() 返回是否为空clear() 清空front()/back()push_back()/pop_back()begin()/end()[ ]支持比较运算,按字典序pair<int, int>first, 第一个元素second, 第二个元素支持比较运算,以first为第一关键字,以second为第二关键字(字典序)string,字符串size()/length() 返回字符串长度empty()

2020-05-21 21:23:03 347

原创 GitHub创建个人主页报错404 There is not a GitHub Pages site here.

hexo+github个人网站出现404的解决办法

2022-09-08 00:24:28 1107

原创 Latex 参考文献出现[?]问题解决

软件:TeXworks问题:按照参考文档引用文献后,标注的位置显示[?],而不显示该有的[1],[2]等解决:引入bib后,要先进行一遍BibTex编译;再使用pdfLaTex编译 (左上角切换编译模式)。有的时候还需要多进行几遍pdfLaTex编译才能将参考文献刷新出来。。。...

2022-02-22 14:29:00 1109

原创 python爬虫——爬取旅游城市信息

import requestsfrom bs4 import BeautifulSoupfrom pymongo import MongoClientclass QuNaEr(): def __init__(self, keyword, page=1): self.keyword = keyword self.page = page def qne_spider(self): url = 'https://piao.qunar.com

2020-12-16 18:46:22 616

原创 Codeforces Round686 div3

A思路:按照奇偶性对n进行分类:偶数直接相邻的两两互换;奇数则将前面n-3个相邻的两两互换,后面三个保证合法即可codes:#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;typedef long long LL;int test=1;int n;int main(){ scanf("%d",&test); while(test--) { cin >> n;

2020-12-02 21:37:32 151

原创 Codeforces Round#687 div2

A思路:比较四个角上的点,找出它们中距离(r,c)点的最大值code#include <bits/stdc++.h>using namespace std;int t,n,m,r,c;int main(){ cin >> t; while(t--) { scanf("%d %d %d %d", &n, &m, &r, &c); cout << max(max(r+c-2, n+m-r-c), max(n-r+

2020-11-30 14:53:33 235 2

原创 vtk体绘制三维重建

#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCubes.h>#include

2020-11-26 14:59:00 1894 2

原创 图的搜索与遍历

本文总结了图问题中常见的几个搜索遍历模板dijkstraint g[N][N]; // 存储每条边int dist[N]; // 存储1号点到每个点的最短距离bool st[N]; // 存储每个点的最短路是否已经确定// 求1号点到n号点的最短路,如果不存在则返回-1int dijkstra(){ memset(dist, 0x3f, sizeof dist); dist[1] = 0; for(int i=0;i<n-1;i++) { int t = -1; //在还未

2020-11-22 20:46:56 167

原创 vtk体绘制读取nii文件

import vtkreader = vtk.vtkNIFTIImageReader()reader.SetFileName('...\\.nii')reader.Update()mapper = vtk.vtkGPUVolumeRayCastMapper()mapper.SetInputData(reader.GetOutput())volume = vtk.vtkVolume()volume.SetMapper(mapper)property = vtk.vtkVolumePro

2020-11-21 11:39:16 4124

原创 vtk读取mhd文件

import vtkreader = vtk.vtkMetaImageReader()reader.SetFileName('...\\.mhd')reader.Update()viewer = vtk.vtkImageViewer2()viewer.SetInputConnection(reader.GetOutputPort())viewer.SetSize(640, 480)viewer.SetColorLevel(500)viewer.SetColorWindow(2000)

2020-11-21 10:42:13 441

原创 vtk读取dcm文件

import vtkreader = vtk.vtkDICOMImageReader()reader.SetFileName('...\\.dcm')reader.Update()viewer = vtk.vtkImageViewer2()viewer.SetInputConnection(reader.GetOutputPort())iren = vtk.vtkRenderWindowInteractor()viewer.SetupInteractor(iren)viewer.Re

2020-11-21 09:13:47 870 1

原创 vtk切割polydata

#include "vtkActor.h"#include "vtkPolyDataReader.h"#include "vtkClipPolyData.h"#include "vtkPlane.h"#include "vtkPolyData.h"#include "vtkPolyDataMapper.h"#include "vtkPolyDataNormals.h"#include "vtkProperty.h"#include "vtkRenderWindow.h"#include "

2020-11-21 08:58:19 511

原创 Codeforces Educational Round #98D

D思路:首先确定概率值:因为每一个信号塔有信号的可能性是1/2,所以可以确定分母就是2^n;再看分子,其实就是求有多少种可能性,不难发现,如果开一个数组的话,a[1] = 1, a[2] = 1,此后a[n] = a[n-1] + a[n-2],分子即为a[n]所以概率值为a[n]再利用逆元进行分数取模,注意在每一个可能溢出的地方取模代码:#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;typed

2020-11-21 08:47:49 220

原创 Codeforces Educational Round #98 C

C思路:括号匹配问题的变形代码:#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;typedef long long LL;int test=1;string s;int main(){ scanf("%d",&test); while(test--) { cin >> s; int q1=0,q2=0; int res=0; for(int i=0;i

2020-11-21 08:43:37 134

原创 Codeforces Educational Round #98 B

B#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;typedef long long LL;int test=1;int n,a[N];LL sum,k;int maxn;int main(){ scanf("%d",&test); while(test--) { sum = k = 0; maxn = 0; cin >> n; for(int i=0

2020-11-21 08:42:33 129

原创 Codeforces Educational Round#98 A

A思路:考虑三种可能:要不要换,换1,换0代码:#include <bits/stdc++.h>using namespace std;const int N = 1e6+10;typedef long long LL;int test=1;int main(){ scanf("%d",&test); while(test--) { int x,y; cin >> x >> y; if(abs(x-y)<=1)

2020-11-21 08:40:35 215

原创 Codeforces Round#684div2

B思路先看每组数据的最后一个取数点:也就是说要想获得尽可能大的中位数,那么至少要保证最后一个中位数所在的子数组里面,至少有n/2个元素比他大,这样得出最后一个中位数的位置为 n*k - n/2再看步长:要想使每个子数组的长度为n,现在我们已经有了1 + floor(n/2) 个元素,也就是说仍需要 n/2 + 1个元素,所以步长设为n/2+1再看最小的那个中位数该取谁:要想使该元素变为中位数,那么至少有(n-1)/2个元素小于他,同时有k组,那么我们要给这k组一共流出(n-1)/2*k个元素来

2020-11-18 23:51:10 142

原创 Codeforces Round#684div2 A

A思路:判断三种情况:不需要改变0->11->0代码#include <bits/stdc++.h>using namespace std;const int N = 1e5+10;typedef long long LL;int test=1;int n,c0,c1,h;string s;int main(){ scanf("%d", &test); while(test--) { cin >> n >&gt

2020-11-18 23:43:56 113

原创 vtkwidget交互——使用slider

目标:在vtk交互窗口中增加设置棱锥边数的滑动器#include <vtkConeSource.h>#include <vtkSmartPointer.h>#include <vtkPolyData.h>#include <vtkSliderWidget.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkRenderWindow.h&g

2020-11-18 11:12:09 905

原创 vtk通过滑动鼠标来切换三维图像切面

#include <vtkSmartPointer.h>#include <vtkImageReader2.h>#include <vtkMatrix4x4.h>#include <vtkImageReslice.h>#include <vtkLookupTable.h>#include <vtkImageMapToColors.h>#include <vtkImageActor.h>#include <

2020-11-09 00:16:29 777

原创 vtk导入场景

vtk导入场景codes#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCubes.h

2020-11-04 11:08:46 199

原创 vtk读取序列图像文件

vtk读取序列图像文件codes#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCub

2020-11-04 00:15:34 329 1

原创 vtk读取图片并输出

读取png输出为jpegcodes#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCu

2020-11-03 23:40:42 539

原创 vtkDataSet(数据集)

vtkDataSetcodes#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCube

2020-11-03 23:22:40 896

原创 vtk可视化管线

vtk可视化管线例子codes#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include <vtkPolyDataMapper.h>#include <vtkActor.h>#include <vtkMarchingCube

2020-11-03 15:58:04 171 1

原创 vtk纹理映射

vtk 纹理映射原理:渲染时把二维的图像"贴"到物体的表面上,根据二维图像渲染出丰富多彩的效果,所以也叫纹理贴图。纹理映射需要三个要素:待贴图的表面、纹理映射以及纹理坐标。example code#include <vtkSmartPointer.h>#include <vtkRenderWindow.h>#include <vtkRenderer.h>#include <vtkRenderWindowInteractor.h>#include

2020-11-03 14:37:11 380

原创 vtk建立vtkRender

vtk模板vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New(); renderer->AddActor(actor); renderer->SetBackground(0.1, 0.2, 0.4); vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow&

2020-11-03 12:42:15 194

原创 vtk报错“由于找不到**.dll无法继续执行代码“ 解决方案

最近学习vtk的时候在连接vs和vtk库这一步出现了如题所示的问题。 上网查找解决方案,有说让一个一个把dll库复制过来的,但是对于那些大型库太不现实了。可以发现这些dll都在一个文件夹里,那么只需要把工作目录和这个文件夹连接起来就好了。过程:右击project -> 属性 -> 调试 -> 工作目录 修改为那个文件夹的路径即可...

2020-11-01 16:51:29 7070 5

原创 基於qt實現的計算器

GitHub鏈接:https://github.com/LuoXubo/qt_calculator實現效果:

2020-09-26 13:23:31 104

原创 Python入门项目

适合python入门的项目源码链接:https://github.com/LuoXubo/star-war-project

2020-08-23 15:25:22 112

原创 Codeforces Edu89 div2D

Codeforces Edu89 div2D原题:You are given n integers a1,a2,…,an.For each ai find its two divisors d1>1 and d2>1 such that gcd(d1+d2,ai)=1 (where gcd(a,b) is the greatest common divisor of a and b) or say that there is no such pair.InputThe first li

2020-06-13 13:52:10 236

原创 Codeforces Educational Round89div2C

Codeforces Educational Round89 div2C原题:You are given a matrix with n rows (numbered from 1 to n) and m columns (numbered from 1 to m). A number ai,j is written in the cell belonging to the i-th row and the j-th column, each number is either 0 or 1.A chi

2020-06-13 13:32:35 251

原创 Codeforces Educational Round89div2

Codeforces Educational Round89div2原题:You are given an array consisting of n integers a1, a2, …, an. Initially ax=1, all other elements are equal to 0.You have to perform m operations. During the i-th operation, you choose two indices c and d such that l

2020-06-13 13:28:57 279

原创 Codeforces Educational Round89 div2A

Codeforces Educational Round89div2A原题Polycarp plays a well-known computer game (we won’t mention its name). In this game, he can craft tools of two types — shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a swor

2020-06-13 13:26:44 205

原创 Codeforces648div2D

Codeforces648div2D原题:Vivek has encountered a problem. He has a maze that can be represented as an n×m grid. Each of the grid cells may represent the following:Empty — ‘.’Wall — ‘#’Good person — ‘G’Bad person — ‘B’The only escape from the maze is at

2020-06-08 08:28:19 215

原创 Codeforces648div2C

Codeforces648div2C原题:After the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left with one half of a secret message. These messages can each be represented by a permutation of size n. Let’s call them a and b

2020-06-08 08:25:33 303

原创 Codeforces648div2B

Codeforces648div2B原题:Ashish has n elements arranged in a line.These elements are represented by two integers ai — the value of the element and bi — the type of the element (there are only two possible types: 0 and 1). He wants to sort the elements in no

2020-06-08 08:23:35 236

原创 Codeforces648div2A

Codeforces648div2A原题:Ashish and Vivek play a game on a matrix consisting of n rows and m columns, where they take turns claiming cells. Unclaimed cells are represented by 0, while claimed cells are represented by 1. The initial state of the matrix is giv

2020-06-08 08:21:28 226

原创 Codeforces647div2C

Codeforces647div2C原题:The last contest held on Johnny’s favorite competitive programming platform has been received rather positively. However, Johnny’s rating has dropped again! He thinks that the presented tasks are lovely, but don’t show the truth abou

2020-06-06 00:18:07 174

原创 Codeforces 647div2B

Codeforces 647div2B原题:Among Johnny’s numerous hobbies, there are two seemingly harmless ones: applying bitwise operations and sneaking into his dad’s office. As it is usually the case with small children, Johnny is unaware that combining these two activi

2020-06-06 00:16:52 230

空空如也

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

TA关注的人

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