自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

September_的博客

https://my.csdn.net/zcy19990813

  • 博客(159)
  • 资源 (1)
  • 收藏
  • 关注

原创 Visual Studio 2019 安装 Windows SDK 8.1

引用https://www.cnblogs.com/pikaqiuaiteme/p/13982846.html的一张图。https://go.microsoft.com/fwlink/p/?LinkId=323507所以下载后直接安装就可了,一路next

2020-12-17 17:30:17 8624 2

原创 c++获取程序或某段代码的执行时间

#include <iostream>#include <algorithm>#include <windows.h>using namespace std;int main(){ clock_t startTime = clock(); for (int i = 0; i < 100000000; i++) {} clock_t endTime = clock(); cout << startTime << " " .

2020-12-14 09:51:13 1229

原创 error LNK2005: “public: __cdecl std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofs

1. 错误截图2.错误原因这两文件中都定义了ofstream,重复定义了3. 解决方法a.直接使用osgDB中的就ok了

2020-12-07 17:45:27 1071

原创 约瑟夫环

力扣https://leetcode-cn.com/problems/yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof/class Solution {public: int cc(int n,int m){ if(n==1) return 0; return (m+cc(n...

2020-03-30 16:08:12 453

原创 排序算法总结

一、堆排序算法模板模板题目#include <bits/stdc++.h>using namespace std;int a[100010];int n,len;void Update(int root){ int left=root*2+1; int right=root*2+2; if(right>len) { ...

2020-02-05 14:03:57 149

原创 378. 有序矩阵中第K小的元素(力扣、二分)

