Loading [MathJax]/jax/output/HTML-CSS/jax.js

03 2015 档案

摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3105题意:k堆火柴,先手和后手在第一次拿的时候都能拿若干整堆火柴(但不能拿完),之后和nim游戏规则一样。问先手是否必胜且第一次最少拿多少能保证必胜。(kusing namespace std;typ... 阅读全文
posted @ 2015-03-31 20:27 iwtwiioi 阅读(373) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3243题意:求ayb(modp)最小的y。(0#include #include #include #include typedef long long ll;using namespace std;int gcd... 阅读全文
posted @ 2015-03-28 14:08 iwtwiioi 阅读(322) 评论(0) 推荐(0) 编辑
摘要: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 阅读(391) 评论(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 阅读(320) 评论(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 阅读(302) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2891题意:求最小的x使得xri(modai)。#include #include #include #include #include using namespace std;typedef long lo... 阅读全文
posted @ 2015-03-25 22:22 iwtwiioi 阅读(226) 评论(0) 推荐(0) 编辑
摘要:写点做多项式笔记以及遇到的各种蛋疼的东西....(不懂可以Q我辣我十分愿意!(picks博客已经成为中国多项式入门到精通的经典教程辣!详见:http://picks.logdown.com/archives多项式乘法:裸的fft= =复数搞搞数论变换的多项式乘法:对于一些要对系数取模而取的模十分鬼畜... 阅读全文
posted @ 2015-03-25 13:21 iwtwiioi 阅读(632) 评论(0) 推荐(0) 编辑
摘要:http://codeforces.com/contest/438/problem/E题意:询问每个点权值在 c1,c2,...,cm 中,总权值和为 s 的二叉树个数。请给出每个s[1,S] 对应的答案。($S,m using namespace std;type... 阅读全文
posted @ 2015-03-25 12:46 iwtwiioi 阅读(397) 评论(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 阅读(1142) 评论(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 阅读(483) 评论(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 阅读(335) 评论(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 阅读(1608) 评论(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 阅读(241) 评论(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 阅读(303) 评论(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 阅读(383) 评论(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 阅读(409) 评论(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 阅读(370) 评论(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 阅读(492) 评论(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 阅读(517) 评论(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 阅读(375) 评论(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 阅读(284) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3678题意:很幼稚的题目直接看英文题面= =#include #include #include #include #include using namespace std;const int N=1000*2+10, M=N*N*4;struc... 阅读全文
posted @ 2015-03-10 21:35 iwtwiioi 阅读(264) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=2296题意:题意:给你n个点,每个点上都放一个正方形,点只能在正方形的上边或下边的中点上,所有正方形大小一样,不能有面积重叠,求最大的正方形。(n#include #include #include #include using namespac... 阅读全文
posted @ 2015-03-10 16:55 iwtwiioi 阅读(223) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3207题意:一个圆上顺时针依次排列着标号为1~n的点,这些点之间共有m条边相连,每两个点只能在圆内或者圆外连边。问是否存在这些边不相交的方案。(n#include #include #include #include using namespac... 阅读全文
posted @ 2015-03-10 06:58 iwtwiioi 阅读(165) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1814题意:n个2人组,编号分别为2n和2n+1,每个组选一个人出来,且给出m条关系(x,y)使得选了x就不能选y,问是否能从每个组选出1人。且输出字典序最小的答案。(n#include #include #inc... 阅读全文
posted @ 2015-03-09 22:42 iwtwiioi 阅读(218) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2829题意:将长度为n的序列分成p+1块,使得$\sum_{每块}\sum_{i#include #include #include #include using namespace std;const int N... 阅读全文
posted @ 2015-03-09 20:15 iwtwiioi 阅读(262) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3480题意:一个n个元素的集合S要求分成m个子集且子集并为S,要求Si(MAXMIN)2最小。(n#include #include #include #include using nam... 阅读全文
posted @ 2015-03-09 19:36 iwtwiioi 阅读(291) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=1160题意:直线上有n个城市,其中有p个城市有邮局,问如何建p个邮局使得每个城市到最近的邮局和最小。(n#include #include #include #include using namespace std;const int N=100... 阅读全文
posted @ 2015-03-09 18:19 iwtwiioi 阅读(206) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3516题意:平面n个点且满足xiyj, iusing namespace std;const int N=1005, oo=~0u>>1;int d[N][N], x[N], y[N], n, s[N][N];in... 阅读全文
posted @ 2015-03-09 13:26 iwtwiioi 阅读(388) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3506题意:环形石子合并取最小值= =(n#include using namespace std;const int N=2005, oo=~0u>>1;int a[N], w[N], d[N][N], s[N]... 阅读全文
posted @ 2015-03-08 17:19 iwtwiioi 阅读(372) 评论(0) 推荐(0) 编辑
摘要:29由于第一篇没写题意导致大部分神题题解已经完全不知道在说啥了...所以还是重开一篇保平安...【303A】题意:求三个长度为n(n=n个=2即可。【375B】题意:给一个n×m的01矩阵,要求一个全是1的子矩阵面积最大。行可以互相交换。(n,m<=5000)题解:妈呀差不多想出来的时候手残点了... 阅读全文
posted @ 2015-03-01 23:21 iwtwiioi 阅读(586) 评论(0) 推荐(0) 编辑
摘要:http://cojs.tk/cogs/problem/problem.php?pid=894题意:n个点m条边的加权网络,求最少边数的按编号字典序最小的最小割。(nusing namespace std;typedef long long ll;struct Gr { static const i... 阅读全文
posted @ 2015-03-01 16:38 iwtwiioi 阅读(398) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示