Angesthan
Angesthan
全部文章
c++模板
java(11)
python(1)
未归档(1)
练习题(6)
题解(10)
归档
标签
去牛客网
登录
/
注册
Angesthan的博客
全部文章
/ c++模板
(共9篇)
快速幂
long long int pow_mod(long long int a, long long int k) { long long int ans = 1; a %= MOD; while(k) { if(k % 2) ans *= a; ...
2020-03-03
0
320
vector初始化以及遍历
#include<iostream> #include<cstdio> #include<vector> #include<set> #include<map> #include<stack> #include<queue...
2020-02-07
0
316
快速排序
#include<iostream> using namespace std; int n,a[1000001]; void qsort(int l,int r)//应用二分思想 { int mid=a[(l+r)/2];//中间数 int i=l,j=r; do...
2020-02-07
0
463
快读
inline long long read() { long long x=0ll; long long f=1ll; char ch=getchar(); for(;!isdigit(ch);ch=getchar()) {if(ch=='-') f = -1;} ...
2020-02-07
0
324
扩展中国剩余定理
#include<iostream> typedef __int128 ll; using namespace std; void exgcd(ll a,ll b,ll &g,ll &x,ll &y) { if (b == 0) { ...
2020-02-07
0
404
优先队列
一、相关定义优先队列容器与队列一样,只能从队尾插入元素,从队首删除元素。但是它有一个特性,就是队列中最大的元素总是位于队首,所以出队时,并非按照先进先出的原则进行,而是将当前队列中最大的元素出队。这点类似于给队列里的元素进行了由大到小的顺序排序。元素的比较规则默认按元素值由大到小排序,可以重载“&l...
2020-02-07
0
705
快速筛选素数
#include"cstdio" #include"cstring" using namespace std; #define MAX 100000//求MAX范围内的素数 long long su[MAX],cnt; bool isprime[MAX]; v...
2020-02-07
0
329
进制转换
#include <bits/stdc++.h> using namespace std; int main() { //freopen("input.txt","r",stdin); char js[]="012345...
2020-02-07
0
315
矩阵求斐波那契数列
#include <iostream> #include <cstring> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll n, sum; struct Node { ll ...
2020-02-07
0
306