上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 1.已知二维平面内三点坐标求三角形面积 ll solve(ll x1,ll y1,ll x2,ll y2,ll x3,ll y3){ return abs(x1*y2+x3*y1+x2*y3-x1*y3-y1*x2-x3*y2);//注意面积为返回这的一半 } 2.海伦公式 a,b,c分别为三角形三 阅读全文
posted @ 2020-03-09 10:02 waryan 阅读(799) 评论(0) 推荐(1)
摘要: 朴素素数筛 bool isprime(int n) { if(n==1) return 1; int t=sqrt(n); for(int i=2;i<=t;++i) if(n%i==0) return 1; return 0; } 埃氏筛: const int maxn=1e5+10; int p 阅读全文
posted @ 2020-03-09 09:07 waryan 阅读(127) 评论(0) 推荐(0)
摘要: 一:集合论基础 1.1 集合的初见 1.2 特殊集合与集合间的关系 1.3 集合的运算 1.4 集合的运算定律 1.5 可数集合与不可数集合 二:命题逻辑 2.1 什么是命题 2.2 命题联结词 2.3 命题符号化及其应用 2.4 命题公式和真值表 2.5 命题公式分类和等价 2.6 命题等价公式及 阅读全文
posted @ 2020-02-27 16:39 waryan 阅读(2274) 评论(0) 推荐(0)
摘要: 视频讲解 1.什么是git? git是一个开源的分布式版本控制系统,可以有效地、高速地处理从很小到非常大的项目版本管理 可以从github进行项目的实时保存,可以提供给多个人编辑,然后修改后在vscode的[源代码管理]处根据命令可以令其上传保存修改 下图是git的工作流 2.如何创建gitHub远 阅读全文
posted @ 2020-02-26 17:44 waryan 阅读(175) 评论(0) 推荐(0)
摘要: 大概配置过程 视频讲解 1.下载安装:https://code.visualstudio.com/ 2.语言设置:先按左箭头所指的,然后输入chinese点击install进行下载安装即可 3.编译配置: MinGW-w64 - for 32 and 64 bit Windows 建议安装到c盘,安 阅读全文
posted @ 2020-02-26 17:36 waryan 阅读(1140) 评论(0) 推荐(0)
摘要: 一:Largest Rectangle in a Histogram[一维单调栈] 题目大意: 求最大矩形面积 收获: 单调栈的应用 stl栈模拟: #include<cstdio> #include<stack> using namespace std; typedef long long ll; 阅读全文
posted @ 2020-02-11 17:24 waryan 阅读(357) 评论(0) 推荐(0)
摘要: 题目大意: 求贡献,已知公式n*(n+1)/2,求总和 收获: long long的转换技巧只能在乘或除上进行 题目链接 #include<bits/stdc++.h> typedef long long ll; using namespace std; const int N=2e5+10; in 阅读全文
posted @ 2020-02-09 13:04 waryan 阅读(121) 评论(0) 推荐(0)
摘要: 1.放苹果--[①2020-02-07] 题目大意:他一共有n个口罩和m个盒子,每个盒子可以放任意个口罩(允许空着) 现在他想问你一共有多少种放口罩的方案? Hint: 1 2 2 和 2 1 2 是同一种分配方案 分情况讨论: 1.n=0,没有口罩,那么只有一种放法,即f(0,m)=1 2.m=1 阅读全文
posted @ 2020-02-07 17:38 waryan 阅读(312) 评论(0) 推荐(0)
摘要: Educational Codeforces Round 80 (Rated for Div. 2)A 大意:寻找x使得等式<=n,若满足情况输出YES否则NO 解法:纯数学题,先构造函数f(x)然后寻找f(x)取得最小值的情况 具体情况如下/瞎猜,纯暴力,猜一个区间进行暴力此题猜 √d <-对照上 阅读全文
posted @ 2020-02-01 15:17 waryan 阅读(135) 评论(0) 推荐(0)
摘要: 起初一直看不懂题的意思,最后看了大佬的视频讲解才明白了题的意思。 题意:每次询问重复的时候抵消上一次操作 如果是奇数次的操作则视为障碍阻挡前进 收获:0和1的转换技巧,简单搜索和巧定义全局变量,没必要一定要写出来函数 非函数写法: #include<bits/stdc++.h> using name 阅读全文
posted @ 2020-01-31 23:03 waryan 阅读(196) 评论(0) 推荐(0)
摘要: POJ-3495 题解: #include <iostream> #include<algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <queue> #define INF 0x3f3f3f3f # 阅读全文
posted @ 2020-01-30 23:06 waryan 阅读(531) 评论(0) 推荐(0)
摘要: 1.单点修改裸题(HDU1754) #include<iostream> #include<algorithm> using namespace std; const int maxn=2e+5; int n,m,a[maxn]; struct tree{ int l,r,v; }trees[max 阅读全文
posted @ 2020-01-29 17:47 waryan 阅读(207) 评论(0) 推荐(1)
摘要: 一:差分数组概念 一、差分数组的定义及用途 1.定义:对于已知有n个元素的数列d,建立记录它每项与前一项差值的差分数组f:显然,f[1]=d[1]-0=d[1];对于整数i∈[2,n],我们让f[i]=d[i]-d[i-1]。//f[i]数组为差分数组,d[i]数组为原数组 2.简单性质:(1)计算 阅读全文
posted @ 2020-01-28 21:45 waryan 阅读(860) 评论(0) 推荐(1)
摘要: 一:模板题与解释 1.仅有定义即可完成优先队列(题面) #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); 阅读全文
posted @ 2020-01-28 16:02 waryan 阅读(129) 评论(0) 推荐(0)
摘要: 一.st取区间最大值 模板题洛谷P3865:https://www.luogu.com.cn/problem/P3865 注意点: 1.f[i][j]=f[i][i+2j-1] 2.预处理时是以2的次幂进行跳的取区间最大值 3.query询问函数: 询问时取的len的方法是由:2x<=r-l+1来取 阅读全文
posted @ 2020-01-27 22:21 waryan 阅读(246) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页