Live2d Test Env
上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 101 下一页
摘要: Given a permutation P of 1 to N, YY wants to know whether there exists such three elements P[i 1], P[i 2], P[i 3] that P[i 1]-P[i 2]=P[i 2]-P[i 3], 1< 阅读全文
posted @ 2017-10-22 19:43 nimphy 阅读(246) 评论(0) 推荐(0) 编辑
摘要: #1601 : 最大得分 #1601 : 最大得分 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho在玩一个游戏。给定一个数组A=[A1, A2, ... AN],小Hi可以指定M个不同的值S1,S2, S3 ... SM,这样他的总得分是 ΣSi × c 阅读全文
posted @ 2017-10-22 10:30 nimphy 阅读(223) 评论(0) 推荐(0) 编辑
摘要: (不了解区间DP的同学可以看一看 这些题,一步一步摸索) X星球的考古学家发现了一批古代留下来的密码。 这些密码是由A、B、C、D 四种植物的种子串成的序列。 仔细分析发现,这些密码串当初应该是前后对称的(也就是我们说的镜像串)。 由于年代久远,其中许多种子脱落了,因而可能会失去镜像的特征。 你的任 阅读全文
posted @ 2017-10-21 13:02 nimphy 阅读(660) 评论(0) 推荐(0) 编辑
摘要: 1599 逆向bfs+优化 #include<cstdio> #include<cstdlib> #include<iostream> #include<cstring> #include<algorithm> #include<string> using namespace std; int a, 阅读全文
posted @ 2017-10-20 15:56 nimphy 阅读(712) 评论(0) 推荐(0) 编辑
摘要: N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planets through 阅读全文
posted @ 2017-10-19 18:16 nimphy 阅读(475) 评论(0) 推荐(0) 编辑
摘要: There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he woul 阅读全文
posted @ 2017-10-19 18:15 nimphy 阅读(236) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; int T,trie[110010][10],n,cnt; int f[110010]; char c[12]; bool flag; void _insert() { int L=strlen(c+1),tmp=0; for(int i=1;i... 阅读全文
posted @ 2017-10-18 07:05 nimphy 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 暴力出奇迹,我就知道没取余那么正当,肯定有什么奇淫怪巧,果然5分钟A掉。 阅读全文
posted @ 2017-10-17 19:54 nimphy 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 昨天睡得太晚,今天又在看新算法,明天事情也多,烦,所以今天刷刷水题就过去了。 叫我用线段树,我反而搞不来 阅读全文
posted @ 2017-10-17 19:28 nimphy 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 肯定会想到树的直径: 如果直径够长,就在直径(1+8)上面找路径,ans=k。 如果不够长,肯定会在有点分叉点(如3,4,5)回溯,然后我们把路径拉直,把其中一条的作为主线(有机化学,ORZ),主线是线走一遍,而分支走两遍,所以要想答案越小,主线就要求越长,也就是树的直径d,ans=d+(k-d)* 阅读全文
posted @ 2017-10-17 14:02 nimphy 阅读(260) 评论(0) 推荐(0) 编辑
上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 101 下一页