其他
题意  老鼠在一个小镇吃奶酪  城镇可以看成一个n*n的矩阵  其中每个格子都有一定数量的奶酪mat[i][j]   老鼠从(0,0) 开始吃   而且下个吃的格子里的奶酪必须比上个格子多   老鼠只能水平方向或者垂直方向走  而且每次走的距离不能超过k  求老鼠最多能吃多少奶酪 起点是固定的   比较容易   直接记忆化搜索 令d[i][j]表示以(i,j)为终点的最优解  那么对于所有(i...
分类:其他 时间:2014-08-17 15:38:12 收藏:0 阅读:318
预测一下这道题的结果,注意unsigned与signed #include #include using namespace std; int arr[]={1,2,3,4,5}; int main(){ for(int i=-1;i<sizeof(arr)/sizeof(arr[0]) - 1;i++) cout<<arr[i+1]<<endl; } sizeof()返回的值是无符号数,...
分类:其他 时间:2014-08-17 15:38:02 收藏:0 阅读:577
解题报告 题目传送门 题意: 一个人有n个农场,他想从1到n去,有从n到1回来,要求路径最短,且没有走重复的路。 思路: 如果两次最短路感觉不行的,可以看成费用流,每一条路容量都是1,这样只要流量等于2就行了。 一次mcmf模版。 #include #include #include #include #define inf 0x3f3f3f3f using namespac...
分类:其他 时间:2014-08-17 15:37:52 收藏:0 阅读:378
PowerShell 中的 replace PowerShell 中的 replace,既是是字符串函数,还是运算符,类似于 like、match 之类。 比如,有一个字符串: $a = "aaa.bbb?ccc=ddd" 要去掉问号后面的字符,可以用 repace 函数: $a.replace("?ccc=ddd", "") 但是,replace 函数好像并不支持正则表达式,...
分类:其他 时间:2014-08-17 15:37:32 收藏:0 阅读:391
Alice and Bob Accepted : 98   Submit : 324 Time Limit : 1000 MS   Memory Limit : 65536 KB Problem Description Alice and Bob always love to play games, so does thi...
分类:其他 时间:2014-08-17 15:37:12 收藏:0 阅读:386
首先建立Trie和失败指针,然后你会发现对于每个节点 i 匹配AGCT时只有以下几种情况: i 节点有关于当前字符的儿子节点 j 且安全,则i 到 j找到一条长度为 1的路。 i 节点有关于当前字符的儿子节点 j 且 不安全,则i 到 j没有路。 i 节点没有关于当前字符的儿子节点 但是能通过失败指针找到一个安全的节点j,那么 i 到 j 找到一条长度为1的路。 关于节点安全的定义: ...
分类:其他 时间:2014-08-17 15:36:52 收藏:0 阅读:326
题意:。。。 典型的深搜,就是处理对角线的时候有些意外。 代码(注释掉的就是深搜,因为我不打表的话 TL): #include int c[11], n, ans; int res[10] = {1, 0, 0, 2, 10, 4, 40, 92, 352, 724}; /*void dfs(int cur) { if(cur == n) { ++ans; return ; } ...
分类:其他 时间:2014-08-17 15:36:32 收藏:0 阅读:288
ZOJ Problem Set - 1456 Minimum Transport Cost Time Limit: 2 Seconds      Memory Limit: 65536 KB These are N cities in Spring country. Between each pair of cities there may be one transportat...
分类:其他 时间:2014-08-17 15:36:22 收藏:0 阅读:276
Given a 2D board and a word, find if the word exists in the grid....
分类:其他 时间:2014-08-17 15:36:02 收藏:0 阅读:295
Til the Cows Come Home Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 30007   Accepted: 10092 Description Bessie is out in the field and wants to get back t...
分类:其他 时间:2014-08-17 15:35:32 收藏:0 阅读:311
1152726152727152728166744
上一页1667435下一页
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!