线段树延迟标记的具体应用,是比较简单的区间加和修改 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <queue> using namespace std; const in ...
分类:
其他好文 时间:
2020-07-30 01:16:29
阅读次数:
68
题目大意: 给你n个点$(x[i],y[i])$,请你用这n个点构造一个$n-1$次多项式$f(x)$,给定一个数$k$,求出$f(k)$的值. solution: 本题$n$的规模较小,是拉格朗日插值的模板题.拉格朗日插值的具体思路如下: 我们的目标是构造一个函数,使得对于所有的$i \in [1 ...
分类:
其他好文 时间:
2020-07-29 21:39:39
阅读次数:
77
clause.hpp clause.cpp clause.hpp 声明了常用类型的别名: /* */ typedef int * literal_iterator;typedef const int * const_literal_iterator; /* */ 定义结构类型Clause、claus ...
分类:
其他好文 时间:
2020-07-29 21:34:34
阅读次数:
76
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6797 题意:给你n个数以及一个特殊数k,你可以将任意两个连续的数合并成一个新的数,同时数组的长度-1,问你进行若干次操作后(可以为0次),最多有多少个数是k的倍数。 思路:遍历数组,定义sum记录其和, ...
分类:
其他好文 时间:
2020-07-29 21:28:55
阅读次数:
87
1004.Tokitsukaze and Multiple 求和为p的倍数的块的最大数量 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register in ...
分类:
其他好文 时间:
2020-07-29 17:32:55
阅读次数:
99
##输出1到n以内所有的二进制回文数 #include <stdio.h> #define SIZE 50 typedef enum bool Bool; enum bool { false, true }; int main() { int n, i, j; Bool flag = false; ...
分类:
其他好文 时间:
2020-07-29 10:02:00
阅读次数:
84
#include <iostream> #include <map> using namespace std; typedef struct alertInfo { double alertUp; double alertDown; alertInfo(double up, double down) ...
分类:
其他好文 时间:
2020-07-28 22:25:22
阅读次数:
75
邻接表储存结构 /*邻接表的边*/ typedef struct ArcNode { int adjvex; struct ArcNode *next; }ArcNode; /*邻接表的结点*/ typedef struct VNode { char date; ArcNode *firstarc; ...
分类:
编程语言 时间:
2020-07-28 17:32:12
阅读次数:
91
AcWing 788. 逆序对的数量 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=1e6+10; int q[N],tmp[N]; LL merge_sort(int l,int r) ...
一、开放定址法构造的哈希表的运算算法 1、哈希表类型 #define NULLKEY-1 //定义空关键字 #define DELKEY-2 //定义被删关键字 typedef int KeyType; //关键字类型 typedef struct { KeyType key; //关键字域 int ...
分类:
编程语言 时间:
2020-07-28 14:17:47
阅读次数:
71