摘要: DescriptionNew Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determ... 阅读全文
posted @ 2015-04-28 21:35 Painting、时光 阅读(156) 评论(0) 推荐(0) 编辑
摘要: DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amo... 阅读全文
posted @ 2015-04-28 20:40 Painting、时光 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Problem Description小明误入迷宫,塞翁失马焉知非福,原来在迷宫中还藏着一些财宝,小明想获得所有的财宝并离开迷宫。因为小明还是学生,还有家庭作业要做,所以他想尽快获得所有财宝并离开迷宫。Input有多组测试数据。每组数据第一行给出两个正整数n,m(0#include#include#... 阅读全文
posted @ 2015-04-28 19:40 Painting、时光 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 算法大意:从一个起点出发,到达所有需要达到的点,再回到本身,求最短路法一:用状态压缩思想#include#include#include#includeusing namespace std;int n;struct edge{ int x; int y;}a[20];int temp[... 阅读全文
posted @ 2015-04-28 15:30 Painting、时光 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1.数组模拟链表实现struct edge{ int u,v,w,next;}a[MAX];int E,u,v,w;E = 0;memset(head,-1,sizeof(head));void add(int u,int v,int w){ a[E].u = u;a[E].v = v;... 阅读全文
posted @ 2015-04-28 13:25 Painting、时光 阅读(183) 评论(0) 推荐(0) 编辑