自定义博客皮肤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 9837 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 1349

原创 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 1276

原创 约瑟夫环

力扣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 533

原创 排序算法总结

一、堆排序 算法模板模板题目 #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 203

原创 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 402

原创 力扣 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 524

原创 力扣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 387

原创 洛谷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 371

原创 Git 学习笔记

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

2019-10-28 23:06:34 180

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

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

2019-10-25 18:33:29 383

原创 归并排序 求 逆序对

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

2019-10-09 19:58:10 287

原创 排序--归并排序

图解图解来源 归并排序流程 合并流程 #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 208

原创 最大流的增广路算法

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

2019-10-08 11:08:46 483

原创 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 229

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

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

2019-08-22 10:48:37 420

转载 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 301

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

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

2019-08-16 15:02:10 310

原创 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 305

原创 P3373 【模板】线段树 2

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

2019-08-15 10:07:16 228

原创 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 198

原创 划分树模板

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

2019-08-14 15:06:35 152

原创 小A的题(线段树)

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

2019-08-13 10:21:52 318

原创 单词接龙(牛客网、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 542

原创 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 305

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

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

2019-08-08 10:50:47 2370

原创 线段树求逆序对(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 350

原创 线段树模板

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

2019-08-05 09:20:56 195

原创 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 208

原创 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 234

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

Faulty Robot As 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 293

翻译 杨辉三角前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 995

原创 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 365

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

凸包讲解 例题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 1015 1

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

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

2019-07-31 11:00:25 221

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

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

2019-07-31 09:25:06 254

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

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

2019-07-30 10:26:45 529

原创 Parentheses Matrix (HDU6400)

Parentheses Matrix Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1418Accepted Submission(s): 524Special Judge Problem Description A...

2019-05-28 16:07:09 272

原创 Large Summation( CFGym 101532C)

C -Large Summation Time Limit:1000MSMemory Limit:262144KB CFGym 101532C use MathJax to parse formulas Description You are given an arrayacon...

2019-05-05 16:56:21 294

原创 The Hell Boy (CFGym 101532J)

J -The Hell Boy Time Limit:1000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64u CFGym 101532J use MathJax to parse formulas Description ...

2019-05-05 10:27:29 310

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

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

2019-12-20

空空如也

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

TA关注的人

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