思路非常简单:转自https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/solution/er-fen-chao-ji-jian-dan-by-jacksu1024/1.找出二维矩阵中最小的数left,最大的数right,那么第k小的数必定在left~right之间2.mid=(left+righ...

2020-02-03 20:13:42 294

原创 力扣 1019. 链表中的下一个更大节点(单调栈)

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: vector<i...

2020-02-01 13:05:20 385

原创 力扣146(双向链表加哈希表)

#include<bits/stdc++.h>using namespace std;typedef long long ll;class LRUCache{public: struct Node { public: int val,key; Node *next,*pre; Node(int a,...

2020-01-22 18:36:12 277

原创 洛谷P1219 八皇后(n皇后)(位运算)

题目链接题目描述检查一个如下的6 x 6的跳棋棋盘,有六个棋子被放置在棋盘上,使得每行、每列有且只有一个,每条对角线(包括两条主对角线的所有平行线)上至多有一个棋子。上面的布局可以用序列2 4 6 1 3 5来描述,第i个数字表示在第i行的相应位置有一个棋子,如下:行号 1 2 3 4 5 6列号 2 4 6 1 3 5这只是跳棋放置的一个解。请编一个程序找出所有跳棋放...

2019-10-30 18:32:46 268

原创 Git 学习笔记

git init //初始化仓库git add <file> 添加git commit -m <message> 提交git status //显示当前仓库的状态 (提没提交文件)git diff 比较工作区和暂存区的差异git diff比较的是工作目录中当前文件和暂存区域快照之间的差异, 也就是修改之后还没有暂存起来的...

2019-10-28 23:06:34 105

原创 二分图最大权匹配(KM算法)模板 HDU2255

讲解链接https://www.cnblogs.com/logosG/p/logos.html#include <bits/stdc++.h>using namespace std;#define INF 0x3f3f3f3ftypedef long long ll;const int maxn = 100010;/* KM 算法*复杂度 O(nx*nx*ny)...

2019-10-25 18:33:29 297

原创 归并排序 求 逆序对

题目链接洛谷P1908引用该题题解中的一段话://在某个时候,左区间: 5 6 7 下标为i// 右区间: 1 2 9 下标为j// //这个时候我们进行合并://step 1:由于 5>1,所以产生了逆序对,这里,我们发现,左区间所有还没有被合并的数都比 1 大,所以1与左区间所有元素共产生了 3 个逆序对(即tot_num...

2019-10-09 19:58:10 199

原创 排序--归并排序

图解图解来源归并排序流程合并流程#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn = 101000;ll n,a[maxn],b[maxn];void cc(int l,int r){ if(l>=r) return; ...

2019-10-09 19:34:40 138

原创 最大流的增广路算法

讲解模板题目链接洛谷P3376模板来自算法竞赛入门经典(第2版)--刘汝佳#include <bits/stdc++.h>using namespace std;#define INF 0x3f3f3f3ftypedef long long ll;const int maxn = 100010;struct edge //记录这条边的信息{ int...

2019-10-08 11:08:46 378

原创 P1020 导弹拦截 洛谷

思路:第一问求 最长不升子序列 ,第二问求 最长上升子序列#include <bits/stdc++.h>#include <map>using namespace std;typedef long long ll;map<ll,ll> mp;ll a[100100],n,ans1[100100],ans2[100100];ll len1,...

2019-09-26 23:11:34 165

原创 Little Boxes (C++大数加法)

/*** * ii. ;9ABH, * SA391, .r9GG35&G * &#...

2019-08-22 10:48:37 323

转载 Miller-Rabbin随机性素数测试算法(POJ1811)

POJ 1181#include <iostream>#include <cstring>#include <string>#include <cstdlib>#include <cstdio>#include <map>#include <queue>#include <vector&g...

2019-08-16 16:27:22 228

原创 牛牛与数组(牛客、DP)

牛牛与数组#include <iostream>#include <cstring>#include <string>#include <cstdlib>#include <cstdio>#include <map>#include <queue>#include <vector>...

2019-08-16 15:02:10 223

原创 Rake It In ( DFS)

计蒜客Rake It In由于k<=3,t<=200,可以想到,在最坏的情况下,暴力计算出每一层的最优解,一共也只有6层,时间最多为200*(9^6)。暴力递归(回溯)出每一层的最优解,进而求取最终答案。#include <iostream>#include <cstring>#include <string>#include &lt...

2019-08-16 10:02:16 245

原创 P3373 【模板】线段树 2

P3373AC代码:这里的延迟标记要开两个,分别记录加法的值和乘法的值,但是乘法和加法的优先级不一样,不规定他们的顺序的话会有错误,所以可以规定乘法优先,即规定好该结点的值等于该节点的值*父节点的乘法延迟标记的值+父节点加法延迟标记的值*区间长度,即,sum[num * 2] = (sum[num * 2] * Add[num].wc + ln * Add[num].wj) % mod;这...

2019-08-15 10:07:16 169

原创 RMQ模板

一维#include <iostream>#include <cstring>#include <string>#include <cstdlib>#include <cstdio>#include <map>#include <algorithm>using namespace std;t...

2019-08-14 15:29:03 135

原创 划分树模板

源自:kuangbin的ACM模板(新)题目链接:POJ 2104#include <iostream>#include <cstring>#include <string>#include <cstdlib>#include <cstdio>#include <map>#include <algo...

2019-08-14 15:06:35 112

原创 小A的题(线段树)

描述由于小 A 实在是太菜了,因此他现在需要你的帮助: 现在小 A 手上有一个凌乱的01串,他想通过若干次对于这个01串的局部排序将它变成一个有趣的01序列。 现在有两种操作:输入格式 lr0表示把区间[l,r][l,r]给升序排序 lrr1表示把区间[l,r][l,r]给降序排序 然后小 A 这个菜鸡想知道在m次操作之后序列长啥样。...

2019-08-13 10:21:52 258

原创 单词接龙(牛客网、DFS)

#include<bits/stdc++.h> #define memset(a,b) memset(a,b,sizeof(a))using namespace std;typedef long long ll;string a[30];char c;int vis[30];int n,ans=-1;void DFS(int num,string str)...

2019-08-09 14:41:58 394

原创 Fence Building(欧拉定理、卢卡斯定理)

平面内的区域个数=平面内的点数+平面内的边数+2,因为这个是在圆上,所以圆外的那1个要减去,所以最后+1而不是+2。点数=C(n,4),即每4个点连线就有一个平面内的点产生,边数=C(n,2),即每两个点连线就产生一条边。组合数的几种求法#include <algorithm>#include <iostream>#include <cstring&gt...

2019-08-09 08:55:26 250

原创 Python 大数运算 (进击吧!阶乘)

进击吧!阶乘a = 0while True: try: a = input() sum =1 for i in range(1,a+1): sum = sum * i print (sum) except: breakpython实现循环输入到文件结尾(类似于c语言的 while(scanf("%d",&n)!=EOF )w...

2019-08-08 10:50:47 2219

原创 线段树求逆序对(POJ2299)

POJ2299逆序对即给定一行序列,问对于每一个数字,位于该数字前面且大于该数字的共有多少个。事实上,我们可以建立一个哈希表,把输入的数字全部统计进去,每计算一个数字的逆序数时,统计该数字后面的值之和,例如:5 3 7 4 1建立哈希表:m[1],m[3],m[4],m[5],m[7] 初始都是0现在加入5,则m[5]++,统计m[5]后面的数(m[7])之和为0加入3,则m[3...

2019-08-05 15:47:47 276

原创 线段树模板

#include <algorithm>#include <iostream>#include <cstring>#include <cstdlib>#include <string>#include <cstdio>#include <vector>#include <cmath>#...

2019-08-05 09:20:56 123

原创 AC自动机(HDU2222)

HDU2222#include<iostream>#include<algorithm>#include<cstring>#include<string>#include<cstdio>#include<queue>using namespace std;struct Trie{ Trie *n...

2019-08-04 16:15:18 127

原创 KMP 详解+模板

详解#include<iostream>#include<algorithm>#include <cstring>#include <string>#include<cstdio>using namespace std;int next[1000],num=0;void GetNextval(char* p, int...

2019-08-04 10:28:18 184

原创 Faulty Robot ( 2017 ICPC Mid-Central USA Region )

Faulty RobotAs part of a CS course,Alice just finished programming her robot to explore a graph havingnnnodes,labeled1,2,...,n,1,2,...,n,andmmdirected edges. Initiall...

2019-08-04 08:52:48 232

翻译 杨辉三角前n行偶数的个数

#include <algorithm>#include <iostream>#include <cmath>#include <cstdio>#include <cstring>#include <cstdlib>using namespace std;typedef long long ll;ll a[2...

2019-08-03 09:00:13 907

原创 Jamie and Binary Sequence (changed after round)(codeforces 916B)

B. Jamie and Binary Sequence (changed after round) time limit per test 2 seconds memory limit per test 256 megabytes...

2019-08-01 10:22:30 274

转载 凸包(讲解+模板+例题)

凸包讲解例题POJ 2187模板#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<cmath>using namespace std;struct node{ int x,y;};node...

2019-07-31 16:10:16 820 1

原创 最小生成树模板(Prim、Kruskal)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1863Prim#include<iostream>#include<algorithm>#include<cstring>#include<vector>#include<queue>#include<cstdio&g...

2019-07-31 11:00:25 167

原创 最短路模板(Dijkstra、Floyd、Bellman-Ford、SPFA)

模板测试题目:http://acm.hdu.edu.cn/showproblem.php?pid=2544Floyd#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#define inf 0x3f3f3f3fusing namespa...

2019-07-31 09:25:06 195

原创 堆优化Dijkstra(优先队列)模板

题目链接:http://acm.sdibt.edu.cn/vjudge/contest/view.action?cid=2226#problem/HH -最短路Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 2544...

2019-07-30 10:26:45 436

原创 Parentheses Matrix (HDU6400)

Parentheses MatrixTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1418Accepted Submission(s): 524Special JudgeProblem DescriptionA...

2019-05-28 16:07:09 192

原创 Large Summation( CFGym 101532C)

C -Large SummationTime Limit:1000MSMemory Limit:262144KB CFGym 101532Cuse MathJax to parse formulasDescriptionYou are given an arrayacon...

2019-05-05 16:56:21 240

原创 The Hell Boy (CFGym 101532J)

J -The Hell BoyTime Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uCFGym 101532Juse MathJax to parse formulasDescription...

2019-05-05 10:27:29 252

C++模拟文件的三种物理存储结构

利用C++语言实现文件的三种物理存储结构

2019-12-20

空空如也

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

TA关注的人

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