上一页 1 2 3 4 5 6 7 8 9 10 ··· 36 下一页
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3916#include using namespace std;int n, ans[3]; char s[2000005];void work(int now) { int l=1, r=n-(n>>... 阅读全文
posted @ 2015-03-27 22:33 iwtwiioi 阅读(414) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1960题意:给一个串s,要求输出所有的s[0]~s[i],iusing namespace std;struct PT { static const int nS=26, nL=100015, N=nL; i... 阅读全文
posted @ 2015-03-27 13:42 iwtwiioi 阅读(383) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3621题意:给两个三角形,问A能否通过旋转伸缩到B。#include using namespace std;struct cp { static const double eps=1e-4; doub... 阅读全文
posted @ 2015-03-26 17:09 iwtwiioi 阅读(317) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2286题意:n个点的边加权树,m个询问,每次询问给出的k个点与结点1分离的最小代价。(nusing namespace std;typedef long long ll;const int N=2500... 阅读全文
posted @ 2015-03-26 14:22 iwtwiioi 阅读(300) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2891题意:求最小的$x$使得$x \equiv r_i \pmod{ a_i }$。#include #include #include #include #include using namespace std;typedef long lo... 阅读全文
posted @ 2015-03-25 22:22 iwtwiioi 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 写点做多项式笔记以及遇到的各种蛋疼的东西....(不懂可以Q我辣我十分愿意!(picks博客已经成为中国多项式入门到精通的经典教程辣!详见:http://picks.logdown.com/archives多项式乘法:裸的fft= =复数搞搞数论变换的多项式乘法:对于一些要对系数取模而取的模十分鬼畜... 阅读全文
posted @ 2015-03-25 13:21 iwtwiioi 阅读(627) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/438/problem/E题意:询问每个点权值在 $c_1, c_2, ..., c_m$ 中,总权值和为 $s$ 的二叉树个数。请给出每个$s \in [1,S]$ 对应的答案。($S,m using namespace std;type... 阅读全文
posted @ 2015-03-25 12:46 iwtwiioi 阅读(392) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3456题意:求n个点的无向连通图的方案。(nusing namespace std;typedef long long ll;const int N=130050, fN=N>=1, (a*=a)%=m... 阅读全文
posted @ 2015-03-23 17:33 iwtwiioi 阅读(1132) 评论(7) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1811题意:求n最小素因子。(n#include #include #include #include using namespace std;typedef long long ll;const ll lim=1e9;inline void C... 阅读全文
posted @ 2015-03-21 12:31 iwtwiioi 阅读(479) 评论(1) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2138题意:给n个数判断有几个素数。(每个数using namespace std;typedef long long ll;ll ipow(ll a, ll b, ll m) { ll x=1; for(; b;... 阅读全文
posted @ 2015-03-20 13:47 iwtwiioi 阅读(333) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;const int N=1000005;int P, cnt, pcnt, p[N], pr[N];bool np[N];typedef long long ll;int gcd(int a, int b) { return b?gcd(b,... 阅读全文
posted @ 2015-03-19 20:58 iwtwiioi 阅读(1594) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1284题意:求一个素数p的原根个数。(p#include #include #include #include using namespace std;const int lim=65535, N=70005;int p[N], pcnt, np... 阅读全文
posted @ 2015-03-19 20:07 iwtwiioi 阅读(239) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2084题意:一个01串,求满足字符串0和1取反后,再将整个串反过来和原串一样的子串数目。(nusing namespace std;const int N=500005;long long ans;in... 阅读全文
posted @ 2015-03-19 16:15 iwtwiioi 阅读(295) 评论(1) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3974题意:求s的最长回文串。(|s|#include #include #include #include using namespace std;char s[2000050]; int len[2000050], T;int main() ... 阅读全文
posted @ 2015-03-19 14:21 iwtwiioi 阅读(381) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3771题意:n个带价值互不相同的物品,每次可以取1、2、3个物品,问能得到的所有的价值和这个价值的方案数(n不明(无意义= =),价值using namespace std;const int N=20... 阅读全文
posted @ 2015-03-18 18:24 iwtwiioi 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 原文地址(跪gty orz):http://gaotianyu1350.gitcafe.io/2015/03/08/%E6%95%B0%E5%88%97///ps:已修正原文部分格式问题= =//upd:有适当补充卡特兰数前20项(从0开始)1, 1, 2, 5, 14, 42, 132, 429,... 阅读全文
posted @ 2015-03-13 19:56 iwtwiioi 阅读(366) 评论(0) 推荐(1) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3052题意:n个带颜色的点(m种),q次询问,每次询问x到y的路径上sum{w[次数]*v[颜色]},可以单点修改颜色。(n, m, qusing namespace std;const int N=1... 阅读全文
posted @ 2015-03-13 17:26 iwtwiioi 阅读(485) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3757题意:n个节点的树,每个点有一种颜色。现有m种询问,每次询问x y a b表示x到y的路径上颜色的种数且a颜色看成b颜色。(nusing namespace std;const int N=500... 阅读全文
posted @ 2015-03-11 20:47 iwtwiioi 阅读(492) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1086题意:n个点的树,要求分块,使得每一块的大小在[b, 3b]内且块与某个点形成的块是连通的(某个点既可以是块内也可以在块外)(nusing namespace std;const int N=10... 阅读全文
posted @ 2015-03-11 13:49 iwtwiioi 阅读(368) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3648题意:n对人(编号0~n-1,'w'表示第一个人,'h'表示第二个人),每对两个,人坐在桌子两侧。满足:1、每对人中的两个人不能坐在同一侧。2、m对关系x和y,表示x和y不能坐在同一侧,但是能坐在第0对的第一个人的那一侧。问第0对的第一个人... 阅读全文
posted @ 2015-03-10 21:57 iwtwiioi 阅读(282) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 36 下一页