组合数学 方法一:预处理 + 递推 \(C_a^b = C_{a-1}^b + C_{a-1}^{b-1}\) 时间复杂度:O(\(n^2\)) #include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const ...
分类:
其他好文 时间:
2021-02-17 14:54:06
阅读次数:
0
题目链接:https://codeforces.com/contest/1480/problem/C 题解: 二分法。设定查找区间为$[1,n]$。若$a_<a_{mid+1}$若$a_>a_$,则$a_$为可行解。若$a_<a_$同理可得除非$a_n$在区间$[l,mid]$严格单调增加,否则必有 ...
分类:
其他好文 时间:
2021-02-17 14:36:41
阅读次数:
0
#include<bits/stdc++.h> #define N 300010 using namespace std; #define int long long int h[N],nxt[N],v[N],w[N],s,t,dep[N],ec,p[N],n,a[N],b[N],c[N],f[N] ...
分类:
其他好文 时间:
2021-02-17 14:04:51
阅读次数:
0
未完待续……(只是给自己存个板子) 快速傅里叶变换 #include <bits/stdc++.h> using namespace std; const int maxn = 2e6 + 1e2; struct Cp { double x, y; inline Cp operator +(cons ...
分类:
其他好文 时间:
2021-02-17 14:03:19
阅读次数:
0
A - Favorite Sound #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ int a, b, c; cin >> a >> b >> ...
分类:
其他好文 时间:
2021-02-16 12:44:42
阅读次数:
0
typedef - 自定义类型 该语句主要用于将某种类型起名为一个别名,如 double 起名为 area,这样以后再定义area类型的变量时,就相当于定义了一个double的变量。 程序实例: 定义一个double 类的 #include <iostream> using namespace st ...
分类:
其他好文 时间:
2021-02-16 12:35:10
阅读次数:
0
// // variadic_template.h// template <typename T>class Enum {public: using Type = T; static const char * toString(T); static T toEnum(const std::strin ...
分类:
其他好文 时间:
2021-02-16 12:24:36
阅读次数:
0
#include<iostream> #include<thread> using namespace std; void func() { cout << "子线程开始了" << endl; cout << "......" << endl; cout << "子线程结束了" << endl; } ...
分类:
编程语言 时间:
2021-02-16 12:12:15
阅读次数:
0
1 #include <iostream> 2 3 using namespace std; 4 5 template <typename K, typename V> 6 class BST 7 { 8 private: 9 struct node // 类内定义类、结构体 10 { 11 K k ...
分类:
其他好文 时间:
2021-02-16 12:09:37
阅读次数:
0
使用namedtuple方法可以代替手动生成一个类 # Why Python is Great: Namedtuples # Using namedtuple is way shorter than # defining a class manually: >>> from collections ...
分类:
编程语言 时间:
2021-02-16 12:02:48
阅读次数:
0