码迷,mamicode.com
首页 >  
搜索关键字:mr    ( 1325个结果
Codeforces Round #286 (Div. 2)A. Mr. Kitayuta's Gift(暴力,string的应用)
由于字符串的长度很短,所以就暴力枚举每一个空每一个字母,出现行的就输出。这么简单的思路我居然没想到,临场想了很多,以为有什么技巧,越想越迷。。。是思维方式有问题,遇到问题先分析最简单粗暴的办法,然后一步一步的优化,不能盲目的想。这道题要AC的快需要熟悉string的各种用法。这里做个简单总结:C++...
分类:其他好文   时间:2015-01-20 20:08:32    阅读次数:153
Codeforce 505D - Mr. Kitayuta's Technology 弱联通分量+拓扑排序
对于有向图M,若将其所有的边转化为无向边,则得到其基图M‘,若M’是联通的,则称有向图M是弱联通。 对于有向图M,若图中任意两点u,v(u != v)均满足u到v可达,v到u可达,则称此图为强联通。 根据以上定义显然可知,强联通图一定也满足弱联通。 此题首先我们需要找到其所有的弱联通分量。 对于每一个弱联通分量,设此弱联通分量内点的个数为ans,如果此联通分量无环,则需要的边数为ans...
分类:移动开发   时间:2015-01-20 18:00:41    阅读次数:269
MySQL资料
http://www.cnblogs.com/mr-wid/archive/2013/05/09/3068229.htmlhttp://www.cnblogs.com/daimage/archive/2012/02/25/2367534.htmlhttp://www.cnblogs.com/itec...
分类:数据库   时间:2015-01-20 17:47:32    阅读次数:160
codeforces 505C. Mr. Kitayuta, the Treasure Hunter (记忆化搜索)
题目大意:有30000个岛屿从左到右排列,给你一个n一个d,n代表有n个宝石分别,接下来n行表示每个宝石分别在哪个岛屿上,d代表你第一次从0开始跳跃到的位置,以后你每次可以从你的位置跳跃l-1,l,l+1的距离。 解题思路,其实以前做过一个类似的,他跳跃的步数其实很小,解设每次跳一步加以来也是(n+1)×n/2 = 30000差不多250左右,也就是说每次他最多也就会跳出来250种情况,所以,我...
分类:其他好文   时间:2015-01-20 10:35:28    阅读次数:249
CF 505A Mr. Kitayuta's Gift
题意 在一个字符串中插入一个字母使其变成一个回文串 可以的话输出这个回文串 否则NA大水题 插入情况最多就26*11种 可以直接暴力#include#includeusing namespace std;const int N = 20;char s[N], p[N];int l;bool ispa...
分类:其他好文   时间:2015-01-19 20:47:20    阅读次数:165
CF 505A Mr. Kitayuta's Gift(暴力)
题意  在一个字符串中插入一个字母使其变成一个回文串  可以的话输出这个回文串  否则NA 大水题  插入情况最多就26*11种  可以直接暴力 #include #include using namespace std; const int N = 20; char s[N], p[N]; int l; bool ispal() { for(int i = 0; i < (l + 1...
分类:其他好文   时间:2015-01-19 09:15:14    阅读次数:146
CF 505B Mr. Kitayuta's Colorful Graph(最短路)
题意  求两点之间有多少不同颜色的路径 范围比较小  可以直接floyd #include #include using namespace std; const int N = 105; int d[N][N][N], ans; int main() { int a, b, c, n, m, q; while(~scanf("%d%d", &n, &m)) { ...
分类:其他好文   时间:2015-01-19 09:14:48    阅读次数:114
Codeforces Round #286 Div.1 A Mr. Kitayuta, the Treasure Hunter --DP
题意:0~30000有30001个地方,每个地方有一个或多个金币,第一步走到了d,步长为d,以后走的步长可以是上次步长+1,-1或不变,走到某个地方可以收集那个地方的财富,现在问走出去(>30000)之前最多可以收集到多少财富。解法:容易想到DP,dp[i][j]表示到达 i 处,现在步长为 j 时...
分类:其他好文   时间:2015-01-19 01:37:32    阅读次数:373
codeforces Round 286# problem A. Mr. Kitayuta's Gift
Mr. Kitayuta has kindly given you a stringsconsisting of lowercase English letters. You are asked to insert exactly one lowercase English letter intos...
分类:其他好文   时间:2015-01-18 23:57:23    阅读次数:275
HDU 1856 More is better (并查集)
题目连接:请戳这里。 题目大意及思路:就是找学生最多的那个集合。注意一点的是“or there is only one boy left.”#include #include #include #include #include #include #define N 10000000+10 using namespace std; int f[N],num[N]; void Init(int ...
分类:其他好文   时间:2015-01-17 11:17:07    阅读次数:131
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!