知识
长歌丶采薇
这个作者很懒,什么都没留下…
展开
-
最大空凸包 (板子)
问题:给定一个点集S,求一个面积最大的凸多边形C,其中他的边界由S中的点组成,且任意p∈S−C不在C多边形内部#include <iostream>#include <cmath>#include <cstdio>#include <algorithm>using namespace std;typedef double type_p;...原创 2019-10-23 19:29:54 · 263 阅读 · 0 评论 -
给定三角形的三点 求外心
Point heart(int a,int b,int c){ double a1=p[b].x-p[a].x; double b1=p[b].y-p[a].y; double c1=(p[b].x*p[b].x+p[b].y*p[b].y-p[a].x*p[a].x-p[a].y*p[a].y)/2; double a2=p[c].x-p[b].x; ...原创 2019-10-14 16:46:29 · 990 阅读 · 0 评论 -
HDU - 5256 序列变换(nlogn求最长上升子序列)
HDU - 5256 序列变换(nlogn求最长上升子序列)我们有一个数列A1,A2…An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。请输出最少需要修改多少个元素。Input第一行输入一个T(1≤T≤10),表示有多少组数据每一组数据:第一行输入一个N(1≤N≤105),表示数列的长度第二行输入N个数A1,A2,…,An。...原创 2019-09-25 17:49:11 · 192 阅读 · 0 评论 -
Palindromes and Super Abilities URAL - 1960 (回文树板子)
Palindromes and Super Abilities URAL - 1960 (回文树板子)After solving seven problems on Timus Online Judge with a word “palindrome” in the problem name, Misha has got an unusual ability. Now, when he read...原创 2019-09-12 17:16:49 · 132 阅读 · 0 评论 -
HDU - 5489 Removed Interval(最长上升子序列)
HDU - 5489 Removed Interval(最长上升子序列)Given a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is referred as increasing if b1<b2<…<bk. LY has just learned how to find the longe...原创 2019-09-10 12:55:06 · 299 阅读 · 0 评论 -
2018宁夏网络赛 B Goldbach (米勒拉宾素数测试)
2018宁夏网络赛 B Goldbach (米勒拉宾素数测试)题目链接题目大意:给你一个偶数n (2<n<=1e18)让你把n分解成两个素数的和。(如果有多个输出任意一个)解题思路:米勒拉宾素数测试板子这个板子可以在 log 级的时间内判断一个数是不是素数。 用于判断大数是不是素数。AC代码:#include<bits/stdc++.h>#define ...原创 2019-09-05 22:05:46 · 181 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场——B Quadratic equation 二次剩余定理)
链接:https://ac.nowcoder.com/acm/contest/889/B来源:牛客网题目描述Amy asks Mr. B problem B. Please help Mr. B to solve the following problem.Let p = 1000000007.Given two integers b and c, please find two in...原创 2019-08-15 21:02:17 · 193 阅读 · 0 评论 -
HDU-6705 path(2019CCPC网络赛1004) Kth路径 思维+套路题
HDU-6705 path(2019 CCPC网络赛1004)You have a directed weighted graph with n vertexes and m edges. The value of a path is the sum of the weight of the edges you passed. Note that you can pass any edge an...原创 2019-08-24 18:48:42 · 259 阅读 · 0 评论 -
字典树小结
字典树小结这是百度百科上的解释:又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希树高。我理解的字典树:保存字符串(或数字),能快速找到与之匹配的或者与之有某种关系的串。...原创 2019-08-13 13:54:09 · 124 阅读 · 0 评论 -
splay树讲解
https://blog.csdn.net/a_comme_amour/article/details/79382104转载 2019-08-05 22:03:19 · 105 阅读 · 0 评论 -
大数模板(求 i为数组成和为k个数)
You are given a number 1 ≤ N ≤ 50. Every ticket has its 2N-digit number. We call a ticket lucky, if the sum of its first N digits is equal to the sum of its last N digits. You are also given the sum o...转载 2019-08-03 21:13:39 · 125 阅读 · 0 评论 -
大数运算
大数运算struct BigNum{ int d[maxn]; BigNum(string s){ int len =s.size(); d[0] = (len-1)/4+1; int i,j,k; for(i = 1; i < maxn; i++) d[i] = 0; for(i = len-...转载 2019-08-03 20:27:37 · 162 阅读 · 0 评论 -
ACM算法集合
ACM算法集合ACM 所有算法数据结构 栈,队列,链表哈希表,哈希数组堆,优先队列双端队列可并堆左偏堆二叉查找树Treap伸展树并查集集合计数问题二分图的识别平衡二叉树二叉排序树线段树一维线段树二维线段树树状数组一维树状数组N维树状数组字典树后缀数组,后缀树块状链表哈夫曼树桶,跳跃表Trie树(静态建树、动态建树)AC自动机LCA和RMQ...转载 2019-08-02 15:47:56 · 156 阅读 · 0 评论