上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: 链接:https://www.nowcoder.com/acm/contest/93/L来源:牛客网 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 时间限制:C/C++ 3秒,其他语言6秒 空间限制 阅读全文
posted @ 2018-04-06 08:45 晓风微微 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a matrix (H × W) which contains only 1 and 0, find the area of the largest square matrix which only contains 0s. Input 1,1 1,2 2,1 2,2 In the fi 阅读全文
posted @ 2018-04-02 20:44 晓风微微 阅读(229) 评论(0) 推荐(0) 编辑
摘要: You have N items that you want to put them into a knapsack. Item i has value vi and weight wi. You want to find a subset of items to put such that: Th 阅读全文
posted @ 2018-04-02 20:05 晓风微微 阅读(275) 评论(0) 推荐(0) 编辑
摘要: Find the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times. Inp 阅读全文
posted @ 2018-04-02 19:52 晓风微微 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 蒜头君得到一张藏宝图。藏宝图是一个 10 \times 1010×10 的方格地图,图上一共有 1010 个宝藏。有些方格地形太凶险,不能进入。 整个图只有一个地方可以出入,即是入口也是出口。蒜头君是一个贪心的人,他规划要获得所有宝藏以后才从出口离开。 藏宝图上从一个方格到相邻的上下左右的方格需要  阅读全文
posted @ 2018-03-27 22:11 晓风微微 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一 阅读全文
posted @ 2018-03-25 10:22 晓风微微 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要 阅读全文
posted @ 2018-03-25 09:38 晓风微微 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 自写的板子,新鲜出炉,所以不保证没BUG,慎用 阅读全文
posted @ 2018-03-25 08:51 晓风微微 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 int* Getnext(char *p,int len_p){//p为模式串 2 int *Next = new int[len_p]; 3 Next[0] = -1; 4 int j = -1,i=0; 5 while(i * Kmp(char *s,char *p,int len_s,int len_p){//s为主串,p为匹配串 14 ... 阅读全文
posted @ 2018-03-16 20:53 晓风微微 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更 阅读全文
posted @ 2018-03-15 18:18 晓风微微 阅读(186) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页