摘要:
关于一个骚知识的个人代码实现 题目戳这里: 1554梦中的统计 代码如下: ** _请重视njc函数_ ** #include<cstdio> #include<cstring> using namespace std; int N[15]; int n,m; int po(int j) { int 阅读全文 »
摘要:
这个东西需要用到数学上的辗转相除法,这里就不在赘述,辗转相除法详见百度百科和代码中的njc函数。 题目链接: 求最大公约数问题 下面代码: #include<cstdio> #include<cstring> using namespace std; int njc(int a,int b) { i 阅读全文 »
摘要:
一、数据结构部分 1、set&map(后续持续更新) 2、queue(priority_queue) queue<int> a; //定义 a.push(i); //压入 a.pop(); //弹出 a.size(); //取大小 a.front(); //访问队首元素 a.back(); //访问 阅读全文 »
摘要:
其实这个东西还是比较简单啦,但是有一些很妙妙的方法,因为博主今天没有时间,所以以后再做介绍。 先介绍最基本的方法。 增量构造法 一次选出一个元素放入集合中: 代码如下: #include<bits/stdc++.h> using namespace std; int a[10000]; void p 阅读全文 »
摘要:
这里其实这个东西还是比较简单了的,所以这里只是贴一篇代码,相信大家认真看一下也是可以看懂的! 代码如下: #include<bits/stdc++.h> using namespace std; char st[500]; int u=0; void read() { char c; while(c 阅读全文 »
摘要:
为啥A不了?? 标程如下:【转载】 #include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<cstring> #include<queue> #include<unordered_map> #defi 阅读全文 »
摘要:
链接戳这里☞ 星球大战 #include<cstdio> #include<cstring> #include<vector> #include<queue> using namespace std; int mp[400001][3]; vector<int> q; vector<int> edg 阅读全文 »
摘要:
线段树1对于Pushdown的理解 线段树1是一个区间修改和区间求值的题,他相当于以前的线段树——区间求值和单点修改和区间修改和单点求值,产生了本质上的一些区别,最主要的就在于Pushdown上的区别,现在我们就来区分一下。 1、线段树练习——单点修改和区间求值 这个主要考察的就是线段树最主要的三个 阅读全文 »
摘要:
###P3371 【模板】单源最短路径 题解 这是一道蛋蛋的题,我用SPFA干掉了他,可是又因为老毛病if没打两个等号,这道题又成功的耗费了我20分钟! ####下面上源代码(内有注释): //SPFA #include<cstdio> #include<cstring> #include<vect 阅读全文 »