02 2019 档案
摘要:#includeusing namespace std;typedef long long ll;#define N 1100const int mod = 1000000007;int bit[N][N],n,m,a[N][N];int lowbit(int x)...
阅读全文
摘要:#include #include #include #include #include #include #include #include #define ll long longusing namespace std;ll mod_mul(ll a,ll b,l...
阅读全文
摘要:易得递推式为f[i]=f[i-1]+f[i-M] 最终答案即为f[N]. 由于N很大,用矩阵快速幂求解。code:#includeusing namespace std;typedef long long ll;const int MOD=1e9+7;ll n,m;s...
阅读全文
摘要:下面的代码中用unsigned long long 运算的自然溢出来省掉取模的过程。#includeusing namespace std;typedef long long ll;const unsigned long long ull;const ull B=10...
阅读全文
摘要:1005 Programming Pattern (35 分)Programmers often have a preference among program constructs. For example, some may prefer if(0==a), w...
阅读全文
摘要:#includeusing namespace std;const int MAX_N=1000005;int n,k;int Rank[MAX_N+1];int tmp[MAX_N+1];int sa[MAX_N+1];bool compare_sa(int i,i...
阅读全文
摘要:#include #include #include using namespace std;int main(){ string a; a.resize(100); //需要预先分配空间 scanf("%s", &a[0]); printf(...
阅读全文
摘要:直接贴模板:#includeusing namespace std;const int MAX_N=1000005;int n,k;int Rank[MAX_N+1];int tmp[MAX_N+1];int sa[MAX_N+1];bool compare_sa(i...
阅读全文
摘要:题库链接:https://ac.nowcoder.com/acm/contest/370/Fcode:#includeusing namespace std;int n,m,s;struct edge{ int to;int cost;};vector e[11...
阅读全文
摘要:题目链接:https://ac.nowcoder.com/acm/contest/370/Icode:#includeusing namespace std;typedef unsigned long long ll;ll mod=1e9+7;ll pow(ll x,...
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/368/B来源:牛客网 题目描述有一棵n个节点的二叉树,1为根节点,每个节点有一个值wi。现在要选出尽量多的点。对于任意一棵子树,都要满足:如果选了根节点的话,在这棵子树内选的其他的点都要比...
阅读全文

浙公网安备 33010602011771号