摘要: 1 //最大上升子序列和 2 #include<iostream> 3 #include<cstdio> 4 #include<cstdlib> 5 using namespace std; 6 const int maxx=1001; 7 int a[maxx],g[maxx]; 8 int ma 阅读全文
posted @ 2017-04-07 20:09 ANhour 阅读(734) 评论(0) 推荐(1)
摘要: 1 //怪盗基德的滑翔翼 2 #include<iostream> 3 #include<cstdio> 4 #include<cstdlib> 5 #include<cstring> 6 using namespace std; 7 const int maxx=102; 8 int a[maxx 阅读全文
posted @ 2017-04-07 20:07 ANhour 阅读(937) 评论(0) 推荐(0)
摘要: 1 //最长公共子序列 2 #include<iostream> 3 #include<cstdio> 4 #include<cstdlib> 5 using namespace std; 6 string s1,s2; 7 int f[100][100]; 8 int main() 9 { 10 阅读全文
posted @ 2017-04-07 20:07 ANhour 阅读(128) 评论(0) 推荐(0)
摘要: 1 //合唱队形 (同登山) 2 #include<iostream> 3 #include<cstdio> 4 #include<cstdlib> 5 using namespace std; 6 const int maxx=101; 7 int a[maxx],b[maxx],c[maxx]; 阅读全文
posted @ 2017-04-07 20:05 ANhour 阅读(478) 评论(0) 推荐(0)
摘要: 第一讲、Fibonacii (1) 1 //斐波那契递归求解 2 #include<iostream> 3 #include<cstdio> 4 #include<cstdlib> 5 using namespace std; 6 int f(int x) 7 { 8 if(x==1||x==2)r 阅读全文
posted @ 2017-04-07 19:15 ANhour 阅读(209) 评论(0) 推荐(0)
摘要: Problem Description 在一个地图上有n个地窖(n<=200),每个地窖中埋有一定数量的地雷。同时,给出地窖之间的连接路径,并规定路径都是单向的,也不存在可以从一个地窖出发经过若干地窖后又回到原来地窖的路径。某人可以从任一处开始挖地雷,然后沿着指出的连接往下挖(仅能选择一条路径),当 阅读全文
posted @ 2017-04-05 17:56 ANhour 阅读(887) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 const int maxx=1001; 5 int n,a[maxx][5];//a[x][1]记录内容,a[x][2]记录到目前的最长不下降子序列长度,a[x][3] 阅读全文
posted @ 2017-04-05 17:47 ANhour 阅读(218) 评论(0) 推荐(0)
摘要: 1625 数字金字塔 USACO 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 1625 数字金字塔 USACO 1625 数字金字塔 USACO 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 时间限制: 1 s 空 阅读全文
posted @ 2017-04-05 17:39 ANhour 阅读(536) 评论(0) 推荐(0)
摘要: 题目描述: 给出一个m*n的迷宫图和一个入口,一个出口。 编一个程序,打印一条从迷宫入口到出口的路径。 -1表示走不通,0表示能走,只能上下左右走; 无路可走输出“no way”; 样例输入: 8 5-1 -1 -1 -1 -1 0 0 0 0 -1-1 -1 -1 0 -1-1 0 0 0 -1- 阅读全文
posted @ 2017-03-31 16:09 ANhour 阅读(1117) 评论(0) 推荐(0)
摘要: 题目描述: 一矩形阵列由数字0到9组成,数字1到9代表细胞,细胞的定义为沿细胞数字上下左右还是细胞数字则为同一细胞,求给定矩形阵列的细胞个数。如: 阵列 4 10 0234500067 1034560500 2045600671 0000000089 输出: 4 【代码】 1 #include<io 阅读全文
posted @ 2017-03-31 11:10 ANhour 阅读(572) 评论(0) 推荐(0)